Search code examples
azureazure-resource-managerazure-rm-templateazure-cliinfrastructure-as-code

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


Sorry for trying to get "2 answers for the price of 1" ;) but I'm having trouble figuring out the following errors that occur when I deploy my ARM template.

Error 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 - }'

for my resource

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

Error 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 - }'

for my resource

{
  "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"
  }
}

Solution

  • first error - classic resources cannot have tags, drops the "tags" property completely
    second error - this is a "subresource", I dont think you can have tags on those at all, drop "tags" (again).

    Also, there is absolutely no point in tagging Azure SQL as Azure SQL, VM as VM, etc.