-
Notifications
You must be signed in to change notification settings - Fork 6
Azure VSTS Deployment
If you want to deploy LunchOrder web application using Azure, you can follow the instructions below to setup a continuous build environment on the Microsoft Azure platform.
Choose any team project and navigate to "Build". Create a new build defintion.
Navigate to the "Repository" tab and select the correct repository.
Add build variables
Add the following Build tasks to the newly created build definition:
- Visual Studio Build
- Publish Build Artifacts
- npm
- gulp
- Publish Build Artifacts
MSBuild Arguments: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation="$(build.stagingDirectory)/webapi"
Make sure you select "Restore NuGet Packages".
And we should have build artifacts that we can use for later deployment...
After a successful build we can configure our actual deployment.
In order to deploy our website frontend but also our website backend to the same website, we need to configure a virtual directory on the web application.
Navigate to "Release" on VSTS and create a new Release Definition.
Add the following Build tasks to the newly created release definition:
- Extract Files (extract backend WebDeploy package)
- Tokenization: Transform file (adds backend parameters)
- Archive Files (overwrite old WebDeploy package)
- Azure Web App Deployment => deploys frontend
- AzureRM Web App Deployment => deploys backend (WebApi)
If you don't have the Tokenization task, you could install it from The extensions MarketPlace (Github source) We use this specific Tokenization Task as it allows us to do a recursive search for a file.
Extract files
Archive file patterns: $(System.DefaultWorkingDirectory)/LunchOrder Master Branch/webapi/Lunchorder.Api.zip
Destination folder: $(System.DefaultWorkingDirectory)/LunchOrder Master Branch/webapi/unzip
Tokenization
Source Path: $(System.DefaultWorkingDirectory)/LunchOrder Master Branch/webapi/unzip
Deployment Parameters (more info)
Archive Files
Root folder (or file) to archive: $(System.DefaultWorkingDirectory)/Lunchorder Master Branch/webapi/unzip
Advanced => Archive file to create: $(System.DefaultWorkingDirectory)/Lunchorder Master Branch/webapi/Lunchorder.Api.zip
Azure Web App Deployment
Web Deploy Package: $(System.DefaultWorkingDirectory)/LunchOrder Master Branch/frontend/package-release.zip
AzureRM Web App Deployment
Package: $(System.DefaultWorkingDirectory)/LunchOrder Master Branch/webapi/Lunchorder.Api.zip
If everything ran successfully, your website should be up and running.
- [Setup your environment](Run Locally)
- [Configure Authentication](Configure Authentication)
- [Azure VSTS Deployment](Azure VSTS Deployment)