How to configure AKS deployment to make an ASP.NET app able to connect to an Azure SQL database

7/16/2021

I have a .NET 5.0 App that connects to a SQL Server database. If I host the App in Azure App service and the database in Azure SQL database, all is fine.

Now I put the App in a Docker container and deploy it in AKS. It doesn't work anymore (can't connect to the Azure SQL database).

How should I configure my AKS deployment to have it working?

-- Franco Tiveron
asp.net-core
azure-aks
azure-sql-server
kubernetes
sql-server

1 Answer

7/16/2021

Did you check about the ingress and firewall rules ?

https://docs.microsoft.com/en-us/azure/azure-sql/database/firewall-configure

Open the firewall or edit ingress rules so that AKS PODs can connect to the database or else you have to the VPC peering.

https://docs.microsoft.com/en-us/azure/azure-sql/database/private-endpoint-overview

-- Harsh Manvar
Source: StackOverflow