Defining WebApp slots in a resource manager template

I'm having trouble finding information / guides on adding slots to WebApps programmatically using resource manager templates. My basic configuration works well for me, creating WebApp itself, SQL server, SQL DB, etc., but I really want the slots to be made, so I can use them to build dev / test.

Does anyone know of any good resources for this?

+4
source share
2 answers

I use the following ARM pattern to provide deployment slots for the Azure application service:

{
    "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "siteName": {
            "type": "string"
        },
        "slotName": {
            "type": "string"
        }
    },
    "resources": [
        {
            "apiVersion": "2015-04-01",
            "type": "Microsoft.Web/Sites/Slots",
            "name": "[concat(parameters('siteName'), '/', parameters('slotName'))]",
            "location": "[resourceGroup().location]",
            "properties": {},
            "resources": []
        }
    ]
}

Hope this helps.

+5
source

templates GitHub

, Azure Resource Manager? http://armviz.io/#/

+4

All Articles