Visual Studio Online continuous deployment to Azure Website with publish profile
Asked Answered
K

1

5

I am using Visual Studio Online to deploy my project continuously after the CI build pass. However I have to use a publish profile to build the production web.config transform so that the deployed website will be using the production DB instead of dev DB. I have followed Scott Hanselman's blog post to add the MSBuild arguments in the CI build definition. My arguments are like this:

/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 working, the deployed website is using production DB now.

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

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

Which is exactly what I want. So I removed the MSBuild arguments, set the Path to Deployment Settings by select the pubxml file in the popup, and give it another try.

However, this nice and simple way doesn't work at all. Even if it is pointing to the same pubxml file, and both ways got green CI builds, the later one seems still use the default web.config not the transformed one after deployment.

So I am curious if anyone know what is the difference between the PublishProfile in MSBuild arguments and Path to Deployment Settings? Am I using the right way to do this?

Kyat answered 24/10, 2014 at 12:49 Comment(2)
All I know is that it is described here as "The path to your .pubxml file for a website, relative to the root folder of the repo. Ignored for cloud services."Cushion
@davenewza yeah, that article is exactly the same one in my question. :) And what caused my confusion and led to this question.Kyat
M
4

I had the same problem. I found that "Path to Deployment Settings" sets the MSBuild parameter "/p:PublishProfilePath". You can see this in the Diagnostic log of the build. I'm not sure what the PublishProfilePath parameter does though.

But I got transforms working a different way. In the "Build" section, I set "Configurations" to use the Release configuration. Publishing through VSO build seems to apply the transform for the config.

Megdal answered 29/10, 2014 at 2:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.