Let’s say you want to move an IIS application to an Azure Web App (aka app service). More than that, let’s say this app has a nested application (subsite) or virtual directory. Here’s how you can get it done.
What we’re shooting for
The configuration on an Azure App Service is quite easy. For the example above, we want to deploy an application to the /v1
route.
Note: you do need that parent application at route /
The arm template
Here’s a Gist inspired by this one
The pipeline
Using Azure DevOps, we can deploy to the subsite by being more specific in the site name from the deploy task.
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy My Subsite'
inputs:
azureSubscription: 'my-subscription-service-connection'
WebAppName: $(WebAppName)
VirtualApplication: v1
package: '$(Pipeline.Workspace)/**/MySitePackage.zip'
Notice how we’re adding an attribute VirtualApplication
to the task. It matches the name of the nested application as defined by our arm template (or portal).
If you want to know how to deploy from Visual Studio, then you can see this link