Fletch
Fletch

Reputation: 163

Deploy Mobile Service (.Net backend) files build from Visual Studio Online build server

Currently our developers deploy our Mobile Service (.Net backend) from Visual Studio 2013 using the Publish Wizard. Occasionally this means that a developer deploys something that either wasn't committed at all or wan't pushed to the origin source control repository. We are already using Visual Studio Online Build servers to do Continuous Integration from the origin server so it would make sense to use the files it builds to do the deployment to remove this risk.

Currently the only way I can see of doing this is to do a "download drop as zip" from the Visual Studio Online build portal and then do a FTP style deployment. This means I lose the web deploy features of only uploading the changes.

I noticed there is a different build template called GitContinousDeploymentTemplate which allows you to specify a Windows Azure Deployment Environment, but this seems to only be applicable for traditional Cloud Services or Web sites.

If anyone knows a good way of doing this any help would be much appreciated.

Cheers

F

Upvotes: 1

Views: 379

Answers (1)

photohunts
photohunts

Reputation: 190

From here

Found a solution.

  1. In the build definition's MSBuild arguments, add the following:

    /p:DeployOnBuild=true /p:PublishProfile="{publish name}" /p:AllowUntrustedCertificate=true /p:VisualStudioVersion=12.0 /p:UserName={username} /p:Password={pw}

    You can obtain the value from the publishing profile that can be downloaded from the Mobile Service dashboard on Azure managament portal.

  2. Under Deployment, add the path to pubxml file in source control under "Path to Deployment Settings". Note: add an extra backslash at the end of the path to escape the last "\".

One problem with this solution is that deployment happens regardless of your tests outcome, but that could possibly be remedied by modifying the build template. We used the GitContinuousDeploymentTemplate template in our case.

Upvotes: 3

Related Questions