Question

I have a solution that has a mvc website (WebApplication1) that is dependent on another project in the solution (WebAppCore). The source is hosted in git on Visual Studio Online. I configured a Continuous Integration. Everything builds fine but when the deployment occurs, it deploys WebAppCore. As I understand it, that's the expected behavior since that's the first project in the solution. I want it to deploy WebApplication1.

My question appears to be identical to this one: Azure websites deploy specific web project

The solution to that question is to go to the azure website configure page and add an app setting of Project and give it the repo root relative path of the project I want deployed. In my case that was:

Project: WebApplication1\WebApplication1\WebApplication1.csproj

The setting doesn't seem to work. I've tried many other combinations of the path to the project and none seem to work.

Here are more details:

  • Visual Studio 2013
  • Visual Studio Online
  • Hosted git Build Process
  • Template is GitContinuousDeploymentTemplate.12.xaml

In the template Process settings:

  • Build\Projects set to the solution
  • Deployment\Windows Azure Deployment Environment is my azure website.

Troubleshooting 1 Since these are all test projects, when I remove WebAppCore, WebApplication1 is now the only project in the solution and that deploys fine.

Troubleshooting 2 Even though it's not the fix I want, I decided to attempt using a .deployment file as described here (although this article also mentions using a Project app setting): How can I use the TFS Online <--> Azure Website integration when there are two web apps in the solution

This did not work either

Was it helpful?

Solution

I received this comment from Microsoft on a different forum and thought I'd add it here as it turned out to be the answer:

Currently build definitions which do a CI from VSO to Azure will deploy the first web application alphabetically in that solution. If you have a specific web application you want to deploy you will need to create a solution with only that web application in it. The setup wizard from the azure portal does it's best to set everything up for you based on simple conventions of only 1 solution in your team project and only 1 website in your solution. This is something we expect to address in the future in order to provide users with more flexibility and control.

Link http://social.msdn.microsoft.com/Forums/windowsazure/en-US/95f161f6-9370-43ad-9ac5-714f8978cc5e/continuous-integration-deploying-wrong-project-from-solution?forum=azuregit

OTHER TIPS

I came up with a workaround that I think should work for you. Wrote a blog post about it here:

http://peter.orneholm.com/post/84647111808/deploy-to-multiple-azure-websites-with-visual-studio

TD;DR: Create multiple solution configurations and only build the project you want to deploy. Then associate the build with the correct build config.

Or set the Project attribute under App Settings in Azure.

See: Azure websites deploy specific web project

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top