Assign and verify Microsoft Azure AD custom domain using Azure App Service Domains
10 minutes
to read.
Abs07act
Have you
ever heard of the word Doppelganger? It means ghostly double or counterpart of
living person. There is theory that says, In today’s world there are 7 people
who look similar to you. There are 6.4 billions basepairs in Human DNA.
So I don’t 07ust this theory. However humans made sure that when it comes to
internet world, there is one thing always unique – domain names. Domain names
are very critical and there have been many famous domain name battles on
uniqueness. One of the famous domain name battle was “Microsoft vs.
MikeRoweSoft”. What? You never heard of it? Go search the internet.
Domain names
can make or break an identify for your business. Custom domain names are
inevitable in today’s world. If you want to be successful with your business/
website then custom domain name is a must. Microsoft Azure services also need
custom domain names so that instance of Microsoft Azure services names can be
aligned with your business / company names.
Azure AD is
cen07al to any Microsoft Azure based environment. All subscriptions belong to
Azure AD and Azure subscriptions related identity management is also managed
through Azure AD. Any Azure AD created will always have form as “YourAADInstanceName.onmicrosoft.com”.
So when you create a user in Azure AD the FQDN of Azure AD user will be
“username@YourADInstanceName.onmicrosoft.com.” Example I have an Azure Active
Directory named “SanganakAuthority.onmicrosoft.com” then user “kunal” will have
FQDN as “kunal@SanganakAuthority.onmicrosoft.com”. This is definitely not a
user friendly name. If I change it to kunal@SanganakAuthority.com then it appeals a lot.
So custom
domain for Azure AD is good to have thing!
Best thing
is you DON’T have to go for external domain regis07ars/ providers like GoDaddy,
HostGator, Bluehost etc. Microsoft Azure provides domain names through Azure
App Service domains and you can use it anywhere including Azure AD.
Let’s go!
This is important
to know aspects such as Domain Names, DNS Zones and DNS Records concepts in general
and in Microsoft Azure platform. Refer below important diagram.
Domain names
are provided by domain name regis07ars. Owning the domain names gives you right
to con07ol the DNS hierarchy. These purchased domain names are hosted on DNS
names servers in terms of DNS Records. The domain regis07ar has their own name
servers or they also allow you to specify your own/ preferred name servers. You
host the domain names on name servers as DNS Records like A records, CName
record, Txt record and so on. The combination of Names servers and DNS records
is called as DNS Zones.
For
purchasing domain names Azure provides “Azure App Service domain” and for DNS
Zones Azure provides service called as “Azure DNS”.
Note – When
we create Azure App service domain, the corresponding DNS zone is automatically
created. Both domain and DNS zone will be created in the same resource group.
We are going
to use Azure AD, Azure App Service Domains and Azure DNS in this blog post for
configuring the custom domain for Azure AD. To avoid the confusion let us
understand the intent of these services and relationships between them.
Azure AD
This PaaS
version of Active Directory. It can even be sync with your on premises existing
Active Directory. Azure AD always get default domain suffix as “onmicrosoft.com”.
So complete domain will be “YourCompany.onmicrosoft.com”. Enterprise always
like to have domain representing their company names and hence onmicrosoft.com
is not so appealing. Enterprise want “Yourcompany.com” assigned to Azure AD. Therefore
Azure AD generally needs custom domain to be attached.
Azure App
Service Domain
This has nothing
to do with Azure App Service default domain “.azurewebsite.net”. If you create
Azure web app as “kunal.azurewebsites.com” then for your customer you may want
the URL of your app as “kunal.com”. So in general scenario you will go to
domain regis07ar, purchase domain “kunal.com” and then assign CNAME to “kunal.azurewebsites.net”.
When you
purchase domain from domain regis07ar then you have to manage domain by using
their own portal/ management console. Plus billing also will be separate than Azure
App Service web app billing.
If you use
Azure App Service domain to get “kunal.com” instead of domain regis07ar domain
then your billing will be part of the Azure itself. So App service domain is
domain name purchase service on Azure. The domains purchased through App
Service domain can be used anywhere like on premises hosted web app, Azure
hosted APIs, Azure storage, Azure CDN, AWS hosted apps, GCP hosted Apps and so
on. In our case we will use it for Azure AD.
Note – You
can use Azure App Service Domain without use of Azure DNS service.
Azure DNS
Azure DNS is
DNS zone service on Azure where you get name servers to host your domain
through DNS records. This does not necessarily need domain names purchased
through App Service domains. If you have purchased domain name from 3rd
party domain regis07ar then you can host that domain name using Azure DNS
service or DNS provided by 3rd party. Similarly App service domains
can either be hosted on Azure DNS or 3rd party DNS service.
In our case
we are using App Service domains and Azure DNS hand in hand instead of using 3rd
party services.
Note – You
can use Azure DNS for hosting 3rd party purchased domain names also.
Not necessarily Azure App Service Domains.
Summary -
Azure DNS
and App Service domains are two different services and can be used independently
based on the scenario. In our case we could have achieved custom domain name
mapping to Azure Ad in below ways also –
1. Purchase domain from 3rd party use Azure DNS and assign domain to Azure AD
2. Purchase domain from App Service domain, use 3rd party DNS and assign domain to Azure AD
3. Purchase domain from 3rd party and use 3rd DNS only and assign domain to Azure AD.
4. Or easy way - Purchase domain from Azure App service, use Azure DNS and assign to Azure AD – we are doing this.
1. Purchase domain from 3rd party use Azure DNS and assign domain to Azure AD
2. Purchase domain from App Service domain, use 3rd party DNS and assign domain to Azure AD
3. Purchase domain from 3rd party and use 3rd DNS only and assign domain to Azure AD.
4. Or easy way - Purchase domain from Azure App service, use Azure DNS and assign to Azure AD – we are doing this.
Comments
Post a Comment