Continuous Deployment of Visual Studio Online on Azure Website with Profile Publishing

I use Visual Studio Online to deploy my project continuously after going through CI. However, I have to use the publish profile to create the production conversion of web.config so that the deployed website uses the production database instead of Dev DB. I added a Scott Hanselman blog post to add MSBuild arguments to the definition of CI build. My arguments are as follows:

/p:DeployOnBuild=true /p:PublishProfile=[publish profile name] /p:AllowUntrustedCertificate=true /p:UserName=[credentials obtained from Azure Website portal] /p:Password=[from the portal as well] 

It seems that the work, the deployed website is now using a production database.

Then I noticed that there is one parameter in the CI assembly definition in the Deployment section: Path to Deployment Settings. From this article it says:

"The path to your .pubxml file for the website relative to the repo root folder. Ignored for cloud services.

This is exactly what I want. Therefore, I removed the MSBuild arguments, set the "Deployment Path" options, highlighting the pubxml file in the popup window and try again.

However, this nice and easy way doesn't work at all. Even if it points to the same pubxml file and both methods got green CI assemblies, the later one seems to still use web.config by default, rather than being converted after deployment.

So, I'm curious to know what is the difference between PublishProfile in MSBuild arguments and the Deployment Path settings? Am I using the right way to do this?

+4
msbuild vsts azure-web-sites continuous-deployment
source share
1 answer

I had the same problem. I found that the "Deployment Settings Path" sets the MSBuild parameter "/ p: PublishProfilePath". This can be seen in the assembly diagnostic log. I'm not sure what PublishProfilePath does.

But I have transformations working differently. In the "Build" section, I installed "Configurations" to use the Release configuration. Publishing via the VSO assembly seems to have applied the transform to the configuration.

+3
source share

All Articles