Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROPC: include for secure auth flow - managed identities - Razor Pages Tutorial #33408

Merged
merged 18 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions aspnetcore/includes/managed-identities-local-db-no-pwd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
author: wpickett
ms.author: wpickett
ms.date: 08/22/2024
ms.topic: include
---
In this tutorial, a local database is used that doesn't use a password; therefore a secure authentication flow isn't required.
When the app is deployed to a test server, an environment variable can be used to set the connection string to a test database server. For more information, see [Configuration](xref:fundamentals/configuration/index).

An environment variable should not be used in a production system. For a production system, use a secure method such as [Azure Key Vault](/azure/key-vault/) using the [Azure Key Vault configuration provider](xref:security/key-vault-configuration) or [Managed Identities for Azure resources](/sql/connect/ado-net/sql/azure-active-directory-authentication#using-managed-identity-authentication) to manage sensitive information like connection strings.
wadepickett marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions aspnetcore/includes/managed-identities-test-non-production.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
author: wpickett
ms.author: wpickett
ms.date: 08/22/2024
ms.topic: include
---
> [!NOTE]
> Microsoft recommends that you use the most secure authentication flow available. The authentication flow described in this procedure is only suitable for testing and local development.
>
> Azure SQL Database should use [Managed Identities for Azure resources](/sql/connect/ado-net/sql/azure-active-directory-authentication#using-managed-identity-authentication) instead of the flow described in this tutorial. For non-Azure apps, use a secure authentication flow similar to managed identities for Azure resources.
wadepickett marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 4 additions & 2 deletions aspnetcore/tutorials/razor-pages/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Part 4, work with a database
author: wadepickett
description: Part 4 of tutorial series on Razor Pages.
ms.author: wpickett
ms.date: 06/23/2024
ms.date: 08/20/2024
uid: tutorials/razor-pages/sql
---
# Part 4 of tutorial series on Razor Pages
Expand Down Expand Up @@ -40,7 +40,9 @@ The generated connection string is similar to the following JSON:

---

When the app is deployed to a test or production server, an environment variable can be used to set the connection string to a test or production database server. For more information, see [Configuration](xref:fundamentals/configuration/index).
[!INCLUDE [managed-identities](~/includes/managed-identities-local-db-no-pwd.md)]

[!INCLUDE [managed-identities-test-non-production](~/includes/managed-identities-test-non-production.md)]

# [Visual Studio](#tab/visual-studio)

Expand Down
4 changes: 3 additions & 1 deletion aspnetcore/tutorials/razor-pages/sql/includes/sql3.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ The generated connection string will be similar to the following:

---

When the app is deployed to a test or production server, an environment variable can be used to set the connection string to a test or production database server. See [Configuration](xref:fundamentals/configuration/index) for more information.
[!INCLUDE [managed-identities](~/includes/managed-identities-local-db-no-pwd.md)]

[!INCLUDE [managed-identities](~/includes/managed-identities-test-non-production.md)]

# [Visual Studio](#tab/visual-studio)

Expand Down
4 changes: 3 additions & 1 deletion aspnetcore/tutorials/razor-pages/sql/includes/sql5.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ The generated connection string is similar to the following JSON:

---

When the app is deployed to a test or production server, an environment variable can be used to set the connection string to a test or production database server. For more information, see [Configuration](xref:fundamentals/configuration/index).
[!INCLUDE [managed-identities](~/includes/managed-identities-local-db-no-pwd.md)]

[!INCLUDE [managed-identities](~/includes/managed-identities-test-non-production.md)]

# [Visual Studio](#tab/visual-studio)

Expand Down
4 changes: 3 additions & 1 deletion aspnetcore/tutorials/razor-pages/sql/includes/sql6.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ The generated connection string is similar to the following JSON:

---

When the app is deployed to a test or production server, an environment variable can be used to set the connection string to a test or production database server. For more information, see [Configuration](xref:fundamentals/configuration/index).
[!INCLUDE [managed-identities](~/includes/managed-identities-local-db-no-pwd.md)]

[!INCLUDE [managed-identities](~/includes/managed-identities-test-non-production.md)]

# [Visual Studio](#tab/visual-studio)

Expand Down
4 changes: 3 additions & 1 deletion aspnetcore/tutorials/razor-pages/sql/includes/sql7.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ The generated connection string is similar to the following JSON:

---

When the app is deployed to a test or production server, an environment variable can be used to set the connection string to a test or production database server. For more information, see [Configuration](xref:fundamentals/configuration/index).
[!INCLUDE [managed-identities](~/includes/managed-identities-local-db-no-pwd.md)]

[!INCLUDE [managed-identities](~/includes/managed-identities-test-non-production.md)]

# [Visual Studio](#tab/visual-studio)

Expand Down
4 changes: 3 additions & 1 deletion aspnetcore/tutorials/razor-pages/sql/includes/sql8.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ The generated connection string is similar to the following JSON:

---

When the app is deployed to a test or production server, an environment variable can be used to set the connection string to a test or production database server. For more information, see [Configuration](xref:fundamentals/configuration/index).
[!INCLUDE [managed-identities](~/includes/managed-identities-local-db-no-pwd.md)]

[!INCLUDE [managed-identities](~/includes/managed-identities-test-non-production.md)]

# [Visual Studio](#tab/visual-studio)

Expand Down
Loading