title: Azure CosmoDB deployment fails with "The resource operation completed with terminal provisioning state 'Failed'."
body: <p>My template is this:   </p>
  
  <pre><code>{
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
          "cosmosdbname": {
            "type": "string"
          },
          "allowedIps": {
            "type": "string"
          },
          "vnetName": {
            "type": "string"
          },
          "subnetName": {
            "type": "string"
          }
        },
        "variables": {
          "subnetIdA": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]",
          "location": "[resourcegroup().location]"
        },
        "resources": [
          {
            "type": "Microsoft.DocumentDB/databaseAccounts",
            "apiVersion": "2015-04-08",
            "name": "[parameters('cosmosdbname')]",
            "location": "[variables('location')]",
            "kind": "GlobalDocumentDB",
            "properties": {
              "ipRangeFilter": "[parameters('allowedIps')]",
              "enableAutomaticFailover": false,
              "enableMultipleWriteLocations": false,
              "isVirtualNetworkFilterEnabled": true,
              "virtualNetworkRules": [
                {
                  "id": "[variables('subnetIdA')]"
                }
              ],
              "databaseAccountOfferType": "Standard",
              "consistencyPolicy": {
                "defaultConsistencyLevel": "Session",
                "maxIntervalInSeconds": 5,
                "maxStalenessPrefix": 100
              },
              "locations": [
                {
                  "locationName": "[variables('location')]",
                  "failoverPriority": 0
                }
              ],
              "capabilities": []
            }
          }
        ]
      }
  </code></pre>
  
  <p>I exported it from Azure and made some modifications. However, I just get the "The resource operation completed with terminal provisioning state 'Failed'." when trying to deploy it and cannot figure out what is wrong with the template.</p>