0

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 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I am having a heck of a time getting my nodejs app to connect to my PostgreSQL server on azure. I use environment variables in the nodejs(strapi) app for database username, pass, etc. but it does not seem to see the db. You think I need to add a connection string like you as well?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.