简体   繁体   中英

How to deploy azure webjob automatically via VS Team Services - release

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!

Refer to these steps to publish/deploy web job:

  1. Open VS 2015 and create a Web Job project (eg WebJob1)
  2. Right click the project > Publish As Azure WebJob, then it will create webjob-publish-settings.json file ( This is required )
  3. 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 )
  4. Queue build
  5. Create a release definition and link to that build definition(Artifacts tab), tasks:
  6. Azure App Service Deploy (Specify Azure Subscription and App Service name; Package or Folder: $(System.DefaultWorkingDirectory)\\**\\WebJob1.zip
  7. 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM