After some searching I found this answer from David Ebbo with a PowerShell way of doing the same thing and wandered if I might modify this to work inside an ARM template.
https://social.msdn.microsoft.com/Forums/azure/en-US/990f41fd-f8b6-43a0-b942-cef0308120b2/add-virtual-application-and-directory-to-an-azure-website-using-powershell?forum=windowsazurewebsitespreview#0435503d-032e-429d-93ff-e106be04f556
It turns out that you can and the answer is quite straight forward. Rather than using the PowerShell structure, define your 'props' as JSON instead and since this is deploying a resource type of 'Microsoft.Web/sites/config' the whole configuration struct can be placed inside your website section as follows:
{
"type": "Microsoft.Web/sites",
"name": "[variables('requestSiteName')]",
"apiVersion": "2015-08-01",
"location": "West Europe",
...
"properties": {
"name": "[variables('requestSiteName')]",
...
},
"dependsOn": [
...
],
"resources": [
{
...
},
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "config",
"properties": {
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot"
},
{
"virtualPath": "/foo",
"physicalPath": "site\\bar"
}
]
}
}
]
}
"type": "Microsoft.Web/sites",
"name": "[variables('requestSiteName')]",
"apiVersion": "2015-08-01",
"location": "West Europe",
...
"properties": {
"name": "[variables('requestSiteName')]",
...
},
"dependsOn": [
...
],
"resources": [
{
...
},
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "config",
"properties": {
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot"
},
{
"virtualPath": "/foo",
"physicalPath": "site\\bar"
}
]
}
}
]
}