Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CosmosDB is not allowing serverless capabalities to NoSQL, it says I must use CapacityMode

I am learning Azure and I just created a fresh account. I attempted to create a Cosmos DB NoSQL account, choosing the serverless capacity mode. This is for a small educational project that would not require many requests or activity. When I try to deploy I receive a failure message saying:

Error Details:

BadRequest: Capability EnableServerless is not allowed in API version beyond 2024-05-15-preview. Used API Version: 2024-05-15-preview. Use CapacityMode instead to serverless. ActivityId: 489b235f-666d-4ae8-8000-3ec036c63e58, Microsoft.Azure.Documents.Common/2.14.0 (Code: BadRequest, Target: /subscriptions/4070fa8a-409d-41a2-a276-43b501561297/resourceGroups/personalwebsite-rg/providers/Microsoft.DocumentDb/databaseAccounts/personalsite)

Raw Error:

{
  "code": "DeploymentFailed",
  "target": "/subscriptions/4070fa8a-409d-41a2-a276-43b501561297/resourceGroups/personalwebsite-rg/providers/Microsoft.Resources/deployments/Microsoft.Azure.CosmosDB-20240426190336",
  "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
  "details": [
    {
      "code": "BadRequest",
      "target": "/subscriptions/4070fa8a-409d-41a2-a276-43b501561297/resourceGroups/personalwebsite-rg/providers/Microsoft.DocumentDb/databaseAccounts/personalsite",
      "message": "BadRequest: Capability EnableServerless is not allowed in API version beyond 2024-05-15-preview. Used API Version: 2024-05-15-preview. Use CapacityMode instead to serverless.\r\nActivityId: 489b235f-666d-4ae8-8000-3ec036c63e58, Microsoft.Azure.Documents.Common/2.14.0"
    }
  ]
}

Operation Detail:

BadRequest: Capability EnableServerless is not allowed in API version beyond 2024-05-15-preview. Used API Version: 2024-05-15-preview. Use CapacityMode instead to serverless.\r\nActivityId: 489b235f-666d-4ae8-8000-3ec036c63e58, Microsoft.Azure.Documents.Common/2.14.0

My account is using the standard "Azure Plan" subscription. The current resource group is located in EAST 2, currently using the resource group for Static Web App and Storage Account with no issues.

like image 695
LatePayment Avatar asked Dec 29 '25 09:12

LatePayment


1 Answers

In the later versions, there is a capacityMode property that you can set to "Serverless". The error is saying that you should use that property instead of setting the value in the capabilities array.

In your bicep or ARM template:

Remove

    capabilities: [
      {
        name: 'EnableServerless'
      }
    ]

Add

    capacityMode: 'Serverless'
like image 146
adam0101 Avatar answered Jan 01 '26 07:01

adam0101



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!