使用DevOps部署ARM模板时出现奇怪的错误

r3plica

我有一个用于创建2个文档数据库服务器的手臂模板。ARM模板的部分如下所示:

{
  "name": "[variables('sqlServerName')]",
  "type": "Microsoft.DocumentDB/databaseAccounts",
  "apiVersion": "2019-12-12",
  "location": "[parameters('location')]",
  "tags": {
    "name": "Cosmos DB Account"
  },
  "properties": {
    "locations": "[variables('locations')]",
    "databaseAccountOfferType": "Standard"
  }
},
{
  "name": "[variables('sqlServerDevelopmentName')]",
  "type": "Microsoft.DocumentDB/databaseAccounts",
  "apiVersion": "2019-12-12",
  "location": "[parameters('location')]",
  "tags": {
    "name": "Cosmos Development DB Account"
  },
  "properties": {
    "locations": "[variables('locations')]",
    "databaseAccountOfferType": "Standard"
  }
},
{
  "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
  "name": "[concat(variables('sqlServerName'), '/sql/', variables('name'))]",
  "apiVersion": "2016-03-31",
  "dependsOn": ["[resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('sqlServerName'))]"],
  "properties": {
    "resource": {
      "name": "[variables('liveName')]"
    },
    "options": {
      "throughput": "[variables('cosmosThroughPut')]"
    }
  }
},
{
  "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
  "name": "[concat(variables('sqlServerDevelopmentName'), '/sql/', variables('name'))]",
  "apiVersion": "2016-03-31",
  "dependsOn": ["[resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('sqlServerDevelopmentName'))]"],
  "properties": {
    "resource": {
      "name": "[variables('developmentName')]"
    },
    "options": {
      "throughput": "[variables('cosmosDevelopThroughPut')]"
    }
  }
},
{
  "name": "[concat(variables('sqlServerName'), '/sql/', variables('name'), '/', variables('cosmosContainerName'))]",
  "type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/containers",
  "apiVersion": "2016-03-31",
  "dependsOn": ["[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('sqlServerName'), 'sql', variables('name'))]"],
  "properties": {
    "resource": {
      "name": "[variables('cosmosContainerName')]",
      "partitionKey": {
        "paths": [
          "/categoryId"
        ],
        "kind": "Hash"
      },
      "indexingPolicy": {
        "indexingMode": "consistent",
        "includedPaths": [{
          "path": "/*"
        }]
      }
    }
  }
},
{
  "name": "[concat(variables('sqlServerDevelopmentName'), '/sql/', variables('name'), '/', variables('cosmosContainerName'))]",
  "type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/containers",
  "apiVersion": "2016-03-31",
  "dependsOn": ["[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('sqlServerDevelopmentName'), 'sql', variables('name'))]"],
  "properties": {
    "resource": {
      "name": "[variables('cosmosContainerName')]",
      "partitionKey": {
        "paths": [
          "/categoryId"
        ],
        "kind": "Hash"
      },
      "indexingPolicy": {
        "indexingMode": "consistent",
        "includedPaths": [{
          "path": "/*"
        }]
      }
    }
  }
}

变量看起来像这样:

"name": "sxp",
"sqlServerName": "[variables('liveName')]",
"sqlServerDevelopmentName": "[variables('developmentName')]",
"sxpDatabaseName": "[variables('name')]",
"cosmosContainerName": "products",
"cosmosThroughPut": "400",
"cosmosDevelopThroughPut": "400",

运行发行版时,出现此错误(对于两个DocumentDb服务器):

{
    "status": "Failed",
    "error": {
        "code": "ResourceDeploymentFailure",
        "message": "The resource operation completed with terminal provisioning state 'Failed'.",
        "details": [
            {
                "code": "BadRequest",
                "message": "Message: {\"code\":\"BadRequest\",\"message\":\"Message: {\\\"partitionCount\\\":1}\\r\\nActivityId: b0751976-2076-4f29-93ab-b3d5849390b8, Request URI: /apps/0ccd856f-da7a-4ff9-a530-88ce0dbfd50c/services/b3350877-fd5e-4ea1-b6ee-41ecb9fb2540/partitions/14300278-223a-4614-afca-48f66e186695/replicas/132272757678585484p, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.9.2\"}, Request URI: /dbs, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2, Microsoft.Azure.Documents.Common/2.9.2"
            }
        ]
    }
}

这对我绝对没有任何意义。我已经尝试使用Google搜索,但是找不到对该错误的任何引用。奇怪的是,它创建了资源并且可以使用,但是部署表明失败了。

有人看过这个问题吗?

r3plica

我已经弄清楚了。这与id财产有关。你必须有一个。如果使用,arm-ttk-master它会告诉您不使用resourceId函数无效,但是对于宇宙数据库和容器,这是错误的.....

因此,它应如下所示:

{
  "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
  "name": "[concat(variables('sqlServerDevelopmentName'), '/sql/', variables('name'))]",
  "apiVersion": "2016-03-31",
  "dependsOn": [
    "[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('sqlServerDevelopmentName'))]"
  ],
  "properties": {
    "resource": {
      "id": "[variables('name')]"
    },
    "options": {
      "throughput": "[variables('cosmosDevelopThroughPut')]"
    }
  }
},
{
  "name": "[concat(variables('sqlServerName'), '/sql/', variables('name'), '/', variables('cosmosContainerName'))]",
  "type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/containers",
  "apiVersion": "2016-03-31",
  "dependsOn": [
    "[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('sqlServerName'), 'sql', variables('name'))]"
  ],
  "properties": {
    "resource": {
      "id": "[variables('cosmosContainerName')]",
      "partitionKey": {
        "paths": [
          "/categoryId"
        ],
        "kind": "Hash"
      },
      "indexingPolicy": {
        "indexingMode": "consistent",
        "includedPaths": [{
          "path": "/*"
        }]
      }
    }
  }
},

注意id属性:

"id": "[variables('cosmosContainerName')]",

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

使用 arm 模板部署 azure Key Vault Secret 出现错误

来自分类Dev

使用Azure Devops部署Azure策略ARM模板失败

来自分类Dev

使用ARM模板和JSON在Azure中创建VM时出现“ DiskImageNotReady”错误

来自分类Dev

使用Scrapy时出现奇怪的错误

来自分类Dev

使用CSS Boostrap时出现奇怪的错误

来自分类Dev

使用遮罩时出现奇怪的阴影错误

来自分类Dev

使用YuvImage压缩时出现奇怪的错误

来自分类Dev

使用 Webdeploy 部署时出现连接错误

来自分类Dev

使用模板时出现烧瓶错误

来自分类Dev

ARM 模板部署过程中出现“KeyVault 参数‘’的资源标识符无效”错误

来自分类Dev

使用flutter时Azure Devops中的奇怪生成错误

来自分类Dev

编译时出现奇怪的错误

来自分类Dev

在批处理脚本中使用查找时出现奇怪的错误

来自分类Dev

使用宏生成方法时出现奇怪的错误?

来自分类Dev

使用泛型重载方法时出现奇怪的错误

来自分类Dev

在Qml场景下使用OpenGL渲染时出现奇怪的错误

来自分类Dev

在既定的theano环境上使用keras时出现奇怪的错误

来自分类Dev

Excel:使用UDF时出现奇怪的#VALUE错误行为

来自分类Dev

使用PointClamp或PointWrap时出现奇怪的纹理移动错误

来自分类Dev

在iOS中使用html时出现奇怪的错误

来自分类Dev

在循环中使用ffmpeg时出现奇怪的错误

来自分类Dev

在Java中使用foreach循环时出现奇怪的错误

来自分类Dev

在Qml场景下使用OpenGL渲染时出现奇怪的错误

来自分类Dev

在既定的theano环境上使用keras时出现奇怪的错误

来自分类Dev

Javascript:使用“标签”时出现奇怪的语法错误

来自分类Dev

在Python中使用空格而不是Tab时出现奇怪的错误

来自分类Dev

Javascript:使用JS对象时出现奇怪的错误

来自分类Dev

使用 Lombok 和 IntelliJ 时出现奇怪的编译错误

来自分类Dev

使用 pg-promise 转换值时出现奇怪的错误

Related 相关文章

  1. 1

    使用 arm 模板部署 azure Key Vault Secret 出现错误

  2. 2

    使用Azure Devops部署Azure策略ARM模板失败

  3. 3

    使用ARM模板和JSON在Azure中创建VM时出现“ DiskImageNotReady”错误

  4. 4

    使用Scrapy时出现奇怪的错误

  5. 5

    使用CSS Boostrap时出现奇怪的错误

  6. 6

    使用遮罩时出现奇怪的阴影错误

  7. 7

    使用YuvImage压缩时出现奇怪的错误

  8. 8

    使用 Webdeploy 部署时出现连接错误

  9. 9

    使用模板时出现烧瓶错误

  10. 10

    ARM 模板部署过程中出现“KeyVault 参数‘’的资源标识符无效”错误

  11. 11

    使用flutter时Azure Devops中的奇怪生成错误

  12. 12

    编译时出现奇怪的错误

  13. 13

    在批处理脚本中使用查找时出现奇怪的错误

  14. 14

    使用宏生成方法时出现奇怪的错误?

  15. 15

    使用泛型重载方法时出现奇怪的错误

  16. 16

    在Qml场景下使用OpenGL渲染时出现奇怪的错误

  17. 17

    在既定的theano环境上使用keras时出现奇怪的错误

  18. 18

    Excel:使用UDF时出现奇怪的#VALUE错误行为

  19. 19

    使用PointClamp或PointWrap时出现奇怪的纹理移动错误

  20. 20

    在iOS中使用html时出现奇怪的错误

  21. 21

    在循环中使用ffmpeg时出现奇怪的错误

  22. 22

    在Java中使用foreach循环时出现奇怪的错误

  23. 23

    在Qml场景下使用OpenGL渲染时出现奇怪的错误

  24. 24

    在既定的theano环境上使用keras时出现奇怪的错误

  25. 25

    Javascript:使用“标签”时出现奇怪的语法错误

  26. 26

    在Python中使用空格而不是Tab时出现奇怪的错误

  27. 27

    Javascript:使用JS对象时出现奇怪的错误

  28. 28

    使用 Lombok 和 IntelliJ 时出现奇怪的编译错误

  29. 29

    使用 pg-promise 转换值时出现奇怪的错误

热门标签

归档