azure - 如何使用 ARM 模板创建 CosmosDB SQL API 无服务器帐户?

标签 azure azure-cosmosdb azure-resource-manager

我正在尝试使用 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": "资源类型无服务器未知\r\nActivityId: 0c86f162-3386-49e1-b354-57ba309bb44f, Microsoft.Azure.Documents.Common/2.14.0""

最佳答案

错误有效,以下是databaseAccount可用的可能值 kind

  • “全局文档数据库”
  • 'MongoDB'
  • “解析”

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

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

关于azure - 如何使用 ARM 模板创建 CosmosDB SQL API 无服务器帐户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69206885/

相关文章:

azure - 通过 Ansible 创建没有存储帐户的 Azure VM

azure - 如何使用逻辑应用程序标准将实体插入Azure表存储?

mongodb - mongochef azure 文档数据库查询问题

azure - 如何使用 dotnet SDK 删除 Azure 中的单个资源?

azure - 在资源管理器模板中定义 WebApp 插槽

Azure AD B2C 开放 ID 连接与 OAuth 2.0

azure - 是否有用于 Azure 网站生命周期管理的管理 API?

azure - 我可以使用 Id 之外的自定义键创建 azure cosmos db 文档吗

spring-boot - reactor/netty/resources/ConnectionProvider.fixed(Ljava/lang/String;IJLjava/time/Duration;)Lreactor/netty/resources/ConnectionProvider;

azure - 从 Azure 订阅检索所有用户信息