# Moving a nested application from IIS to Azure App Service

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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1637639867494/TOB4CnEdV4.png)

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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1637639869068/hmHJr56SN.png)

_Note_: you do need that parent application at route `/`

The arm template
----------------

Here’s a Gist inspired by [this one](https://gist.github.com/eNeRGy164/0ff063f039088f2cae6219fa6110cbda)

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](https://dotnetthoughts.net/deploying-multiple-application-in-webapp/)
