In this post I’ll create a continuous integration build with Visual Studio Online that deploys a Web App on an Azure Website.
Inside your VSO project click on the Build menu.
Click on plus sign and choose Visual Studio.
Here we’ll configure our build to produce and save the Web Deploy Package package file inside the staging directory. This package will be used to deploy our Web App inside an Azure WebSite.
Copy paste the following MSBuild arguments into the MSBuild Arguments:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=”$(build.stagingDirectory)”
Now we’ll add a “Azure Web App Deployment” step. Click “Add, build step” and choose in the category “Deploy” => “Azure Web Site Deployment”, click “Add”
If you don’t have a Subscription configured click on: manage
Click on: Configure service endpoint
Choose certificate and click on publishsettings xml file
Once your settings downloaded, open the file with notepad and copy the: Subscription id, Subscription name and certificate.
Go back to the Azure build and click on refresh.
Provide the “Web App Name” of your Azure Web App.
Choose your region.
Under “Web Deploy Package” you need to provide the path of your Web Deploy Package .This relates to the package location provided as an MSBuild argument in your build step (see here above). As we published the package under the staging directory and because the package is a zip file, the following search path will do the work:
Click on Save and provide a name for your new build.
You can now test your build by right-clicking on it and choose “queue build”.
If you want your build to become a continuous deployment build (runs at every check-in or after some time after the check-in): Edit you build definition and look for Triggers: