Rajesh Kasani
Rajesh Kasani

Reputation: 17

How to validate Azure Managed Identity setup of app service is working as per expectation0 in azure portal

Tech Stack:

I am using EFcore in API to connect to Azure sql database and this setup is working as expected in my workstation from VS2022(using from vs2022 credentail). the API connects with database without any issues. But when the same code is deployed to Azure APP service, API is not able to connect to Azure Sql instance.

Issue: Azure App service "System-managed" identity works fine in local using VS2022 but is not working in App service

Thanks in advance

Upvotes: 0

Views: 599

Answers (1)

Harshitha
Harshitha

Reputation: 7392

Thanks @Jason Pan and Thomas for the comments.

Make sure you have enabled the Managed Identity in the Azure App service.

enter image description here

As mentioned in the MSDoc, check the identity status by using the below command.

az webapp identity show --name KeyVaultAPIMay24 --resource-group YourRG

enter image description here

  • Also add the necessary roles.

enter image description here

As mentioned by Thomas check whether you have configured SQL Database with correct permissions to use Managed Identity by Amine Teffahi.

We can also configure the Managed Identity from the Visual Studio itself.

enter image description here

enter image description here

After publishing the App again, you need to Connect to the Identity Platform.

enter image description here

Upvotes: 0

Related Questions