title: ARM Template containing config settings for web app
body: <p>I am encountering strange behavior when deploying an ARM template.</p>
  
  <p>I have the following template: (Note that sasUrl value 'xxx' has a real, working value in my file)</p>
  
  <pre><code>{
    "name": "[variables('webAppServiceName')]",
    "type": "Microsoft.Web/sites",
    "location": "[resourceGroup().location]",
    "apiVersion": "2016-08-01",
    "dependsOn": [
      "[concat('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
    ],
    "tags": {
      "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]": "Resource",
      "displayName": "[variables('webAppServiceName')]"
    },
    "properties": {
      "name": "[variables('webAppServiceName')]",
      "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]"
    },
    "resources": [
      {
        "apiVersion": "2014-11-01",
        "name": "appsettings",
        "type": "config",
        "dependsOn": [
          "[concat('Microsoft.Web/sites/', variables('webAppServiceName'))]",
          "[concat('Microsoft.Web/certificates/', variables('certificateName'))]"
        ],
        "tags": {
          "displayName": "WebAppSettings"
        },
        "properties": {
          "WEBSITE_LOAD_CERTIFICATES": "[reference(resourceId('Microsoft.Web/certificates', variables('certificateName')), providers('Microsoft.Web', 'certificates').apiVersions[0]).thumbprint]"
        }
      },
      {
        "apiVersion": "2016-08-01",
        "name": "Microsoft.ApplicationInsights.Profiler.AzureWebApps",
        "type": "siteextensions",
        "dependsOn": [
          "[resourceId('Microsoft.Web/Sites', variables('webAppServiceName'))]"
        ],
        "properties": {}
      },
      {
        "apiVersion": "2015-08-01",
        "name": "logs",
        "type": "config",
        "dependsOn": [
          "[resourceId('Microsoft.Web/Sites', variables('webAppServiceName'))]"
        ],
        "properties": {
          "applicationLogs": {
            "fileSystem": {
              "level": "Off"
            },
            "azureTableStorage": {
              "level": "Off"
            },
            "azureBlobStorage": {
              "level": "[parameters('applicationLogLevel')]",
              "sasUrl": "xxx"
            }
          },
          "httpLogs": {
            "fileSystem": {
              "enabled": false
            },
            "azureBlobStorage": {
              "enabled": true,
              "sasUrl": "xxx"
            }
          },
          "failedRequestsTracing": {
            "enabled": "[parameters('enableFailedRequestTracing')]"
          },
          "detailedErrorMessages": {
            "enabled": "[parameters('enableDetailedErrorMessages')]"
          }
        }
      }
    ]
  }
  </code></pre>
  
  <p>When deploying this template without modifying anything, the config section 'logs' is not deployed correctly +- 1 on 2 times. I have just tested the ARM template again, and the first deployment, the web app had not the correct settings for diagnostics logging. The second time neither, but the third time they were ok. But the fourth time, the settings were not correct anymore. It looks like this part of the template has no consistent behavior. </p>
  
  <p>Am I overseeing something?</p>