Azure DB for Postgres not accessible from Azure App Services

86 views Asked by At

I'm running a Dotnet Web API in a container on Azure App Services (Free tier plan).

In my application, I check the POSTGRES_CONN_STRING environment variable and then use it as a connection string for the database hosted on Azure Database for PostgreSQL.

When I run the application locally after setting the environment variable, it works well. However, in the Azure App Services configuration section, when I set it through the connection strings, it throws an error:

Log from the Log stream in App Services: System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): Name or service not known

Configuration Section in Azure App Service

What could be wrong?

1

There are 1 answers

0
skynyrd On BEST ANSWER

Looks like Azure does not expose the connection urls as an environment variable, so when I moved POSTGRES_CONN_STRING to Application Setting section instead of Connection String section, it worked.