Skip to content

Commit 697e701

Browse files
committed
more touchups
1 parent f2d9170 commit 697e701

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Enable Microsoft Entra authentication to the Azure SQL database by assigning a M
5757

5858
Run the following commands in the Bash environment of Azure Cloud Shell, or after signing in to Azure CLI locally.
5959

60-
1. Use [`az ad user list`](/cli/azure/ad/user#az-ad-user-list) with the `display-name`, `filter`, or `upn` parameter to get the object ID for the Microsoft Entra ID user. Run `az ad user list` standalone to show information for all the users in the Microsoft Entra directory.
60+
1. Use [`az ad user list`](/cli/azure/ad/user#az-ad-user-list) with the `display-name`, `filter`, or `upn` parameter to get the object ID for the Microsoft Entra ID user you want to make admin. Run `az ad user list` standalone to show information for all the users in the Microsoft Entra directory.
6161

6262
For example, the following command lists information for a Microsoft Entra ID user with the `display-name` of Firstname Lastname.
6363

@@ -81,15 +81,15 @@ Run the following commands in the Bash environment of Azure Cloud Shell, or afte
8181
"userPrincipalName": "[email protected]"
8282
```
8383

84-
1. Add the Microsoft Entra ID user `id` as an admin on the Azure SQL server by using [`az sql server ad-admin create`](/cli/azure/sql/server/ad-admin#az-sql-server-ad-admin-create). In the following command, replace `<server-name>` with your server name without the `.database.windows.net` suffix, and `<entra-id>` with the `id` value from the preceding `az ad user list` command.
84+
1. Add the Microsoft Entra ID user as an admin on the Azure SQL server by using [`az sql server ad-admin create`](/cli/azure/sql/server/ad-admin#az-sql-server-ad-admin-create) with the `object-id` parameter. In the following command, replace `<server-name>` with your server name minus the `.database.windows.net` suffix, and `<entra-id>` with the `id` value from the output of the preceding `az ad user list` command.
8585

8686
```azurecli
8787
az sql server ad-admin create --resource-group myResourceGroup --server-name <server-name> --display-name ADMIN --object-id <entra-id>
8888
```
8989

9090
## Set up managed identity connectivity for the app
9191

92-
The following steps configure your app to connect to Azure SQL Database with a system-assigned managed identity. To use a user-assigned identity, see [Tutorial: Connect to Azure databases from App Service without secrets using a managed identity](tutorial-connect-msi-azure-database.md).
92+
The following steps configure your app to connect to Azure SQL Database by using a system-assigned managed identity. To use a user-assigned identity, see [Tutorial: Connect to Azure databases from App Service without secrets using a managed identity](tutorial-connect-msi-azure-database.md).
9393

9494
### Enable managed identity for the app
9595

@@ -110,7 +110,7 @@ Here's an example of the output:
110110
}
111111
```
112112

113-
To enable managed identity for a [deployment slot](deploy-staging-slots.md), add `--slot <slot-name>` and use the name of the slot in `<slot-name>`. The name of a system-assigned identity for a deployment slot is `<app-name>/slots/<slot-name>`.
113+
To enable managed identity for a [deployment slot](deploy-staging-slots.md), add `--slot <slot-name>` to the preceding command and use the name of the slot in `<slot-name>`. The name of a system-assigned identity for a deployment slot is `<app-name>/slots/<slot-name>`.
114114

115115
You can also add the identity to a [Microsoft Entra group](/azure/active-directory/fundamentals/active-directory-manage-groups), then grant SQL Database access to the Microsoft Entra group instead of to the identity. To grant permissions for a Microsoft Entra group, use the group's display name. The following commands add the example managed identity to a new group called `myAzureSQLDBAccessGroup`.
116116

@@ -125,10 +125,10 @@ az ad group member list -g $groupid
125125

126126
Grant the identity the minimum permissions your app needs.
127127

128-
1. Open a PowerShell command line and sign in to SQL Database by using the following SQLCMD command, replacing `<server-name>` with your server name, `<db-name>` with your database name, and `<entra-admin-user>` with the Microsoft Entra user you granted admin access.
128+
1. Open a PowerShell command line and sign in to SQL Database by using the following SQLCMD command. Replace `<server-name>` with your server name, `<db-name>` with your database name, and `<admin-user>` with the `userPrincipalName` of the admin user from the output of the preceding `az ad user list` command.
129129

130130
```azurepowershell
131-
sqlcmd -S <servername>.database.windows.net -d <db-name> -U <entra-admin-user> -G -l 30
131+
sqlcmd -S <servername>.database.windows.net -d <db-name> -U <admin-user> -G -l 30
132132
```
133133

134134
Follow the prompts to sign in.
@@ -148,7 +148,7 @@ Grant the identity the minimum permissions your app needs.
148148
149149
### Remove the original connection string
150150

151-
Any changes you made in *web.config* or *appsettings.json* work with the managed identity. You can remove the original connection string you used when you deployed your app the first time. To delete the connection string, run the following Azure CLI command, replacing `<app-name>` with the name of your app.
151+
Any changes you made in *web.config* or *appsettings.json* work with the managed identity. You can remove the original connection string you used when you deployed your app the first time. To delete the connection string, run the following Azure CLI command, replacing `<app-name>` with the name of your app and `<connection-string-name>` with the name of your connection string.
152152

153153
```azurecli
154154
az webapp config connection-string delete --resource-group myResourceGroup --name <app-name> --setting-names <connection-string-name>
@@ -218,7 +218,7 @@ An ASP.NET Core app uses [Entity Framework Core](/ef/core/) by default.
218218
>
219219
>If the app is deployed, the driver gets a token from the app's system-assigned managed identity. The driver can also authenticate with a user-assigned managed identity if you include `User Id=<client-id-of-user-assigned-managed-identity>;` in your connection string.
220220
>
221-
>The `DefaultAzureCredential` class caches the token in memory and retrieves it from Microsoft Entra ID just before expiration. You don't need any custom code to refresh the token.
221+
>The `DefaultAzureCredential` class caches the token in memory and retrieves it from Microsoft Entra ID before expiration. You don't need any custom code to refresh the token.
222222
223223
You now have everything you need to connect to Azure SQL Database when you debug in Visual Studio. Your code uses the Microsoft Entra user you configured when you set up your dev environment.
224224

@@ -258,13 +258,13 @@ An ASP.NET app uses [Entity Framework](/ef/ef6/) by default.
258258
}
259259
```
260260

261-
1. Add the following attribute to the *DatabaseContext.cs* file.
261+
1. Add the following attribute to the file.
262262

263263
```csharp
264264
[DbConfigurationType(typeof(AppServiceConfiguration))]
265265
```
266266

267-
1. In your *web.config* file, replace the value of the connection string with the following code, replacing `<server-name` and `<database-name>` with your server name and database name. This connection string is used by the default constructor in *DatabaseContext.cs*.
267+
1. In your *web.config* file, replace the value of the connection string with the following code. Replace `<server-name` and `<database-name>` with your server name and database name. This connection string is used by the default constructor in the database context configuration.
268268

269269
```json
270270
"Server=tcp:<server-name>.database.windows.net;Authentication=Active Directory Default; Database=<database-name>;"

0 commit comments

Comments
 (0)