I'm new to ASP.NET Core. I am trying to develop a simple ASP.NET Core Web API. The API connects to the database server in the cloud. I stored the connection string in the appsettings.json, deployed the API to my local IIS, and ran the service. It worked fine. When I try to move the connection string to the environment variables and deploy again, the Web API does not work. The browser shows me "The page isn't working. HTTP error 500".
I have couple of questions to ask:
- In a real world application, where should we store the connection string and deploy to the server since the user name and password is sensitive?
- What's wrong with my Web API, since it wont work when the connection string is stored in the environment variables?
Thanks
UseDeveloperExceptionPage()on the server so that you can get a more specific error message. Alternatively, you may be able to get exception details from your cloud host’s logs.UseDeveloperExceptionPage()in yourStartupclass should provide you with a more specific exception message which will aid in isolating the issue.