azure - 具有共享自动缩放吞吐量的 CosmosDB 部署失败

标签 azure powershell azure-cosmosdb azure-rm-template

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

我在 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
            }
        }
    }
}

enter image description here

有什么想法吗?

最佳答案

根据 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 将其导出然后不允许导入。

关于azure - 具有共享自动缩放吞吐量的 CosmosDB 部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62406622/

相关文章:

asp.net - 无法将 Azure Web 应用连接到 Azure 数据库

regex - powershell - 匹配字符串,如果它具有某个字符之一。即姓氏_名字与姓氏_名字_中间名不匹配

PowerShell - 为什么 get-date -displayhint

azure - 没有 Cosmos DB 图形数据库模拟器

c# - CosmosDb 使用 insertMany 请求率很大

powershell - 跨多个订阅列出自动化帐户中的所有 Azure Runbook

c# - 奇怪的 Azure 资源组部署错误

azure - 如何从 terraform 获取 Azure Security Insights 对象 ID?

powershell - 如何在Azure DevOps PowerShell中编写 “System.Collections.Hashtable”变量

node.js - Azure 存储队列 - Cosmos DB 输出 - 错误处理