0
votes

I have a Web app being published with a build pipeline yml file (Atlassian build server) and all is working well.

E.g. - dotnet publish $PROJECT_NAME --output publish --configuration release

I'm now adding an Azure WebJob version 3 but don't know how to add this into the build pipeline, and where it should get deployed. I understand it should sit under the Web App in a jobs/triggered folder somewhere.

This is version 3 of Azure WebJobs and the MyWebJob is a console app.

Documentation out there is a bit thin on the ground.

1
Nothing really to do with the pipeline, you can just deploy your project normally following the answers in here: stackoverflow.com/questions/42857997/…lopezbertoni
Thanks, that link helped me work out how to do in VS2019 and my yml file.richardb

1 Answers

1
votes

With some hints from lopezbertonie on that other answer, I added a post build step to my main Web App project in its csproj file;

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="dotnet publish ..\\MyWebJobPublish\\ -o ..\\MyApi\\app_data\\jobs\\triggered\\MyWebJobPublish\\" />
  </Target>

and then my yaml build script did this;

- dotnet publish $PROJECT_NAME --output publish --configuration release
- dotnet publish $WEBJOB_NAME --output publish/app_data/jobs/triggered/MyWebJobPublish --configuration release

This then deployed to Azure.