0

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.

richardb
  • 943
  • 1
  • 10
  • 27
  • 1
    Nothing really to do with the pipeline, you can just deploy your project normally following the answers in here: https://stackoverflow.com/questions/42857997/publish-simple-asp-net-core-app-net-framework-with-webjob/42914048#42914048 – lopezbertoni Sep 05 '19 at 14:59
  • 1
    Thanks, that link helped me work out how to do in VS2019 and my yml file. – richardb Sep 05 '19 at 16:29

1 Answers1

1

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.

richardb
  • 943
  • 1
  • 10
  • 27