Menu Home

ARM Templates set “Always on” and other site properties

Just a quick reminder to myself.

In order to set the “always on” property on a Azure Web App when provisioned from an ARM template, the resource should look like this

            "apiVersion": "2015-06-01",
            "name": "[parameters('siteName')]",
            "type": "Microsoft.Web/Sites",
            "location": "[parameters('siteLocation')]",
            "dependsOn": [ "[concat('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]" ],
            "tags": {
                "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty"
            "properties": {
                "name": "[parameters('siteName')]",
                "serverFarmId": "[parameters('hostingPlanName')]",
                "siteConfig": {
                    "AlwaysOn": true
            "resources": [
                    "apiVersion": "2014-11-01",
                    "type": "config",
                    "name": "connectionstrings",
                    "dependsOn": [ "[concat('Microsoft.Web/Sites/', parameters('siteName'))]" ],
                    "properties": {
                        "MetadataGovernance": {
                            "value": "[concat('Data Source=tcp:', reference(concat('Microsoft.Sql/servers/', parameters('serverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('databaseName'), ';User Id=', parameters('administratorLogin'), '@', parameters('serverName'), ';Password=', parameters('administratorLoginPassword'), ';')]",
                            "type": 2

Note the siteConfig element under the “Microsoft.Web/Sites” resource.

The following is a list of supported site properties (Note, not sure all of them can be set)

"properties": {
    "numberOfWorkers": 1,
    "defaultDocuments": [
    "netFrameworkVersion": "v4.0",
    "phpVersion": "5.4",
    "pythonVersion": "",
    "requestTracingEnabled": false,
    "requestTracingExpirationTime": null,
    "remoteDebuggingEnabled": false,
    "remoteDebuggingVersion": "VS2012",
    "httpLoggingEnabled": false,
    "logsDirectorySizeLimit": 35,
    "detailedErrorLoggingEnabled": false,
    "publishingUsername": "$somerandomusername",
    "publishingPassword": null,
    "appSettings": null,
    "metadata": null,
    "connectionStrings": null,
    "handlerMappings": null,
    "documentRoot": null,
    "scmType": "None",
    "use32BitWorkerProcess": true,
    "webSocketsEnabled": false,
    "alwaysOn": true,
    "javaVersion": null,
    "javaContainer": null,
    "javaContainerVersion": null,
    "managedPipelineMode": 0,
    "virtualApplications": [
        "virtualPath": "/",
        "physicalPath": "site\\wwwroot",
        "preloadEnabled": true,
        "virtualDirectories": null
    "winAuthAdminState": 0,
    "winAuthTenantState": 0,
    "customAppPoolIdentityAdminState": false,
    "customAppPoolIdentityTenantState": false,
    "runtimeADUser": null,
    "runtimeADUserPassword": null,
    "loadBalancing": 1,
    "routingRules": [],
    "experiments": {
      "rampUpRules": []
    "limits": null,
    "autoHealEnabled": false,
    "autoHealRules": null,
    "tracingOptions": null,
    "vnetName": "",
    "siteAuthEnabled": false,
    "siteAuthSettings": null,
    "autoSwapSlotName": null

Categories: Programming Windows Azure

Tagged as:

Simon J.K. Pedersen

3 replies

  1. Thanks! Just what I needed! I had my setting under properties where clientAffinityEnabled is, not under siteConfig…

Leave a Reply

Your email address will not be published. Required fields are marked *