Search code examples
azureazure-webjobs

Deploying Azure webjobs


When using VS.NET to deploy an Azure WebJob I see it gets copied to:

/site/wwwroot/App_Data/jobs/continuous/[nameofjob]

So this seems to sit inside the webapp we have there, which I think is not correct, since it might not even be related to this webapp.

But I also see there's another folder on the root folder here:

/site/jobs/Continuous

So I guess I'd like to deploy here and not inside the webapp. I've been looking around in VS.NET but can't find where this can be setup. I've seen some references to what I'm trying to do here for example: https://github.com/projectkudu/kudu/wiki/WebJobs

so my question is wheter this is possible to be done from within VS.NET "Publish as Azure WebJob" or it needs to be done manually. And if manually, is it just a matter of copy files over this folder?


Solution

  • If you want to use different folder to deploy WebJobs. Yes, you could set the WEBJOBS_ROOT_PATH environment in the Application Setting.

    Actually the WEBJOBS_ROOT_PATH value it's not must be d:\home\site\jobs\, it's just a folder to deploy WebJobs, the default WebJob worling directory %TEMP%\jobs\{job type}\{job name}\{random name}. So you could also set the value like D:\home\site\repository(you still could set it with d:\home\site\jobs\).

    enter image description here

    Save the settings. Then you could deploy the zip file from portal, if you deploy continuous webjob it will create the continuous folder.

    enter image description here

    enter image description here

    wheter this is possible to be done from within VS.NET "Publish as Azure WebJob"

    The answer is no, from the wiki you post you could know this's useful when using Run-From-Zip. So for now you have to deploy the zip file, you could do it on the portal. And if you have set the WEBJOBS_ROOT_PATH value, the deployment folder is still d:\home\site\wwwroot\app_data\jobs, then you couldn't find it on the portal WebJob page.