【问题标题】:How to create CosmosDB SQL API serverless account with ARM template?如何使用 ARM 模板创建 CosmosDB SQL API 无服务器帐户?
【发布时间】:2021-11-11 08:32:01
【问题描述】:

我正在尝试使用 Cosmosdb sql api 创建一个无服务器帐户,但我没有找到任何给定 here 的示例

我已尝试使用以下 ARM 模板,但它没有创建无服务器帐户

  "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'))]"
            ]
          }

    ]

抛出错误“ "message": "资源类型 Serverless 未知\r\nActivityId: 0c86f162-3386-49e1-b354-57ba309bb44f, Microsoft.Azure.Documents.Common/2.14.0""

【问题讨论】:

    标签: azure azure-cosmosdb azure-resource-manager


    【解决方案1】:

    错误有效,以下是 databaseAccount kind

    的可能值
    • 'GlobalDocumentDB'
    • 'MongoDB'
    • '解析'

    要创建无服务器帐户,您需要在属性下传递以下功能参数

     "properties": {
              "enableFreeTier": false,
              "capabilities": [
                {
                  "name": "EnableServerless"
                }
              ],
              "databaseAccountOfferType": "Standard",
              "consistencyPolicy": {
                "defaultConsistencyLevel": "Session"
              },
              "locations": [
                {
                  "locationName": "[parameters('location')]"
                }
              ]
            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-25
      • 1970-01-01
      • 2016-11-28
      • 1970-01-01
      • 2021-09-30
      • 1970-01-01
      • 2020-09-04
      相关资源
      最近更新 更多