Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A user-assigned managed identity can be used to establish a connection between Azure App Service and Azure SQL in the following steps:

  1. Create a user-assigned managed identity in Azure Active Directory and assign it to the App Service.
  2. Assign the managed identity the appropriate permissions in Azure SQL.
  3. Configure the App Service to use the managed identity for authentication.
  4. Modify the connection string for the App Service to include the managed identity in the "User ID" field.

Here is an example connection string:

Server=tcp:<your_db_server_name>.database.windows.net,1433;Initial Catalog=<your_db_name>;Persist Security Info=False;User ID=<your_managed_identity_name>@<your_tenant>.onmicrosoft.com;Password=XXX;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

Note that the "User ID" field includes the name of the managed identity and the tenant ID concatenated with "@". The password is not required since the managed identity is used for authentication.

With these steps completed, the App Service will be able to establish a secure connection to the Azure SQL without the need for any additional credentials.