ARM 模板部署无用的错误,包括 "The domain name '...' request is invalid. Resource tags are not supported."

ARM template deployment unhelpful errors, including "The domain name '...' request is invalid. Resource tags are not supported."

很抱歉试图获得“1 个价格的 2 个答案”;) 但我无法弄清楚部署 ARM 模板时发生的以下错误。

错误 1:

8:53:07 - 6:50:52 PM - Resource Microsoft.ClassicCompute/domainNames 'cslmh' failed with message '{
18:53:07 -   "error": {
18:53:07 -     "code": "InvalidDomainNameRequest",
18:53:07 -     "message": "The domain name 'cslmh' request is invalid. Resource tags are not supported."
18:53:07 -   }
18:53:07 - }'

我的资源

{
  "apiVersion": "2015-06-01",
  "name": "[variables('CloudServiceName')]",
  "tags": {
    "displayName": "Cloud Service"
  },
  "location": "[parameters('location')]",
  "type": "Microsoft.ClassicCompute/domainNames"
}

错误 2:

18:53:07 - 6:51:57 PM - Resource Microsoft.Sql/servers/firewallrules 'mysqlserver/AllowAllWindowsAzureIps' failed with message '{
18:53:07 -   "code": "BadRequest",
18:53:07 -   "message": "Invalid value given for parameter tags. Specify a valid parameter value.",
18:53:07 -   "target": null,
18:53:07 -   "details": [],
18:53:07 -   "innererror": []
18:53:07 - }'

我的资源

{
  "name": "[concat(variables('sqlServerName'), '/', 'AllowAllWindowsAzureIps')]",
  "type": "Microsoft.Sql/servers/firewallrules",
  "tags": {
    "displayName": "SQL Server Firewall"
  },
  "location": "[resourceGroup().location]",
  "apiVersion": "2014-04-01-preview",
  "dependsOn": [
    "[resourceId('Microsoft.Sql/servers', variables('sqlServerName'))]"
  ],
  "properties": {
    "startIpAddress": "0.0.0.0",
    "endIpAddress": "0.0.0.0"
  }
}

第一个错误 - 经典资源不能有标签,完全删除 "tags" 属性
第二个错误 - 这是一个 "subresource",我认为你根本不能在上面添加标签,删除 "tags"(再次)。

此外,将 Azure SQL 标记为 Azure SQL、将 VM 标记为 VM 等绝对没有意义