0
votes

I have a release pipeline for a web app. Now I want to release also webjobs from the same solution. But if I publish a webjob after I have published a web app, it will publish it to wwwroot and overwrites my web app. How should I configure release pipeline to deploy webjob to wwwroot\App_Data\jobs\triggered\MyWebJob, not to wwwroot?

Somewhere was an answer to build and publish whole solution and webjobs will be also deployed successfully. But I am not able to build and publish the whole solution. I have to pick just some of the projects (csproj).

1
Are your web app and web job project on the same repository/solution? If yes right click on the web app project, add webjob, from existing project, select your webjob project. Visual studio is going to package the webjob with the web app automatically during the package app step. No need to have a separate step for the webjobbaywet
@baywet How that should be done? Those are in the same solution. But is there a way to add project to other project? In my case webjob.csproj to webapp.csproj. I tried following but didn't work: right click on webapp.csproj -> add existing item (there isn't any "add existing project", because this is a project not solution) -> webjob.csproj. But output doesn't include "webjob.exe".Lassi Autio
@PanuOksala I have tried those but seems that they aren't same as my problem. But probably I'll find some hints from there also.Lassi Autio
Just to make sure, you are using visual studio 2017 and you have the azure components selected?baywet

1 Answers

0
votes

If I'm understanding you correctly, you have a web project along with two web jobs that you want to deploy to Azure App services using Azure Dev Ops. If that's the case, I would suggest deploying your web jobs to separate app services. If your app service is under a standard or premium plan, you can leverage deployment slots. The Visual Studio Build task will zip up your projects for Web Deploy so on the release side of the pipeline you'll simply select the project zip file from the artifact for the Azure App Service Deploy.

Hope this helps.