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-dotnetcore-sqldb-app.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,6 +181,9 @@ The creation wizard generated connection strings for the SQL database and the Re
181
181
:::column-end:::
182
182
:::row-end:::
183
183
184
+
> [!TIP]
185
+
> The SQL database connection string uses SQL authentication. For more secure, passwordless authentication, see [How do I change the SQL Database connection to use a managed identity instead?](#how-do-i-change-the-sql-database-connection-to-use-a-managed-identity-instead)
186
+
184
187
## 3. Deploy sample code
185
188
186
189
In this step, you configure GitHub deployment using GitHub Actions. It's just one of many ways to deploy to App Service, but also a great way to have continuous integration in your deployment process. By default, every `git push` to your GitHub repository kicks off the build and deploy action.
@@ -682,6 +685,29 @@ If a step fails in the autogenerated GitHub workflow file, try modifying the fai
682
685
683
686
See [Set up GitHub Actions deployment from the Deployment Center](deploy-github-actions.md#set-up-github-actions-deployment-from-the-deployment-center).
684
687
688
+
### How do I change the SQL Database connection to use a managed identity instead?
689
+
690
+
The default connection string to the SQL database is managed by Service Connector, with the name *defaultConnector*, and it uses SQL authentication. To replace it with a connection that uses a managed identity, run the following commands in the [cloud shell](https://shell.azure.com):
691
+
692
+
```azurecli-interactive
693
+
az extension add --name serviceconnector-passwordless --upgrade
az sql server update --enable-public-network false
698
+
```
699
+
700
+
By default, they command`az webapp connection create sql --client-type dotnet --system-identity --config-connstr` does the following:
701
+
702
+
- Sets your user as the Entra ID administrator of the SQL database server.
703
+
- Create a system-assigned managed identity and grants it access to the database.
704
+
- Generates a passwordless connection string called `AZURE_SQL_CONNECTIONGSTRING`, which your app is already using at the end of the tutorial.
705
+
706
+
Your app should now have connectivity to the SQL database. For more information, see [Tutorial: Connect to Azure databases from App Service without secrets using a managed identity](tutorial-connect-msi-azure-database.md).
707
+
708
+
> [!TIP]
709
+
> Don't want to enable public network connectivity? You can run it from an [Azure cloud shell that's integrated with your virtual network](../cloud-shell/vnet/deployment.md) if you have the **Owner** role assignment on your subscription.
710
+
685
711
### What can I do with GitHub Copilot in my codespace?
686
712
687
713
You might have noticed that the GitHub Copilot chat view was already there foryou when you created the codespace. For your convenience, we include the GitHub Copilot chat extensionin the container definition (see *.devcontainer/devcontainer.json*). However, you need a [GitHub Copilot account](https://docs.github.com/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor) (30-day free trial available).
0 commit comments