Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create Virtual Applications/Folders with Azure Resource Manager Templates?

I'm trying to create an ARM template to stamp out multiple instances of our fairly simple Web App product.

I'm struggling to add a Virtual Application to my web app. i.e. something like this :-

Web App Virtual Folder

But I can't find the right JSON to achieve this. I found the following sample online but it doesn't appear to have any effect.

(under properties for the Web Application)

"virtualApplications": [
              {
                "virtualPath": "/",
                "physicalPath": "site\\wwwroot"
              },
              {
                "virtualPath": "/virtualApp",
                "physicalPath": "site\\wwwroot\\virtualApp"
              }
like image 243
David Scott Avatar asked Nov 23 '15 14:11

David Scott


1 Answers

The settings are under the web config. So in your ARM template, you just have to add another resource (along side the site resource) as follows:

{
    "apiVersion": "2014-06-01",
    "name": "web",
    "type": "config",
    "dependsOn": [
        "[concat('Microsoft.Web\/sites\/', parameters('siteName'))]"
    ],
    "properties": {
        "virtualApplications": [
            {
                "virtualPath": "\/",
                "physicalPath": "site\\wwwroot",
                "preloadEnabled": false,
                "virtualDirectories": null
            },
            {
                "virtualPath": "\/virtualApp",
                "physicalPath": "site\\wwwroot\\virtualApp",
                "preloadEnabled": false,
                "virtualDirectories": null
            }
        ],
        // other web config settings i.e.
        "phpVersion": "5.4"
    }
}
like image 178
theadriangreen Avatar answered Nov 15 '22 09:11

theadriangreen