I am building asp.net core entity framework app and not able to configure connection string in appsettings.json file. Any one who can help?
Hi,
The Render Postgres docs show how the connection strings provided break down into their component parts:
postgres://USER:PASSWORD@HOST:PORT/DATABASE
- Database =
DATABASE
- Host/Server =
HOST
- User Name/User ID =
USER
- Port = 5432 (Postgres default)
- Password =
PASSWORD
And if you’re connecting from outside of Render, SSL is required:
- SSL Mode = “require”
I’m not familiar with .NET, but it should be a case of putting those values into the format the appsettings.json
expects. A quick search brought up various guides, like this one: https://blog.christian-schou.dk/connect-postgresql-database-to-dot-net-6/
Which shows the connection string as:
User ID=root;Password=myPassword;Host=localhost;Port=5432;Database=myDataBase;
So using the details from the Render-provided connection string above, that would be something like
User ID=USER;Password=PASSWORD;Host=HOST;Port=5432;Database=DATABASE;
Alan
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.