I've set-up an App Service using the following ARM template snippet:
{
"name": "[variables('webBackEnd')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName')))]": "Resource",
"displayName": "BackendWebApp"
},
"properties": {
"name": "[variables('webBackEnd')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
}
},
This will deploy an App Service. However, by default, it will be setup to use the .Net Framework. Below is a view from my Azure Portal:
In order to run my ASP.Net Core-based web server, I have to manually switch the Stack Settings from ".Net" to ".Net Core". It's a trivial thing to do, but I'd much rather configure it correctly through the ARM template. I searched Microsoft's docs but was unable to find the correct property. How does one go about to do this?
here's how an example web app looks when created from the portal:
{
"apiVersion": "2018-02-01",
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [],
"metadata": [
{
"name": "CURRENT_STACK",
"value": "[parameters('currentStack')]"
}
]
},
// redacted some values
}
},
and the current stack value is dotnetcore
The accepted answer didn't work for me. I began my own investigation and finished with this code, which works in my case.
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('site_name')]",
"location": "[resourceGroup().location]",
.........................................
"resources": [
{
"name": "metadata",
"type": "config",
"apiVersion": "2018-11-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('site_name'))]"
],
"tags": {
},
"properties": {
"CURRENT_STACK": "dotnetcore"
}
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With