Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define WebApp slots in Resource Manager Template

I'm having trouble finding information/guides on adding slots to WebApps programmatically, using Resource Manager templates. I've got my base configuration working well, creating the WebApp itself, SQL server, SQL DB etc., but I'm keen to get the slots done too so I can utilise them for dev/test builds.

Does anyone know of any good resources for this?

like image 874
James Avatar asked Jan 07 '23 11:01

James


2 Answers

I am using the following ARM template to provision Deployment Slots for Azure App 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.

like image 82
Michal Cumpl Avatar answered Jan 11 '23 10:01

Michal Cumpl


I found these templates out on GitHub

Also - have you seen or used the Azure Resource Manager Visualizer? Great resource as well http://armviz.io/#/

like image 43
jdruid Avatar answered Jan 11 '23 11:01

jdruid