{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"environment": {
"type": "string",
"allowedValues": [
"dev",
"qa",
"uat",
"pilot",
"prod"
]
}
},
"variables": {
"prefix": "test-",
"location": "Test location",
"webAppName": "[concat(variables('prefix'), parameters('environment'))]",
"servicePlan": "[concat('servicePlan-', parameters('environment'))]",
"sharedResourceGroup": "[concat('sharedresources-', parameters('environment'))]",
"serverFarmId": "[resourceId(variables('sharedResourceGroup'), 'Microsoft.Web/serverfarms', variables('servicePlan'))]"
},
"resources": [
{
"comments": "Web app to run stuff.",
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[variables('webAppName')]",
"apiVersion": "2016-08-01",
"location": "[variables('location')]",
"scale": null,
"identity": {
"type": "SystemAssigned"
},
"properties": {
"serverFarmId": "[variables('serverFarmId')]",
"enabled": true,
"reserved": false,
"httpsOnly": true
}
},
{
"comments": "Web App Staging slot - if needed",
"apiVersion": "2016-08-01",
"condition": "[equals(parameters('environment'),'prod')]",
"type": "Microsoft.Web/sites/slots",
"name": "[concat(variables('webAppName'), '/', 'staging')]",
"kind": "app",
"location": "[variables('location')]",
"tags": {
"displayName": "WebAppSlots"
},
"properties": {
"serverFarmId": "[variables('serverFarmId')]",
"httpsOnly": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppName'))]"
]
}
],
"outputs": {
"webAppName": {
"type": "string",
"value": "[variables('webAppName')]"
},
"webAppUrl": {
"type": "string",
"value": "[reference(variables('webAppName')).defaultHostName]"
}
}
}