Search code examples
azureazure-webappsazure-sql-managed-instance

Issues with Azure web app to reach Azure SQL managed instance


I have an ASP.NET Core 8 Web API, and it needs to reach an Azure SQL managed instance that exists in other resource group.

I already peered the virtual network of the managed instance with my web app virtual network.

I already created the inbound and outbound security rules on my network security group

inbound rule

outbound rule

On my web app I am using the default dns feature.

There is no firewall configured in the managed instance virtual network. The same in the web app virtual network.

When I debug the web app using visual studio I catch a timeout exception after the managed instance was not found.

If I run my web app from Visual Studio, I can reach the managed instance without problem.

I want to connect my Azure web app to my Azure SQL managed instance.


Solution

  • After adding the environment variable WEBSITE_VNET_ROUTE_ALL to my webapp as the article https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#networking. I was able to reached my managed instance