Deploy a triggered webjob

148 Views Asked by At

I use Azure DevOps Release pipeline that creates (automatically) and deploys a webjob using the "Azure App Service deploy" task. The webjob type is created as "continous". I need the job to be created as "triggered".

3

There are 3 best solutions below

0
On BEST ANSWER

You can define the webjob type in WebJobs Folder Structure. Use .net webjob as example, you can DotNetCoreCLI@2 to publish the webjobs with structure App_Data/jobs/triggered for triggered type, or App_Data/jobs/continuous for continuous type. Then create the zip file for release.

enter image description here

In Azure App Service deploy task, specify the zip file. enter image description here

After deployment, check the webjob on azure, the job type is triggered.

enter image description here

You can follow the link for the detail steps. You can also find this info in official doc: enter image description here

0
On

To change your Azure DevOps Release pipeline in order to create and deploy a "triggered" WebJob instead of a "continuous" one, you need to adjust the configuration in your pipeline.

Edit the "Azure App Service deploy" task within your pipeline and specify the WebJob type as "triggered". This can be done by adding an App Setting or modifying the deployment script.

Ensure the settings.job file in your deployment package (if using a .zip file) indicates "type": "triggered". Also, check your build process to make sure the WebJob package is correctly configured for a triggered job.

0
On

Both answers from above are similar. Thanks a lot! I was able to solve the problem by setting the job's path to "triggered" in Azure "App Service --> Configuration --> Path mappings" enter image description here I did not add a settings.job or update the pipeline with an "app settings".