Home > Enterprise >  ARM template throws "Shared throughput collection should have a partition key"
ARM template throws "Shared throughput collection should have a partition key"

Time:10-28

I am trying to create a cosmosdb account with shared throughput, I have the partition key mentioned in the ARM, but it doesn’t seem to take this when creating container.

"properties": {
        "resource": {
          "id": "[variables('cosmosDbContainers')[copyIndex()]]"
        },
        "partitionKey": {
          "paths": [
            "/id"
          ],
          "kind": "Hash"
        },
        "indexingPolicy": {
          "indexingMode": "consistent",
          "automatic": true,
          "includedPaths": [
            {
              "path": "/*"
            }
          ],
          "excludedPaths": [
            {
              "path": "/\"_etag\"/?"
            }
          ]
        },

CodePudding user response:

Looks like the placement of partitionKey in the ARM is wrong, it should be under the "resource" key

 "resource": {
            "id": "[variables('cosmosDbContainers')[copyIndex()]]",
            "partitionKey": {
                "paths": [
                    "/ipCountryCode"
                ],
                "kind": "Hash"
            }
        },
  • Related