问题
I want to deploy azure webjob using build and release management of visual studio team services. I have created a webjob project and I already deployed from visual studio and I am looking to make the deployment automatic.
Thank you!
回答1:
Refer to these steps to publish/deploy web job:
- Open VS 2015 and create a Web Job project (e.g. WebJob1)
- Right click the project > Publish As Azure WebJob, then it will create
webjob-publish-settings.jsonfile (This is required) - Create a build definition, steps:
- NuGet Installer (Path to solution or packages.config:
**\*.sln; Installation type:Restore) - Visual Studio Build (Solution:
**\*.sln, MSBuild Arguments:/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\") - Publish Build Artifacts (Path to Publish:
$(build.artifactstagingdirectory); Artifact Name:drop; Artifact Type:Server)
- NuGet Installer (Path to solution or packages.config:
- Queue build
- Create a release definition and link to that build definition(Artifacts tab), tasks:
- Azure App Service Deploy (Specify Azure Subscription and App Service name; Package or Folder:
$(System.DefaultWorkingDirectory)\**\WebJob1.zip - Create a new release
On the other hand, to configure the Azure service endpoint, you can refer to this blog: Automating Azure Resource Group deployment using a Service Principal in Visual Studio Online: Build/Release Management.
来源:https://stackoverflow.com/questions/43112086/how-to-deploy-azure-webjob-automatically-via-vs-team-services-release