4

I created a Cosmos Db account, database, and containers using this ARM template. Deployment via Azure DevOps Release pipeline is working.

I used this ARM template to adjust the database throughput. It is also in a Release pipeline and is working.

Currently the throughput is provisioned at the database level and shared across all containers. How do I provision throughput at the container level? I tried running this ARM template to update throughput at the container level. It appears that once shared throughput is provisioned at the database level there's no way to provision throughput at the container level.

I found this reference document but throughput is not listed. Am I missing something super obvious or is the desired functionality not implemented yet?

UPDATE: When attempting to update the container with the above template I get the following:

2019-05-29T20:25:10.5166366Z There were errors in your deployment. Error code: DeploymentFailed.
2019-05-29T20:25:10.5236514Z ##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
2019-05-29T20:25:10.5246027Z ##[error]Details:
2019-05-29T20:25:10.5246412Z ##[error]NotFound: {
  "code": "NotFound",
  "message": "Entity with the specified id does not exist in the system.\r\nActivityId: 7ba84...b52b2, Microsoft.Azure.Documents.Common/2.4.0.0"
} undefined
2019-05-29T20:25:10.5246730Z ##[error]Task failed while creating or updating the template deployment.
Stringfellow
  • 2,788
  • 2
  • 21
  • 36
DenaliHardtail
  • 27,362
  • 56
  • 154
  • 233

2 Answers2

4

I was also experiencing the same error:

  "code": "NotFound",
  "message": "Entity with the specified id does not exist in the system.

I was deploying an ARM template via DevOps pipeline to change the configuration of an existing resource in Azure.

The existing resource had a dedicated throughput defined at the container/collection level, and my ARM template was trying to defined the throughput at the database level...

Once adjusted my deployment pipeline worked.

Here is some info on my throughput provisioning fix: https://github.com/MicrosoftDocs/azure-docs/issues/30853

0

I believe you have to create the container with a dedicated throughput, first. I have not seen any documentation for changing a container from shared to dedicated throughput. In the Microsoft documentation, the example is creating containers with both shared and dedicated throughput.

Set throughput on a database and a container

You can combine the two models. Provisioning throughput on both the database and the container is allowed. The following example shows how to provision throughput on an Azure Cosmos database and a container:

  • You can create an Azure Cosmos database named Z with provisioned throughput of "K" RUs.
  • Next, create five containers named A, B, C, D, and E within the database. When creating container B, make sure to enable Provision dedicated throughput for this container option and explicitly configure "P" RUs of provisioned throughput on this container. Note that you can configure shared and dedicated throughput only when creating the database and container.
  • The "K" RUs throughput is shared across the four containers A, C, D, and E. The exact amount of throughput available to A, C, D, or E varies. There are no SLAs for each individual container’s throughput.
  • The container named B is guaranteed to get the "P" RUs throughput all the time. It's backed by SLAs.

There is a prereq ARM template in a subfolder for the 101-cosmosdb-sql-container-ru-update. In the prereq version, the container has the throughput property set when the container is created. After the container is created with dedicated throughput, the update template works without error. I have tried it out and verified that it works. enter image description here

        {
            "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
            "name": "[concat(variables('accountName'), '/sql/', variables('databaseName'))]",
            "apiVersion": "2016-03-31",
            "dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('accountName'))]" ],
            "properties":{
                "resource":{
                    "id": "[variables('databaseName')]"
                },
                "options": { "throughput": "[variables('databaseThroughput')]" }
            }
        },
        {
            "type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/containers",
            "name": "[concat(variables('accountName'), '/sql/', variables('databaseName'), '/', variables('containerName'))]",
            "apiVersion": "2016-03-31",
            "dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('accountName'), 'sql', variables('databaseName'))]" ],
            "properties":
            {
                "resource":{
                    "id":  "[variables('containerName')]",
                    "partitionKey": {
                        "paths": [
                        "/MyPartitionKey1"
                        ],
                        "kind": "Hash"
                    }
                },
                "options": { "throughput": "[variables('containerThroughput')]" }
            }
        }

Stringfellow
  • 2,788
  • 2
  • 21
  • 36