【问题标题】:Azure ARM Template - SQL Failover Group Error FailoverGroupCreateOrUpdateRequestReadOnlyPropertyModifiedAzure ARM 模板 - SQL 故障转移组错误 FailoverGroupCreateOrUpdateRequestReadOnlyPropertyModified
【发布时间】:2020-10-05 23:01:31
【问题描述】:

从 ARM 模板成功部署了具有预期故障转移组的主要和辅助 Azure SQL 服务器。在后续部署中部署 ARM 模板返回以下错误消息:

  "error": {
    "code": "FailoverGroupCreateOrUpdateRequestReadOnlyPropertyModified",
    "message": "The create or update failover group request body should not modify the read-only property 'location'."
  }
} undefined

我们没有对错误消息中指示的主服务器或辅助服务器的位置属性进行任何更改。

来自 ARM 模板的代码 sn-p:

    {
      "comments": "Azure SQL Server Failover Group",
      "condition": "[parameters('isProduction')]",
      "type": "Microsoft.Sql/servers/failoverGroups",
      "apiVersion": "2015-05-01-preview",
      "name": "[concat(variables('sqlServerPrimaryName'), '/', variables('sqlServerFailoverName'))]",
      "location": "[parameters('sqlServerPrimaryLocation')]",
      "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', variables('sqlServerPrimaryName'))]",
        "[resourceId('Microsoft.Sql/servers', variables('sqlServerSecondaryName'))]",
        "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('adminDbName'))]",
        "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('trxnDbName'))]",
        "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('dbaDbName'))]"
      ],
      "properties": {
        "readWriteEndpoint": {
          "failoverPolicy": "Automatic",
          "failoverWithDataLossGracePeriodMinutes": 60
        },
        "readOnlyEndpoint": {
          "failoverPolicy": "Disabled"
        },
        "partnerServers": [
          {
            "id": "[resourceId('Microsoft.Sql/servers', variables('sqlServerSecondaryName'))]"
          }
        ],
        "databases": [
          "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('adminDbName'))]",
          "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('trxnDbName'))]",
          "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('dbaDbName'))]"
        ]
      }
    }

【问题讨论】:

  • 你的意思是两次部署ARM模板时出现错误?
  • 没错。我无法多次为故障转移组部署具有相同代码库的模板。
  • @adm 一旦部署了 arm 模板,就会创建并存在故障转移组。正如错误所说,位置是只读的。当我们部署两次时,即使你没有设置位置值,它仍然会更新它,然后导致错误。

标签: azure arm-template azure-sql-server


【解决方案1】:

正如@Leon Yue 的评论所说:

部署 arm 模板后,将创建故障转移组并 存在。正如错误所说,位置是只读的。当我们部署它时 两次,即使你没有设置位置值,它仍然会更新 它,然后导致错误。

第二次部署时无法更新location属性,需要移动该属性。

【讨论】:

    【解决方案2】:

    如果可能,然后从 ARM 模板中删除该位置,因为您已经在故障转移组创建名称中给出了 sqlServerPrimaryName,它采用 sqlServerPrimaryName 的位置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-17
      • 2021-10-03
      • 1970-01-01
      • 2021-11-04
      • 1970-01-01
      相关资源
      最近更新 更多