1

I am trying to create a serverless account with Cosmosdb sql api and i have not found any samples given here

I have tried with the following ARM template and it's not creating a serverless account

  "resources" : [
        {
            "type": "Microsoft.DocumentDB/databaseAccounts",
            "apiVersion": "2020-04-01",
            "kind": "Serverless",
            "name": "[parameters('accountName')]",
            "location": "[parameters('location')]",
            "properties": {
              "enableFreeTier": false,            
              "databaseAccountOfferType": "Standard",
              "consistencyPolicy": {
                "defaultConsistencyLevel": "Session"
              },
              "locations": [
                {
                  "locationName": "[parameters('location')]"
                }
              ]
            }
          },
          {
            "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases",
            "apiVersion": "2020-04-01",
            "name": "[format('{0}/{1}', parameters('accountName'), parameters('databaseName'))]",
            "properties": {
              "resource": {
                "id": "[parameters('databaseName')]"
              },
              "options": {}
            },
            "dependsOn": [
              "[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('accountName'))]"
            ]
          }

    ]

throwing an error " "message": "Resource kind Serverless is unknown\r\nActivityId: 0c86f162-3386-49e1-b354-57ba309bb44f, Microsoft.Azure.Documents.Common/2.14.0""

1 Answer 1

5

The error is valid, below are the possible values available for the databaseAccount kind

  • 'GlobalDocumentDB'
  • 'MongoDB'
  • 'Parse'

To create a serverless account, you need to pass the capabilities parameter as below under properties

 "properties": {
          "enableFreeTier": false,
          "capabilities": [
            {
              "name": "EnableServerless"
            }
          ],
          "databaseAccountOfferType": "Standard",
          "consistencyPolicy": {
            "defaultConsistencyLevel": "Session"
          },
          "locations": [
            {
              "locationName": "[parameters('location')]"
            }
          ]
        }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.