WebJob cannot be added from portal if deployment from source control is configured

WebJob cannot be added from portal if deployment from source control is configured.

Issue:

·       WebJob cannot be added from portal if deployment from source control is configured.

 

Solution:

Azure webjobs is very popular now a days. It is used to run background task what we used to do with window schedular and here we are discussing about a common phenomenon which can be faced by anyone while create webjobs from the portal.

You can check in below screen show what happens when I click on Add button for creating a new web job.

webjobs










WebJob cannot be added from portal if deployment from source control is configured.

This message is clear, and we can easily decode it. This message indicates that your app service has some source control configured for CI/CD e.g. GitHub, DevOps etc and you can validate this in the deployment center option of your app service; like in my case I have configured GitHub as source control which is preventing me to me add new webjobs.

 


 





Now we know why we are not able to add webjobs? Then how to solve this issue.

If you have basic knowledge of webjobs then you should know the location of webjobs folder after deployment.

There are various ways to access webjobs folders and few of them are,

  • SCM or KUDU site
  • FTP

The path for webjobs is,

  • Triggered web jobs:
            d:\home\site\wwwroot\app_data\jobs\triggered\{job name}
  • Continuous webjobs:

       d:\home\site\wwwroot\app_data\jobs\continuous\{job name}

Note: While if you have Website_Run_From_Package enable (which makes d:\home\site\wwwroo folder read-only) then webjobs path will be,

  • d:\home\site\jobs\

That means you can directly deploy a WebJob in that path and your webjobs will start appearing in the portal.

This action will work with both SCM/KIDU and FTP.

Important:

You must be feeling happy that you are able to create webjobs, but this is not the permanent solution. This is just to unblock you if you want to create webjobs on urgent basis.

The error message was there for some reason which means If you have source control configured with your application, the webjobs should be deployed as part of the source control integration as webjobs is the part of your webapp.

If you deployed webjobs separately and then you deploy your webapp from the source control with “Remove additional files at destination” option checked then your webjobs will be deleted as they are not available in your deployment package under source control and you will be in trouble.

The correct way to deploy your webjobs in this case is to integrate them with your webapp in source control so that they are also deployed along with your app service.

Hope this helps. Please let me know if you have any query in this regard.

2 comments:

  1. Just click the disconnect link in the Deployment Center to make the message, "WebJob cannot be added from portal if deployment from source control is configured." go away. I was testing CI/CD and disabled webjob deployments from the portal.

    ReplyDelete
  2. This information is really awesome thanks for sharing most valuable information.
    Workday Online Course
    Workday Online Training in India

    ReplyDelete