locked
Deploying repositories with more than one solution / web application RRS feed

  • Question

  • I previously asked on Scott Hanselman's post about deploying git repositories with more than one solution. I see there is a way of specifying the correct project to deploy via a .deployment file at the repository root. 

    I'd like to be able to use the same git repository with multiple azure websites. In this case, I'd need a way of specifying on a per website basis which website needs to be deployed. 

    I know I should probably be doing one repository = one website but this won't always be the case.

    Sunday, June 10, 2012 2:57 PM

Answers

  • We don't currently support the scenario where a single repo contains multiple sites and you want to deploy different ones to different Azure sites.

    I think technically you could so it by using different branches with different .deployment files, but it's a bit tricky since we currently only deploy master. So you'd need to do something like 'git push azure somebranch:master'.

    Sunday, June 10, 2012 3:14 PM
  • I've addressed this issue in my blog:

    http://blog.amitapple.com/post/38419111245/azurewebsitecustomdeploymentpart3

    Basically we use:

    a) Custom deployment feature where you own the deployment of your site.

    b) Custom deployment script generator, to make it easy for you to create a deployment script specific for your project (you create one for each of your projects).

    c) app settings on the azure management portal where we set a setting that propagates to our deployment script, with it we can select which project to deploy.

    • Marked as answer by David Ebbo Friday, December 21, 2012 7:30 PM
    Friday, December 21, 2012 7:27 PM

All replies

  • [edit] I misunderstood your question.  my response to use the deployment file is for deploying your choice of app (in the repo) to the same website.  Not to other websites.

    hi David

    can you check out the wiki here for instuctions--> https://github.com/projectkudu/kudu/wiki/Customizing-deployments

    you can create a file named .deployment and add it in your repo.

    In this file, you can configure the path of the csproj/folder of the website you wan to deploy. 


    Amit Sharma


    Sunday, June 10, 2012 3:00 PM
  • We don't currently support the scenario where a single repo contains multiple sites and you want to deploy different ones to different Azure sites.

    I think technically you could so it by using different branches with different .deployment files, but it's a bit tricky since we currently only deploy master. So you'd need to do something like 'git push azure somebranch:master'.

    Sunday, June 10, 2012 3:14 PM
  • Has this scenario been addressed at all? I typically have my project set up like this:

        Project.sln
            Web.csproj
            Api.csproj

    Web and API are both web projects which I would like to deploy to different Azure web sites. This is done because they share a lot of the same code in the back end but have different requirements for things like security and scaling.

    Perhaps being able to extend the .deployment file with per site settings would be interesting to explore?

        [foo.azurewebsites.net]
        project = Web/Web.csproj

        [bar.azurewebsites.net]
        project = Api/Api.csproj

    Alternately if there is some way I can plug in to the deployment process to provide this logic that would be great. I did look at the deployment hooks but I don;t want to take over the whole process, just choosing the project!

    Thanks
    Barry

    Sunday, December 2, 2012 11:42 AM
  • Not yet, but we are working on making it much easier to use custom deployment logic, which would make it more approachable than it is now.

    I'm not a big fan of hard coding knowledge about the specific Azure Web Sites in the .deployment files, because it'll break as soon as a second person wants to deploy the same projects to a different set of files.

    Instead, a solution will probably involve a custom deployment script, along with setting environment variables which drive which specific project is deployed.

    So conceptually, your custom build script would have something like (this is an over-simplification) 'msbuild %PROJECTPATH%', and then you'd pass a different project in each site's config (but not in your repo).
    Monday, December 3, 2012 4:23 AM
  • I just opened this issue to make sure we track the scenario properly.
    Monday, December 3, 2012 4:26 AM
  • Thanks for the update David, I'll keep an eye on the issue.
    Monday, December 3, 2012 4:52 AM
  • See this (from Amit Apple - MSFT)

    No need for submodules, look at the following wiki:

    https://github.com/projectkudu/kudu/wiki/Customizing-deployments

    Just need to create a .deployment file in the root of your repository with the following:

    [config]
    project = Project.Web

    Don't forget to add and commit the file.

    • Proposed as answer by teyc Friday, December 21, 2012 4:09 AM
    Friday, December 21, 2012 4:09 AM
  • Hi teyc,

    As discussed above that does not solve the issue of deploying to multiple different websites from the one solution. It does seem to solve the other persons problem though.

    Thanks
    Barry

    Friday, December 21, 2012 5:59 AM
  • I've addressed this issue in my blog:

    http://blog.amitapple.com/post/38419111245/azurewebsitecustomdeploymentpart3

    Basically we use:

    a) Custom deployment feature where you own the deployment of your site.

    b) Custom deployment script generator, to make it easy for you to create a deployment script specific for your project (you create one for each of your projects).

    c) app settings on the azure management portal where we set a setting that propagates to our deployment script, with it we can select which project to deploy.

    • Marked as answer by David Ebbo Friday, December 21, 2012 7:30 PM
    Friday, December 21, 2012 7:27 PM
  • Thank you everyone, looks like I have everything I need now!

    =)

    Friday, December 21, 2012 8:37 PM
  • Thank you everyone, looks like I have everything I need now!

    =)

    Hi, i noticed there´s a solution for this using git. I was wondering if there´s a solution for the same but using TFS continuous integration?

    Thanks in advance, Agustin

    Sunday, January 27, 2013 1:54 AM
  • @Agustin: we have a TFS specific forum. Would you be able to post that question there? But I think you can indeed pick the specific project you want to deploy from within VS for TFS.
    Sunday, January 27, 2013 5:27 AM
  • I've got a site with multiple MVC project files in it, that all need to be deployed to different web sites

    For the git deployments, is it possible to add to the "configure" tab  the ability to select the solution file and the project file that is be deployed to the site. 

    Would make the config super simple and very clear as to which project is being deployed.

    Monday, February 25, 2013 10:12 AM
  • Currently, the best way to do this is via a custom deployment script (see above). Once you have that you can use env variables in your script, and set them as 'app settings' in the configure tab.
    Monday, February 25, 2013 7:07 PM
  • This blog post contains the code necessary to deploy a repo with multiple asp.net projects (e.g. an MVC site and a Web API) to multiple azure websites without requiring node.js or azure-cli installation.
    Wednesday, May 1, 2013 1:02 AM
  • Thanks for the pointer, I added a link to it from here.
    Wednesday, May 1, 2013 1:22 AM