2
votes

I want to add a wildcard hostname to multiple Azure WebApps e.g. *.mydomain.com

I have read https://docs.microsoft.com/en-us/azure/app-service/app-service-custom-domain-name-migrate which suggests I can bind the domain name pre-emptively using a TXT DNS record.

To verify domain ownership, Add a TXT record. The TXT record maps from awverify. to .azurewebsites.net.

I have tried to add awverify.* TXT myapp.azurewebsites.net but get error message:

Each label must only contain letters, numbers, underscores, and/or dashes. Each label should be separated from other labels by a period. A wildcard ('*' character) is permitted either as the single character in the name, or as the first label in the name.

I want to assign the wildcard domain to multiple WebApps and they change the DNS CNames for specific subdomains without an downtime.

How is this possible?

2
This might help you. Let me know if this helpsJayendran
This does not work: Our custom hostname feature allows you to bypass validation for hostnames that have already been validated. You only need to verify domain ownership when you add a hostname for the first time. For all other apps in the same subscription, you can add the same hostname without creating any DNS records. It always asks to validate the hostname in a new site within the same subscription.Andrew Jocelyn

2 Answers

0
votes

How can add the same wildcard hostname to multiple Azure web apps?

In short no way.

When you add the wildcard hostname to another app service, it seems that there is already a record set with the same name this DNS zone. You can only have one HOST that equals to *.

Maybe you could Add hostname with *.domain.com in different azure service plan, but you could not visit it. enter image description here BTW,You can use either a CNAME record or an A record to map a custom DNS name to App Service.

A TXT record to map to the app's default hostname .azurewebsites.net. App Service uses this record only at configuration time, to verify that you own the custom domain. After your custom domain is validated and configured in App Service, you can delete this TXT record.

For more details, you could refer to this article.

0
votes

You can add the same custom hostname to multiple Azure Web Apps, even wildcards, if they are not in the same subscription AND in the same region. This is not well documented; I spent an afternoon with Azure support to learn of this restriction.

Your TXT record is almost correct. It should be awverify TXT myapp.azurewebsites.net for a wildcard hostname, assuming your Azure Web App's name is "myapp".