Bubble Bub

Bubble Bub

  • NA
  • 19
  • 4.5k

How to deploy ASP.Net core API with connectionstring to IIS?

Jan 8 2020 12:20 AM
I'm new to ASP.Net core.  I try to develop a simply ASP.Net core MVC Web API.  The API will connect the database host at cloud.  I write the connection string in the appsetting.json and I try to deploy the API in my local IIS and run the API.  It's work fine.  When I try to move the connection string to Environment variable and deploy again, the Web API not work.  The browser show me "The Page isn't working.  HTTP error 500".
 
I have few question to ask
 
1.  In real world, where should we store the connection string and deploy to server since the user name and password is sensitive.
2.  What's wrong to my Web API, it wont work when the connection string is in Environment variable?
 
Thanks 

Answers (2)