0

I am trying to deploy 4 or more webjobs and a webapi to a single app service on Azure, using Azure Devops.

I have read previously that to deploy a webjobs i needed to prp my artefact with the following tree organisation : webjobs/app_data/jobs/continuous ou webjobs/app_data/jobs/triggered

So i made it so that my build prepared the artefacts organised like this :

artefact
/WebApi
    /...dlls and stuff
/webjob
    /app_data
        /jobs
            /continuous
                /webjob1
                    /...
                /webjob2
                    /...
            /triggered
                /webjob3
                    /...
                /Webjob4
                    /...

When i deploy webjobs, using the task Azure App Service Deploy, and pointing the folder webjob, i can see my webjobs being deployed all well.

But when i try to deploy the webApi as well, it doesn't work. I first tried to deploy webjobs and webapi in two separated task (still using Azure App Service Deploy ) but one was overwritting the others.

I then tried using one task Azure App Service Deploy, by providing the top folder containing WebApi and webjob, but this doesn't seem to work.

I suppose there is a simple thing to do here, but i don't seem to be able to work it out ... Is there any people who have managed to do this ?

1 Answers1

0

Check this case: How do you deploy an Azure WebJob and App to the same App Service via VSTS?

  1. You need to associate webjobs with web app, by right clicking your Web App project in Visual Studio and select Add > Existing Project as Azure WebJob and follow the wizard.

  2. The webjobS are included in the web app package, then you just need to deploy web app to azure app service.

  3. It will generate webjob’s package too during publishing (that why there are two zip files), but you just need to specify web app package in Azure App Service deploy task. (Check Publish using Web Deploy option). Make sure the "Exclude files from the App_data folder" is unchecked:

enter image description here

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39