Here is the connection string I copied from my Azure portal:
Server=tcp:xxxxxxxxxxx.database.windows.net,9999;Initial Catalog=DbNameDB;Persist Security Info=False;User ID={my_username};Password={my_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
Here is my appsettings.json file:
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"ConnectionStrings": {
"DefaultConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=HeroesDB;Integrated Security=True;MultipleActiveResultSets=True"
}
}
Now that I want my app to work on a production server, how do I set it up?
Should I ...
- ...create an appsettings.production.json file in my project (next to my appsettings.json file) and set it's DefaultConnectionString to Azure server's connection string? If I did so, would Azure automatically know which of the two files to use?
- ...change my original appsettings.json file's connection string to Azure server connection string?
- ...look for a totally different solution? If yes, what would you suggest?
I'm leaning towards solution no 1., but I want to be sure.