Sibling physical paths for multiple Azure App Service deployments targeting the same App Service

I’m deploying two web applications to a single Azure App Service. I’m targeting the same App Service from two different deployment projects in OD. I’m attempting to host one application as a virtual application under the other but cannot seem to configure the relevant virtual applications and directories in a way that is compatible with my OD deployments.

Ideally I would like:

  1. “Site A” to be hosted at: http://{my-app}.azurewebsites.net, and

  2. “Site B” to be hosted at: http://{my-app}.azurewebsites.net/site-b.

For each deployment project I want to enable the “Remove additional files” and “Preserve App_Data” options. I therefore want each site to deployed to sibling directories, since I cannot have “Site B” in a sub-directory of “Site A”, since the deployment of “Site A” would delete the deployed files for “Site B”.

In order to attempt to achieve the above configuration, I’ve attempted to configure the relevant virtual applications and directories in my Azure App Service, as per the attached screenshot.

In the deployment process for “Site A”, I’ve entered “site-a” as the “Physical path” for this “Deploy an Azure Web App” step.

In the deployment process for “Site B”, I’ve entered “site-b” as the “Physical path” for this “Deploy an Azure Web App” step.

However, when I come to deploy “Site A”, it gets placed into the folder site\wwwroot\site-a\site-a (note the double site-a). When I come to deploy “Site B”, it gets placed into the folder site\wwwroot\site-a\site-b (not the intended directory, as I don’t want this to be a child of site-a.).

If I leave the “Physical Path” setting as empty for the “Site A” deployment step, then “Site B” still ends up as a child directory of “Site A”.

Are you able to suggest a configuration of OD/Azure or a workaround that would allow me to achieve the scenario described above, namely two deployment steps, in two different deployment projects, targeting sibling directories in an Azure App Service?

Hi Chris,

Thanks for getting in touch.

In order to preserve the child applications, you’ll need to set the Octopus.Action.Azure.PreservePaths project variable for your scenario.

If you take a look at the “Preserve Specific Paths When Deploying Azure Web Apps” section of the Web App Concepts guide, that should help explain in more detail. Based on the settings you’ve described, we believe you should just need to set that variable to \\site-b and then any deployments of site-a should not blow away site-b.

Let me know how you go.

Cheers
Mark

Hi Mark,

Thanks for your quick response. That setting is exactly what I was looking for!

Thanks for your help,

Chris