How to deploy multiple Webjobs on a Single App service plan via Azure DevOps Pipeline ?

Siddharth Joshi 206 Reputation points
2023-01-24T10:27:38.06+00:00

Hi,

I want to deploy multiple Webjobs on a Single App service plan via Azure DevOps Pipeline w.r.t their configuration files.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,874 questions
0 comments No comments
{count} vote

Accepted answer
  1. Andriy Bilous 10,901 Reputation points MVP
    2023-01-24T11:34:56.4866667+00:00

    Hello @Siddharth Joshi

    Web Apps are designed to run multiple Web Jobs and there is no platform limit.

    Zip deployment will fully overwrite the code. If you have webjob A already deployed and you then deploy a zip which only had webjob B, you will end up with just webjob B. You need to deploy a single zip file with both webjob A and webjob B to retain both of them.

    You may use the approach described below:
    Assume your Git project looks like this:

    User's image

    1. Add a variable (such as buildporj with default value none) to record the changed webJob project package.

    2. Add NuGet restore task for the WebJob1/WebJob1.sln.

    3. Add Build task with the MSBuild arguments:

    /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.BinariesDirectory)\\"
    

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

    5.Add Azure App Service Deploy task by specifing the Package or folder option as $(Build.ArtifactStagingDirectory)\**\$(buildproj).

    https://stackoverflow.com/questions/47695205/multiple-jobs-deployment-in-visual-studio-team-services/47710965#47710965


0 additional answers

Sort by: Most helpful