Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing Multiple web.config files for an MVC3 Azure application

I have an ASP.NET MVC 3 application running on Azure. It also uses SQL Azure for a database.

I want to deploy this Application to different instances (Testing, Demo, multiple Productions) and each instance needs it's own unique SQL database.

I know that with the new Azure Tools update, you are able to manage Multiple Service Configurations. This is great and almost solve my problem. The only issue is with the SQL connection strings in the web.config files in the MVC part of the project.

I want the exact same functionality as with the Multiple Service Configurations feature, but to do it for the SQL connection strings.

Thanks for your help!!

like image 695
James Avatar asked Mar 09 '12 02:03

James


1 Answers

.Net configuration transformations should do the job. Like Azure Service Configurations, a separate Web.ConfigurationName.config file is created for each instance you want to deploy to. Building the solution with the proper Configuration (Testing, Demo, etc.) will insert the correct "instance" config values into the Web.config.

like image 92
Jonathan McIntire Avatar answered Oct 20 '22 12:10

Jonathan McIntire