简体   繁体   中英

Automatic azure deployment

We've developed a MVC application that uses a SQL database to store data. We chose the approach to have a separate web app in azure (customer.ourdomain.com) per customer, as well as a separate database per customer running on our SQL server. This database is pointed to by the MVC application in the web.config file.

I've also created a website where new customers can register to use / try our product. Now every time somebody registers for our product I want the following to happen:

  • Create an Azure web app with the name of the company / customer that registers
  • Create a new database including the tables and relationships that our application needs
  • Publish the stable release of our application to the web app in azure and configure the application to use the newly created database

I've managed to do the first step using Azure ARM templates and the second step using dacpac and the Azure API, but I don't know how to use TFS (or any other method) to publish a stable release and change the connection strings before publishing the application to the azure app. (I've not even managed to publish anything with C# code).

Is the approach I'm taking in general okay or should I take a different approach? What is the best way to publish a stable release to the web app and most importantly, change the connection string so the published version will connect to the new database?

If you get vsts to package up your stable release and upload it to blob storage, you can reference that web app as part of the ARM template deployment, ie. include the web app code deployment along with the web app service itself.

This page shows how it can be done. I think you can also get the web app and ARM template to pull a release from vsts (I'm pretty confident you can do it via GitHub) using the app service's source control integration/CD settings as well, but cant find any details on this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM