Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Multiple WebJobs from the Same Project in a Azure DevOps Release Definition?

So the way that we've structured our code is that we've got several projects in our solution that each have multiple webjobs. We've configured a manual way of releasing these multiple webjobs using the run.cmd files and copying over the pertinent run.cmd file to the root folder depending on which webjob we're trying to release.

I'm wondering if there is any way to do this via a build/release definition in Azure DevOps without having to tear apart the multiple webjobs into individual projects. These multiple webjobs also all live in the same App Service.

like image 571
Michelle Avatar asked Oct 18 '25 01:10

Michelle


1 Answers

What you have done is the simplest way at present, you could just clone the process in Azure DevOps Build/Release Pipeline. There is not any way to do this in Azure DevOps without having to tear apart the multiple webjobs into individual projects.

We've configured a manual way of releasing these multiple webjobs using the run.cmd files and copying over the pertinent run.cmd file to the root folder depending on which webjob we're trying to release.

For example, in your build solution step define (add some copy file step to copy necessary files) :-

  1. Visual Studio Build (Solution: ***.sln, MSBuild Arguments: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\")

  2. Publish Build Artifacts (Path to Publish: $(build.artifactstagingdirectory); Artifact Name: drop; Artifact Type: Server)

Create a release definition for this build definition and add a task

  1. Azure App Service Deploy
  2. Select your Azure Subscription and App Service name;
  3. Select your Package or Folder: $(System.DefaultWorkingDirectory)**\WebJob1.zip

You can similary create another Azure App Service Deploy task for WebJob2.zip and deploy as many webjobs you want through a single build and release pipeline.

like image 192
PatrickLu-MSFT Avatar answered Oct 21 '25 04:10

PatrickLu-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!