简体   繁体   中英

How to change the cscfg file used in Azure deployment from Visual Studio Team Services build?

How do I specify which .cscfg file should be used in an Azure deployment triggered by an automated build in Visual Studio Team Services?

Here's my current situation:

  • I have a solution using Git in Visual Studio Team Services that contains an Azure web role and an Azure worker role.
  • In the solution I've set up two .cscfg files - one for my Azure staging environment ( ServiceConfiguration.CloudTest.cscfg ), and one for my Azure production environment ( ServiceConfiguration.Cloud.cscfg ).
  • I can manually trigger a deployment from Visual Studio to either environment
  • I have an automated build in VS Team Services using GitContinuousDeploymentTemplate.12.xaml That deploys to my integration test environment, but apparently applies the ServiceConfiguration.Cloud.cscfg file. Makes sense, I suppose, since that's the default .cscfg file name

However, I can't see where in the build process I can specify a different .cscfg file name. Is there a way I can specify which .cscfg file to use in the deployment process?

You can set the msbuild arguments with the following property:

/p:TargetProfile=TFSBuildProfile

I am doing that in our automated builds for tfs online. Then it uses the ServiceConfiguration.TFSBuildProfile.cscfg when building.

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