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-app-access-sql-database-as-user-dotnet.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,11 @@
1
1
---
2
2
title: 'Tutorial - Web app accesses SQL Database as the user'
3
3
description: Secure database connectivity with Azure Active Directory authentication from .NET web app, using the signed-in user. Learn how to apply it to other Azure services.
4
+
author: cephalin
4
5
6
+
ms.service: app-service
7
+
ms.workload: identity
8
+
ms.author: cephalin
5
9
ms.devlang: csharp
6
10
ms.topic: tutorial
7
11
ms.date: 04/21/2023
@@ -101,7 +105,7 @@ You enable authentication with Azure Active Directory as the identity provider.
101
105
102
106
1. Accept the default settings and select **Add**.
103
107
104
-
:::image type="content" source="./media/tutorial-connect-app-access-sql-database-as-user-dotnet/add-aad-provider.png" alt-text="Screenshot showing the add identity provider page.":::
> If you run into errors and reconfigure your app's authentication settings, the tokens in the token store may not be regenerated from the new settings. To make sure your tokens are regenerated, you need to sign out and sign back in to your app. An easy way to do it is to use your browser in private mode, and close and reopen the browser in private mode after changing the settings in your apps.
@@ -118,7 +122,7 @@ Currently, your Azure app connects to SQL Database uses SQL authentication (user
118
122
119
123
1. In the **Request API permissions** page for Azure SQL Database, select **Delegated permissions** and **user_impersonation**, then select **Add permissions**.
120
124
121
-
:::image type="content" source="./media/tutorial-connect-app-access-sql-database-as-user-dotnet/select-permission.png" alt-text="Screenshot of the Request API permissions page showing Delegated permissions, user_impersonation, and the Add permission button selected.":::
125
+
:::image type="content" source="./media/tutorial-connect-app-access-sql-database-as-user-dotnet/select-permission.png" alt-text="Screenshot of the Request API permissions page showing Delegated permissions, user_impersonation, and the Add permission button selected." lightbox="./media/tutorial-connect-app-access-sql-database-as-user-dotnet/select-permission.png":::
122
126
123
127
## 4. Configure App Service to return a usable access token
124
128
@@ -194,7 +198,9 @@ public MyDatabaseContext (DbContextOptions<MyDatabaseContext> options, IHttpCont
194
198
195
199
1. Publish your changes in Visual Studio. In the **Solution Explorer**, right-click your **DotNetAppSqlDb** project and select **Publish**.
196
200
197
-

201
+
![Publish from Solution Explorer]()
202
+
203
+
:::image type="content" source="./media/app-service-web-tutorial-dotnet-sqldatabase/solution-explorer-publish.png" alt-text="Screenshot showing how to publish from the Solution Explorer in Visual Studio." lightbox="./media/app-service-web-tutorial-dotnet-sqldatabase/solution-explorer-publish.png":::
0 commit comments