Map two domains to single Azure website like www.client1.example.com and www.client2.example.com - asp.net-mvc

How we can map two or more domains to a single Azure website?
So in my website, I can map some logic based on domain name.
Like: www.client1.example.com & www.client2.example.com

How we can map two or more domains to a single azure website
You could try to use a CNAME record to map to your Azure app's default domain name, and Azure app service enables us to assign more than one hostname to site. This article shows how to map custom domain name to Azure app, please refer to it.

Related

Is it possible to set a custom domain name for Azure Digital Twins instance?

I'm currently developing a project where the customer needs to expose the Azure Digital Twins instance with a custom dns name. Is there any way that we can change the digitaltwins.azure.net domain for a custom one?
Thank you
You can can pick the instance name in FQDN. But it is not possible to change digitaltwins.azure.net.
Also, you can use own name to what we provide with a separate dns entry. This is not done through ADT though.
Please see Use Azure DNS with other Azure services

Using Custom domain, URL mask with CloudRun services and a NEG

I am having issue using the Serverless NEG and URL Masks with Custom domains. Here is some background:
I have multiple services deployed as CloudRun services (login service, search service, feedback service). I am trying to setup a custom domain mapping and use URL Masking so the requests are routed to appropriate services.
I followed the steps outlined here - https://cloud.google.com/load-balancing/docs/https/setting-up-https-serverless
I have created a Load Balancer, Backend Service and a Serverless NEG with a Serverless Network Endpoint Group type as "Cloud Run" and selected "use URL mask" checkbox and provided my custom domain URL like this mycompany.com/ where mycompany.com is the custom domain I have.
NOTE: I am planning to use just one Serverless NEG and leverage URL mask so it can route the requests to appropriate CloudRun service in the backend.
I have updated mycompany.com to use the Public IP address created by the LB from the above steps.
Now, When I type mycompany.com/login or mycompany.com/search, it is not directing me to the appropriate CloudRun services and instead get an error - "This site can’t be reached"
My question: Do I need to setup Custom Domains and add mappings on the CloudRun page specifying mycompany.com and select one of the CloudRun service for me to leverage URL masks ?
I am slightly confused here and the documentation is not helping me here.
Please help.
Regards,
Raj

I purchase the domain and how can I have more than two urls under this domain?

I am trying to host the webapp and the company page under one domain like
Google has
https://www.google.com/
https://support.google.com/
I thought it was two different domains and I've searched for abc.myfirm.io (example) and it does not look like I need to purchase a domain to have that setup.
I am currently using NameCheap
You do not need to register a separate domain with a domain name registrar. You can just create a DNS entry for the subdomain. If the different domains are all aliases for the primary domain (myfirm.io), then use a CNAME record to point the subdomains to myfirm.io. If they are intended to be separate services, create an A record to point the subdomain to the IP it's hosted on.

Redirect from non www to www, do I need two app services in azure?

I'm using this solution in redirecting my domain from non www to www. I'm using azure for hosting.
I have created app service for www.domain.com
when I try to access domain.com I get this error:
Should I have to create two app services one for domain.com and one for www.domain.com? or is there a way to accomplish this using one app service?
Should I have to create two app services one for domain.com and one
for www.domain.com? or is there a way to accomplish this using one app
service?
No, you don't need two app services to accomplish this.
Assuming you have configured domain mapping correctly in your DNS provider (e.g. GoDaddy), all you need to do is add both www.domain.com and domain.com in the Hostname mapping in Custom DNS section for your Web App in Azure Portal.
All you need to do it set it up in the DNS section of your domain provider and add custom domains in App Service in Azure Portal as well:
Type Name Value
A # Ip Address of your App Service ( this will cover your main domain )
TXT # yourwebsite.azurewebsites.net ( this will cover your main domain )
CNAME www yourwebsite.azurewebsites.net ( this will conver www section)
Now in the app service side you need to add the custom bindings.
Go to Azure Portal | App Service | settings | custom domains | add host name as below
yourdomain.com
Now you have both domain pointing to same App Service.
More info on step by step guide, I have prepared a post for custom domain check it out.

Azure subdomains with different solutions

I have 3 different MVC solutions:
Customers site
Admin site
Businesses site
i wish to have them as:
www.mysite.com
admin.mysite.com
business.mysite.com
How can this be achieved in Azure?
Thanks
Follow the instructions at Configuring a custom domain name for an Azure Web Site. More generally, create your Azure websites and then create three CNAME records with your domain registrar and point them to the Azure DNS:
create CNAME record "www" and point to www-mysite.azurewebsites.net
create CNAME record "admin" and point to admin-mysite.azurewebsites.net
create CNAME record "business" and piont to business-mysite.azurewebsites.net
Then in the Azure Portal on each website - Manage Domains - to add the custom domain.

Resources