You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-connect-msi-sql-database.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 'Tutorial: Access data with managed identity'
2
+
title: 'Tutorial: Access Azure data with managed identity'
3
3
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.
# 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
13
13
14
14
[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.
15
15
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.
17
17
18
18

19
19
@@ -28,9 +28,9 @@ In this tutorial, you:
28
28
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).
29
29
30
30
> [!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.
32
32
>
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).
34
34
35
35
## Prerequisites
36
36
@@ -41,14 +41,14 @@ For guidance about using Azure Database for MySQL or Azure Database for PostgreS
41
41
-[Tutorial: Build an ASP.NET app in Azure with Azure SQL Database](app-service-web-tutorial-dotnet-sqldatabase.md)
42
42
-[Tutorial: Build an ASP.NET Core and Azure SQL Database app in Azure App Service](tutorial-dotnetcore-sqldb-app.md)
43
43
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:
45
45
46
46
- .NET Framework 4.8 and above
47
47
- .NET 6.0 and above
48
48
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).
50
50
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.
@@ -63,7 +63,7 @@ The Microsoft Entra admin must be a user that is created, imported, synced, or i
63
63
64
64
Run the following commands in the Bash environment of Azure Cloud Shell, or after signing in to Azure locally.
65
65
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`.
67
67
68
68
```azurecli
69
69
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
72
72
> [!TIP]
73
73
> To see the list of all user principal names in Microsoft Entra ID, run `az ad user list --query '[].userPrincipalName'`.
74
74
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.
76
76
77
77
```azurecli
78
78
az sql server ad-admin create --resource-group myResourceGroup --server-name <server-name> --display-name ADMIN --object-id $azureaduser
79
79
```
80
80
81
81
## Set up your development environment
82
82
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).
84
84
85
85
### Visual Studio for Windows
86
86
@@ -91,7 +91,7 @@ Visual Studio for Windows is integrated with Microsoft Entra authentication.
91
91
92
92
### Visual Studio Code
93
93
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.
95
95
96
96
1. In Visual Studio Code, install the <ahref="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack"target="_blank">Azure Tools</a> extension.
97
97
1. In the [Activity Bar](https://code.visualstudio.com/docs/getstarted/userinterface), select the **Azure** logo.
0 commit comments