Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
13.82k stars 16k forks source link

Hostnamebindings error and how can we solve it ? #4742

Open rifaterdemsahin opened 6 years ago

rifaterdemsahin commented 6 years ago

I am unable to find it necessary information in this template about hostnamebindings https://github.com/Azure/azure-quickstart-templates/blob/master/201-web-app-github-deploy/azuredeploy.json

### Issue Details When I try to deploy an arm template I am getting this error.,

Error in Powershell New-AzureRmResourceGroupDeployment : 17:09:29 - Resource Microsoft.Web/sites/hostNameBindings 'monitorfunctionswivpj9/monitorfunctionswivpj5hlzdq3i9.azurewebsites.net' failed with message '{ "Code": "BadRequest", "Message": "Too many (2) hostnames in the default DNS zone. Limit is 1.", "Target": null, "Details": [ { "Message": "Too many (2) hostnames in the default DNS zone. Limit is 1." }, { "Code": "BadRequest" }, { "ErrorEntity": { "ExtendedCode": "04017", "MessageTemplate": "Too many ({0}) hostnames in the default DNS zone. Limit is {1}.", "Parameters": [ "2", "1" ], "Code": "BadRequest", "Message": "Too many (2) hostnames in the default DNS zone. Limit is 1." } } ], "Innererror": null }'

My resources section

{
  "comments": "Generalized from resource: '/subscriptions/1f2dbbd7-69f6-443f-961f-988dbc9ee66a/resourceGroups/logicApps-rg/providers/Microsoft.Web/sites/monitorfunctions/hostNameBindings/monitorfunctions.azurewebsites.net'.",
  "type": "Microsoft.Web/sites/hostNameBindings",
  "name": "[concat(variables('functionsname'),'/', variables('hostnamebindingsforfunctions'))]",
  "apiVersion": "2016-08-01",
  "location": "East US 2",
  "scale": null,
  "properties": {
    "siteName": "functionsname9",
    "domainId": null,
    "hostNameType": "Verified"
  },
  "dependsOn": [
    "[resourceId('Microsoft.Web/sites', variables('functionsname'))]"
  ]
}

My Variables Section "variables": { "hostnamebindingsforfunctions": "[concat('monitorfunctions',uniqueString(resourceGroup().id),'9','.azurewebsites.net')]", "functionsname": "[concat('monitorfunctions',substring(uniqueString(resourceGroup().id),0,5),'9')]" },

### Repro steps (if necessary, delete otherwise)

  1. run this using powershell 2.send command .\Deploy-AzureResourceGroup.ps1 -ResourceGroupLocation ukwest 3.The resources created 4.But there is an error in the background
bormm commented 4 years ago

This is still not working. I exported a ARM template from the portal and then tried to deploy it and get the same error as with this original sample. How is it possible thats not working since 2 years and nobody fixes anthing? If the sample is wrong: fix it and also fix the export, it creates the same hostNameBindings. If it is correct: fix it.