How to publish webjob from azure devops to azure app service using Azure app service deploy task

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.

1

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.

2

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

3

Now in your azure devops task in Virtual directory application, specify the name of virtual directory which you declared in your azure app service.

4

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…!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: