Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Unable to login to Azure SQL database thru Azure App Service using User Managed Identity
mksharma
0
Reputation points Microsoft Employee
I am trying to connect to an Azure SQL Database from an Azure App Service using User Managed Identity.
I have created a Managed Identity, granted it permissions to the database. I have also added the identity into the App-Service.
The code to connect to the database is as follows:
credential = identity.DefaultAzureCredential(exclude_interactive_browser_credential=False)
token = credential.get_token("https://database.windows.net/.default").token.encode("UTF-16-LE")
token_struct = struct.pack(f'
Azure App Service
Azure App Service
Sign in to answer