So the other day i was trying to publish azure webjob from devops release pipeline using “Azure app service deploy” task which is oob task available in azure devops to deploy code to azure app service.
Now this activity by default publish to wwwroot directory in app service which works pretty well when you want to deploy a webapi to app service.
But when you want to deploy webjobs, webjob need to be deployed to continuous or triggered folder as per nature of webjob under add_data/jobs folder.
Now to publish the artifacts to a particular location in site, we have an option of defining virtual application in azure app service where you can specify the path of that application as shown below:
Azure app service>Configurations>Path mappings
Create new Virtual applications as shown below. I have created 2 virtual applications one for continuous app and another for triggered webjob with virtual path /continuouswebjob and /triggeredwebjob
Now in your azure devops task in Virtual directory application, specify the name of virtual directory which you declared in your azure app service.
Now when you’ll run your release, it’ll publish the artifact selected in Package or Folder to the physical path defined in app service.
Hope it would be helpful…!