unable to update throughput settings of a sql database container in cosmos db via bicep

Pamitha Herath 20 Reputation points
2024-04-12T05:47:12.9566667+00:00

I am trying to update cosmos sql container throughput settings via bicep. Bicep deployment is successful however the configuration is not in place... anyone else is facing this? please help.. thank you


resource db_account 'Microsoft.DocumentDB/databaseAccounts@2024-02-15-preview' existing = {
name:'sql-sit'
}


resource sqldb 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2024-02-15-preview' existing = {
  parent:db_account
name: 'sqldatabase'
}

resource container 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2024-02-15-preview' existing = {
  parent:sqldb
  name: 'data'

  }
  

  resource thp 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings@2024-02-15-preview'  = {
  parent:container
  name: 'default'
    properties: {
      resource: {
        throughput:400
        autoscaleSettings: {
          maxThroughput: 4000
          autoUpgradePolicy: {
            throughputPolicy: {
              incrementPercent:10
              isEnabled: true
            }
          }
        }
      }
    }
  }

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,470 questions
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 14,076 Reputation points Microsoft Employee
    2024-04-26T09:34:41.08+00:00

    Hi Pamitha Herath,

    Appreciate your effort is sharing the solution/suggestion for the question so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution which is product limitation in case you'd like to "Accept " the answer.

    Solution:

    Bicep isn't supported for enabling autoscale on an existing database or container and only supported Azure portal , powershell and Azure CLI according to below

    https://learn.microsoft.com/en-us/azure/cosmos-db/autoscale-faq#can-i-enable-autoscale-on-an-existing-database-or-container-

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,076 Reputation points Microsoft Employee
    2024-04-12T09:07:03.0933333+00:00

    Hi Pamitha Herath,

    Welcome to Microsoft Q&A forum.

    As I understand, you are unable to update throughput settings of a sql database container in cosmos db via bicep.

    Could you please let us know if are redeploying the Bicep file with updated RU/s since to change the throughput (RU/s) values, redeploying the Bicep file with updated RU/s is needed?

    Also, please let us know the Cosmos DB configuration related details so that we can check at our end.

    Thanks

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. ShaktiSingh-MSFT 14,076 Reputation points Microsoft Employee
    2024-04-17T08:09:10.8333333+00:00

    Hi Pamitha Herath •,

    It is recommended to please file a support ticket for deeper investigation and in case if you don't have a support plan, do let us know here so that we can check on other options to unblock you. Thanks

    0 comments No comments

  4. Pamitha Herath 20 Reputation points
    2024-04-26T06:21:02.1533333+00:00

    Hi ShaktiSingh-MSFT

    Raised MS support ticket and advised that bicep isn't supported for enabling autoscale on an existing database or container and only supported Azure portal , powershell and Azure CLI according to below

    https://learn.microsoft.com/en-us/azure/cosmos-db/autoscale-faq#can-i-enable-autoscale-on-an-existing-database-or-container-

    Thanks all your help!

    0 comments No comments