Skip to content

Commit 8ab12d8

Browse files
committed
changes
1 parent 3ddd748 commit 8ab12d8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/app-service/tutorial-connect-msi-sql-database.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Tutorial: Access data with managed identity'
2+
title: 'Tutorial: Access Azure data with managed identity'
33
description: Learn how your app can use managed identity for secure access to Azure SQL Database and other Azure services without using passwords or secrets.
44
author: cephalin
55
ms.author: cephalin
@@ -9,11 +9,11 @@ ms.topic: tutorial
99
ms.date: 05/27/2025
1010
ms.custom: devx-track-csharp, mvc, cli-validate, devx-track-azurecli, devx-track-dotnet, AppServiceConnectivity
1111
---
12-
# Tutorial: Connect to SQL Database from a .net web Azure App Service using a managed identity
12+
# Tutorial: Use a managed identity to connect to an Azure ASP.NET web app and Azure SQL back end
1313

1414
[Azure App Service](overview.md) provides a highly scalable, self-patching web hosting service in Azure. App Service also provides a [managed identity](overview-managed-identity.md) for your app, which is a turnkey solution for securing access to [Azure SQL](/azure/azure-sql/) and other Azure services. Managed identities in App Service make your app more secure by eliminating secrets, such as credentials in connection strings.
1515

16-
This tutorial shows you how to add managed identity to a sample .NET app that uses Azure SQL Database. After you finish, your app can connect to SQL Database securely without the need for a user name and password.
16+
This tutorial shows you how to add managed identity to a sample .NET app that has an Azure SQL backend. After you finish, your app can connect to to the Azure SQL database securely without the need for a user name and password.
1717

1818
![Architecture diagram for tutorial scenario.](media/tutorial-connect-msi-sql-database/architecture.png)
1919

@@ -28,9 +28,9 @@ In this tutorial, you:
2828
For guidance about using Azure Database for MySQL or Azure Database for PostgreSQL in Node.js, Python, and Java frameworks, see [Tutorial: Connect to Azure databases from App Service without secrets using a managed identity](tutorial-connect-msi-azure-database.md).
2929

3030
> [!NOTE]
31-
> Microsoft Entra ID and managed identities aren't supported for on-premises SQL Server.
31+
> - Microsoft Entra ID and managed identities aren't supported for on-premises SQL Server.
3232
>
33-
> Microsoft Entra authentication is different from [Integrated Windows authentication](/previous-versions/windows/it-pro/windows-server-2003/cc758557(v=ws.10)) in on-premises Active Directory (AD) Domain Services (DS). AD DS and Microsoft Entra ID use completely different authentication protocols. For more information, see [Microsoft Entra Domain Services documentation](/azure/active-directory-domain-services/index).
33+
> - Microsoft Entra authentication is different from [Integrated Windows authentication](/previous-versions/windows/it-pro/windows-server-2003/cc758557(v=ws.10)) in on-premises Active Directory (AD) Domain Services (DS). AD DS and Microsoft Entra ID use completely different authentication protocols. For more information, see [Microsoft Entra Domain Services documentation](/azure/active-directory-domain-services/index).
3434
3535
## Prerequisites
3636

@@ -41,14 +41,14 @@ For guidance about using Azure Database for MySQL or Azure Database for PostgreS
4141
- [Tutorial: Build an ASP.NET app in Azure with Azure SQL Database](app-service-web-tutorial-dotnet-sqldatabase.md)
4242
- [Tutorial: Build an ASP.NET Core and Azure SQL Database app in Azure App Service](tutorial-dotnetcore-sqldb-app.md)
4343

44-
You can also use your own .NET web app that uses Azure SQL Database as the back end. The steps in this tutorial support the following versions:
44+
You can also use your own .NET web app that uses Azure SQL Database as the back end. The steps in this tutorial support the following .NET versions:
4545

4646
- .NET Framework 4.8 and above
4747
- .NET 6.0 and above
4848

49-
- Make sure to allow client connection from your computer to Azure, so you can debug your app. You can add the client IP by following the steps at [Manage server-level IP firewall rules using the Azure portal](/azure/azure-sql/database/firewall-configure#use-the-azure-portal-to-manage-server-level-ip-firewall-rules).
49+
- Allow client connection from your computer to Azure, so you can debug your app. You can add the client IP address by following the steps at [Manage server-level IP firewall rules using the Azure portal](/azure/azure-sql/database/firewall-configure#use-the-azure-portal-to-manage-server-level-ip-firewall-rules).
5050

51-
- If necessary, prepare your environment to use the Azure CLI.
51+
- Use Azure Cloud Shell or prepare your environment to use the Azure CLI.
5252
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
5353

5454
<a name='1-grant-database-access-to-azure-ad-user'></a>
@@ -63,7 +63,7 @@ The Microsoft Entra admin must be a user that is created, imported, synced, or i
6363

6464
Run the following commands in the Bash environment of Azure Cloud Shell, or after signing in to Azure locally.
6565

66-
1. Find the object ID of the Microsoft Entra user by using [`az ad user list`](/cli/azure/ad/user#az-ad-user-list). The following example saves the result of the query on `<user-principal-name>` to a variable called `azureaduser`.
66+
1. Use [`az ad user list`](/cli/azure/ad/user#az-ad-user-list) to find the `userPrincipalName` of the Microsoft Entra user, and use it to replace `<user-principal-name>` in the following code. The code saves the result of the query on `<user-principal-name>` to a variable called `azureaduser`.
6767

6868
```azurecli
6969
azureaduser=$(az ad user list --filter "userPrincipalName eq '<user-principal-name>'" --query '[].id' --output tsv)
@@ -72,15 +72,15 @@ Run the following commands in the Bash environment of Azure Cloud Shell, or afte
7272
> [!TIP]
7373
> To see the list of all user principal names in Microsoft Entra ID, run `az ad user list --query '[].userPrincipalName'`.
7474
75-
1. Add the Microsoft Entra user as an Azure SQL server admin by using [`az sql server ad-admin create`](/cli/azure/sql/server/ad-admin#az-sql-server-ad-admin-create), replacing `<server-name>` with your server name without the `.database.windows.net` suffix.
75+
1. Add `$azureaduser` as an Azure SQL server admin by using [`az sql server ad-admin create`](/cli/azure/sql/server/ad-admin#az-sql-server-ad-admin-create), replacing `<server-name>` with your server name without the `.database.windows.net` suffix.
7676

7777
```azurecli
7878
az sql server ad-admin create --resource-group myResourceGroup --server-name <server-name> --display-name ADMIN --object-id $azureaduser
7979
```
8080

8181
## Set up your development environment
8282

83-
Set up your development environment and sign in to Azure. For more information about setting up your dev environment for Microsoft Entra authentication, see [Azure Identity client library for .NET](/dotnet/api/overview/azure/Identity-readme).
83+
Set up your chosen development environment and sign in to Azure. For more information about setting up your dev environment for Microsoft Entra authentication, see [Azure Identity client library for .NET](/dotnet/api/overview/azure/Identity-readme).
8484

8585
### Visual Studio for Windows
8686

@@ -91,7 +91,7 @@ Visual Studio for Windows is integrated with Microsoft Entra authentication.
9191

9292
### Visual Studio Code
9393

94-
Visual Studio Code is integrated with Microsoft Entra authentication through the Azure extension.
94+
Visual Studio Code is integrated with Microsoft Entra authentication through the Azure Tools extension.
9595

9696
1. In Visual Studio Code, install the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack" target="_blank">Azure Tools</a> extension.
9797
1. In the [Activity Bar](https://code.visualstudio.com/docs/getstarted/userinterface), select the **Azure** logo.

0 commit comments

Comments
 (0)