【问题标题】:Deployment of CosmosDB with shared autoscaling throughput fails使用共享自动缩放吞吐量部署 CosmosDB 失败
【发布时间】:2020-06-16 10:43:57
【问题描述】:

尝试为数据库帐户、具有两个集合的 SQL 数据库部署 ARM 模板,其中在数据库级别设置自动缩放吞吐量设置(为集合共享)。

我在 Azure UI 中创建了这个设置,然后导出了模板。 当使用 New-AzResourceGroupDeployment 从 Powershell 导入模板时,它会失败并显示消息

Status Message: Entity with the specified id does not exist in the system.
ActivityId: <redacted>, Microsoft.Azure.Documents.Common/2.11.0 (Code:NotFound)

这很可笑,因为我导出了模板并没有修改它然后导入。 Azure 不识别它自己的格式吗? 我认为问题与这个模板片段有关:

{
    "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/throughputSettings",
    "apiVersion": "2020-04-01",
    "name": "[concat(parameters('databaseAccounts_an_test_name'), '/', parameters('databaseAccounts_an_test_name'), '-db-2/default')]",
    "dependsOn": [
        "[resourceId('Microsoft.DocumentDB/databaseAccounts/sqlDatabases', parameters('databaseAccounts_an_test_name'), concat(parameters('databaseAccounts_an_test_name'), '-db-2'))]",
        "[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccounts_an_test_name'))]"
    ],
    "properties": {
        "resource": {
            "throughput": 400,
            "autoscaleSettings": {
                "maxThroughput": 4000
            }
        }
    }
}

有什么想法吗?

【问题讨论】:

  • 您是在尝试部署新的数据库和容器还是更新现有的?
  • @MarkBrown 尽可能创建或更新
  • 是的,然后使用下面的示例并在选项中设置吞吐量。在创建时工作,也可以重新部署以更新 RU/s。 --谢谢。

标签: azure powershell azure-cosmosdb arm-template


【解决方案1】:

根据 Mark Brown 的提示,这是正确的解决方案。

{
    "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases",
    "name": ...
    "apiVersion": "2020-04-01"
    "dependsOn": ...
    "properties": {
      "resource": {
        "id": ...
      },
      "options": {
        "autoscaleSettings": {
          "maxThroughput": 4000
        }
      }
    }
}

不要使用导出模板中 yaml 的 Microsoft.DocumentDB/databaseAccounts/sqlDatabases/throughputSettings 部分。我不确定为什么 Azure 会导出它然后不允许导入。

【讨论】:

    【解决方案2】:

    如果您要创建新的数据库或容器资源,您需要在资源的选项中传递吞吐量。更新吞吐量时只能直接使用吞吐量资源。

    这是一个例子here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-15
      • 1970-01-01
      相关资源
      最近更新 更多