I have a complete web app working locally, and I am now working on getting it going in production. The app is currently sitting on Azure, and watching a git repo for new deployments, which is working great.
However, the app has a connection in its appsettings.json for a connection string, which looks like this:
"database": {
"connection": "Data Source=(localdb)\\mssqllocaldb;Initial Catalog=Foo"
},
// In Startup()
var builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables();
// In ConfigureServices(...)
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<FooDbContext>(options =>
{
options.UseSqlServer(Configuration["database:connection"]);
});
This is fine for local testing, but now I'm ready to move to production and have some questions (couldn't find good documentation).
How do I use the
dnxcommand line to push my changes to a production DB? Everything is tied to the DB defined by the app, statically, so it'll by default go to my local DB, always.Once the DB is provisioned in Azure, do I simply need to modify my connection string in the settings on Azure for the web app, like this?
