Unable to Access SQL Server Database on Azure VM After Deploying API to Azure Container Apps

Irene IRADUKUNDA 0 Reputation points Microsoft External Staff
2025-04-18T14:14:43.3+00:00

Hello,

I have set up an Azure Virtual Machine (VM) where I have my development environment configured, including Visual Studio Code 22 and SQL Server. Recently, I deployed my API using Azure Container Apps. However, I am encountering issues when trying to access the SQL Server database from my deployed API. The connection attempts keep failing. The connection on my development environment is ok. Below is a screenshot of the error.

User's image

Steps taken to fix:

  • Checked the instance name (Ok)
  • Enabled Remote connection on SQL Server Management Studio
  • Enabled TCP/IP on SQL Server Configuration Manager
  • Added inbound & outbound rule to my Windows Defender Firewall to allow connection on port 1433.
  • Both The SQL Server and SQL Server Browser are running.
SQL Server on Azure Virtual Machines
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.