I’m publishing 2 web jobs to the respective paths:
But, every time, the content inside sitewwwroot
is erased, and I have an API project published there, so, every time I need to republish the API after.
I can’t find a solution anywhere about this, why is this happening?
This is my web jobs CD:
I was expecting having to republish my API every time I publish my web job.
2
Answers
In order for
Webjobs
to deploy properly, You need to build them together in theapp folder
and then Publish the build artifact to the Azure Web App service.Refer my SO answer here.
My Azure DevOps yaml pipeline:-
I have build both the WebJobs separately and then published the build artifact to the Azure Web app above.
Output:-
Release pipeline:-
I can reproduce the issue when I tried to deploy files to the Virtual application path, and I found the
sitewwwroot
folder will be back to the old last version.Workaround
If I change the task version from
AzureRmWebAppDeployment@4
toAzureRmWebAppDeployment@3
, it works and will not make change to the files in thesitewwwroot
folder. I also find a known issue here for your reference.