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
What could be wrong?
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.