Skip to content

Commit ffb91bd

Browse files
authored
Merge pull request #96254 from cephalin/issue#42476
-o
2 parents f84d429 + e99c1cc commit ffb91bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/app-service/app-service-web-tutorial-connect-msi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ var conn = (System.Data.SqlClient.SqlConnection)Database.GetDbConnection();
179179
conn.AccessToken = (new Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProvider()).GetAccessTokenAsync("https://database.windows.net/").Result;
180180
```
181181

182-
> [!TIP]
183-
> This demonstration code is synchronous for clarity. For more information, see [Asynchronous guide for constructors](https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#constructors).
182+
> [!NOTE]
183+
> This demonstration code is synchronous for clarity and simplicity.
184184
185185
That's every thing you need to connect to SQL Database. When debugging in Visual Studio, your code uses the Azure AD user you configured in [Set up Visual Studio](#set-up-visual-studio). You'll set up the SQL Database server later to allow connection from the managed identity of your App Service app. The `AzureServiceTokenProvider` class caches the token in memory and retrieves it from Azure AD just before expiration. You don't need any custom code to refresh the token.
186186

0 commit comments

Comments
 (0)