Azure / Azure/azure-quickstart-templates
unable to set a dns setting to a vm through azure template
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
Hi
I have been struggling to configure the DNS setting of a Vnic trough the template. but it is impossible.
When i do it manually trough the portal i can verify the config via the "Automation script" button like this :
"dnsSettings": {
"dnsServers": [
"10.0.0.4"
]
},
But when done trough the template it inherite the dns from the virtual network everytime.
Please look at this write deployment log and compare the requestbody and the response body.
"operationName": {
"localizedValue": "Microsoft.Network/networkInterfaces/write",
"value": "Microsoft.Network/networkInterfaces/write"
},
"properties": {
"requestbody": "{\"location\":\"westeurope\",\"properties\":{\"ipConfigurations\":[{\"name\":\"ipconfig1\",\"properties\":{\"privateIPAllocationMethod\":\"Static\",\"privateIPAddress\":\"10.0.0.10\",\"subnet\":{\"id\":\"/subscriptions/######/resourceGroups/csalab1/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/Subnet-INT\"},\"loadBalancerBackendAddressPools\":[{\"id\":\"/subscriptions/#####/resourceGroups/csalab1/providers/Microsoft.Network/loadBalancers/LB-INT/BackendAddressPools/SFBLBBE\"}],\"loadBalancerInboundNatRules\":[{\"id\":\"/subscriptions/#####/resourceGroups/csalab1/providers/Microsoft.Network/loadBalancers/LB-INT/inboundNatRules/VM-SFB-CL1-RDP\"}],\"dnsSettings\":{\"dnsServers\":[\"10.0.0.4\"],\"appliedDnsServers\":[\"10.0.0.4\"]}}}]}}",
"statusCode": "Created",
"serviceRequestId": "#####",
"responseBody": "{\"name\":\"VM-SFB-CL1-NIC\",\"id\":\"/subscriptions/#####/resourceGroups/csalab1/providers/Microsoft.Network/networkInterfaces/VM-SFB-CL1-NIC\",\"etag\":\"W/\\\"####\\\"\",\"location\":\"westeurope\",\"properties\":{\"provisioningState\":\"Succeeded\",\"resourceGuid\":\"####\",\"ipConfigurations\":[{\"name\":\"ipconfig1\",\"id\":\"/subscriptions/fb40671f-c2d5-40a5-ae34-ae655ba58cc7/resourceGroups/csalab1/providers/Microsoft.Network/networkInterfaces/VM-SFB-CL1-NIC/ipConfigurations/ipconfig1\",\"etag\":\"W/\\\"####\\\"\",\"properties\":{\"provisioningState\":\"Succeeded\",\"privateIPAddress\":\"10.0.0.10\",\"privateIPAllocationMethod\":\"Static\",\"subnet\":{\"id\":\"/subscriptions/#####/resourceGroups/csalab1/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/Subnet-INT\"},\"primary\":true,\"loadBalancerBackendAddressPools\":[{\"id\":\"/subscriptions/#####/resourceGroups/csalab1/providers/Microsoft.Network/loadBalancers/LB-INT/backendAddressPools/SFBLBBE\"}],\"loadBalancerInboundNatRules\":[{\"id\":\"/subscriptions/####/resourceGroups/csalab1/providers/Microsoft.Network/loadBalancers/LB-INT/inboundNatRules/VM-SFB-CL1-RDP\"}]}}],\"dnsSettings\":{\"dnsServers\":[],\"appliedDnsServers\":[]},\"enableIPForwarding\":false},\"type\":\"Microsoft.Network/networkInterfaces\"}"
},
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Azure template that creates the Microsoft.Network/networkInterfaces resource and compare its request body with the deployment response body shown in the issue. Investigate why dnsSettings.dnsServers is omitted from the created network interface, then verify the behavior with a repeat deployment and the Azure portal's Automation script.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100