Daniel Jonsson
Daniel Jonsson

Reputation: 3883

Root web app service disappears after deploying a virtual application to Azure

I have a web app service in Azure, running on Windows. On the Configuration page, I have set up two virtual applications. The first is the default root application, and the second is a virtual application that I have manually added. They look like this:

Azure app service

The problem is that I need to deploy the virtual applications in this particular order:

  1. /api
  2. /

If I instead deploy /api last, then the root application disappears and becomes the default page:

Default Azure page

I deploy the virtual applications to Azure through two release pipelines in Azure DevOps using the Azure App Service deploy task:

Azure App Service deploy task in Azure DevOps

What should I change to be able to deploy /api while preserving the / application?

Upvotes: 0

Views: 441

Answers (1)

HowAreYou
HowAreYou

Reputation: 861

By default, azure app service deploy task will always do clean deployment. It means, whenever azure app service deploy task executed, it will clean all the files in the site\wwwrooot and then deploy new artifacts. Due to this reason whenever you are deploying virtual application to app service, the root application is coming to the default stage. To prevent this, add the below line to the Additional arguments in Azure app service deploy task, Virtual application deployment pipeline as below.

-skip:objectName=dirPath,absolutePath=wwwroot

enter image description here

Save the configuration and run the virtual application pipeline. Once completes verfiy the normal application URL.

enter image description here

enter image description here

Upvotes: 0

Related Questions