Azure / Azure/azure-quickstart-templates

Hostnamebindings error and how can we solve it ?

Open
#4,742 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with 201-web-app-github-deploy/azuredeploy.json and the Deploy-AzureResourceGroup.ps1 entry point, then reproduce the deployment with the PowerShell command in the issue. Inspect the Microsoft.Web/sites/hostNameBindings resource and its variables against the reported hostname-limit error. Done means the template deploys without the background hostname binding error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.