How to Create Virtual Directories in Azure Web Apps with PowerShell
n the era before cloud computing, writing an entire article just to create an IIS virtual directory in PowerShell would not have been necessary. After all, just run the New-WebVirtualDirectory PowerShell command and be done with it! Nowadays, with the cloud reinventing just about every aspect of IT, things are done a little differently. Perhaps one day we’ll have a native New-AzureWebVirtualDirectory command inside of the Azure PowerShell module. But until then, we’ll just have to build our own. Here’s how.
Creating and attaching a virtual directory to an Azure Web app consists of three steps:
- Retrieving the Microsoft.Azure.Management.WebSites.Models.Site object.
- Creating a Microsoft.Azure.Management.WebSites.Models.VirtualApplication object.
- Assigning the VirtualApplication object to the Site object.
Read more at MCPMag