webapp: Way to get 'Custom Domain Verification ID' for web app
See original GitHub issueI need a way to get the Custom Domain Verification ID
of a web app so that I can automate binding a custom host name.
I’ve looked through all the documentation and methods exposed on az webapp
but I am unable to find a way to get the verification id which I can use to add a TXT record to an Azure DNS zone then bind the custom host name without performing the verification step manually.
This is a big hole in our environment creation process we would like to automate.
Sorry if I missed anything!
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:21 (9 by maintainers)
Top Results From Across the Web
Tutorial: Create custom Azure DNS records for a web app
In this tutorial, you learn how to create custom domain DNS records for web apps using Azure DNS.
Read more >Add and Secure a Custom Domain on Your Azure App ...
Verifying and adding custom domain · Go to your App Service and navigate to the “Custom domain” section under “Settings”. · Click on...
Read more >Is the Custom Domain Verification shared across an Azure ...
Adding to Cindy Pau's answer you can use the Azure CLI command to get the custom domain verification id value:
Read more >Custom Domains in Azure Web Apps
This section discusses registering a domain name. If you already have a domain name, you can skip to the next section. Before setting...
Read more >Add a custom domain to an Azure Web App - TechLabs
Create external DNS records · Create DNS CNAME record · Create DNS TXT record to verify domain ownership · Create DNS TXT record...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Building on SupriyaGangineni’s reply…
The domain verification id is the same for all app services on the same subscription. the following query gives you a list of all subscriptions you have access to.
az graph query -q "Resources | join kind=leftouter (ResourceContainers | where type=='microsoft.resources/subscriptions' | project SubName=name, subscriptionId) on subscriptionId | where type == 'microsoft.web/sites'| project vid = tostring(properties.customDomainVerificationId), SubName | distinct *"
We setup our infrastructure (functionapp & other resources) via a bicep/ARM template. In the bicep template we bind the custom hostname to the functionapp but this requires that we have already added the records with our DNS provider. Thus we a way to retrieve the record values and set these with our DNS provider before setting up our infrastructure. Since it’s not possible to get the value from the subscription alone this means we would have to create a webapp use the cli to get the id and then destroy the webapp. If we want to automate the task. Since the value is unique for the subscription alone it feels like it would be better for everyone if it could be retrieved directly from there. Or if it was possible for MS to share how the value is calculated.
Kindly, Pablo