Search code examples
azurecontainersazure-service-fabric

How do I add a classic ASP.NET Web Forms with virtual directory to a container in Service Fabric?


I want to migrate a classic ASP.NET Web Forms that has virtual directories into a container for inclusion as a service in Service Fabric.

Currently, I add the virtual directories in IIS and map to physical drive locations on my local system. If I add these to a container, how will IIS know to map them as virtual directory instead of just another folder?

The process I am looking to achieve is this

  1. Set up a container with IIS

  2. Copy my current deployment into the wwwroot folder in IIS ( In the container )

  3. Create virtual directory under the deployed site and copy some files into it

  4. All these as part of the container creation process


Solution

  • Have a look here to see how to run IIS inside a Windows Container on Service Fabric. The trick is to run the entire application along with IIS inside a container, not just IIS by itself. This way, nothing runs 'locally' on the host node and deployment is much simpler.

    More info about how to create the docker file and optionally create a new website by using PowerShell here and here and here. How to create a virtual dir using PowerShell New-WebVirtualDirectory here.