Problem with CI to WAWS

I'm new to Teamcity (and CI software in general). I have installed TeamCity 9.1.4 in an Azure VM and followed this guide to setup build, test and deploy of an ASP.NET MVC webapp to different Azure Websites.

Now, that guide says to create Web Deploy publishing profiles directly in VS. I already had those since that is how I'm actually deploying.
At some point it says to add the /p:DeployOnBuild:True argument to MsBuilt. Which I did. But I think the guide is using a Package publishing profile and not a Web Deploy because:

1) There's no <DesktopBuildPackageLocation> in a Web Deploy publishing profile (pubxml)
2) According to the guide, DeployOnBuild=True doesn't deploy to the Azure website, but instead it just creates the webdeploy package and store it as an artifact in the specified path.

So, what I want to achieve is to have a way to:

1) Build, run test and deploy to a Staging environment (using a specific Configuration).
2) If 1) is all good, be able to "promote" that build to several production environments (all Azure websites, each with its own configuration and web.config transformation)

Currently, I'm getting an error during the MSDEPLOY because it's actually trying to deploy to Azure but there's no password specified anywhere and so I'm getting "msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed."

So, since I've already have all the different publishing profiles for the different environments, do I need to create the webdeploy package and then deploy it in another build step with command line? Or is there a way to use those existing VS publishing profiles?

Thank you


I ended up disregarding that guide and doing the following:

Created one configuration called "Continuous Integration" with 3 build steps:
1) NuGet Restore
2) Visual Studio build
3) Run Tests

That configuration makes sure the project compiles and passes the test.

Then I've created another configuration to deploy to the staging environment called "Deploy to STA".
I haven't used the artifact stuff since each environment deployment needs to be built with a specific configuration.
So, this configuration has 2 steps:

1) NuGet Restore
2) A VS build with the following cmd parameters (since WebDeploy gave me more issues than solutions I stuck with classic MSBUILD):






Then, I just copied this last configuration for each of the other environments and changed the build configuration, PublishProfile and Password.

I've configured a VCS trigger on the "Continuous Integration" to run when a commit is pushed to the master branch. From then, I can promote that build to the "Deploy to STA" configuration, and from that to PROD and the other environments.
Make sure you set up the dependencies like the guide explains.

I've also added the VCS tagging and AssemblyInfoPatcher build features so I can exactly track which build is deployed to each environment.

Works like a charm.
Hope it helps.


Nice!  I was going the same direction so a validated example is very helpfull!

Thank you much,

Update -->> Confirmed!  Works like a charm!


Please sign in to leave a comment.