0

Currently, our SaaS application is hosted on Azure Virtual Machine Scale Set, now we are planning to move to Azure Websites.

Customers using their custom domain (like customer1.com, customer2.com) to access the application and to identify customer, we assign our subdomains to them, like customer1.myappname.com, customer2.myappname.com and so on. Then customer uses below DNS records to open customer1.myappname.com by custom domain customer1.com.

CNAME      www                customer1.myappname.com
CNAME      customer1.com      customer1.myappname.com

Said implementation works well, but when we tried a trial attempt to migrate to azure websites, that’s becoming challenging due to domain ownership verification on azure websites. I already added wildcard *myappname.com in azure website custom domains and can access sites with customer1.myappname.com, customer2.myappname.com.

Please suggest appropriate DNS records for custom domains to access the azure website (which does not require domain ownership verification or some sort of automation).

We can use azure website REST API to add and to verify domain ownership but this won't scale I hope. Love to hear about your such implementation on azure websites.

Udara Abeythilake
  • 1,215
  • 1
  • 20
  • 31
Abhimanyu
  • 2,173
  • 2
  • 28
  • 44

1 Answers1

0

I would like to suggest creating two app services on the same app service plan because If you add two custom domains like customer1.myappname.com and customer2.myappname.com in the same app services, you will access the websites via both of URLs. If so, It will not be a benefit to identify the different customers unless you are using a virtual path, see here. But the virtual path is also working on all hostnames, you may need rewrite rules in your web.config file.

To do this, you could add the custom domain customer1.myappname.com in the custom domains of one of the app services by using CNAME Hostname record type. Another app service is the same to add the custom domain customer2.myappname.com.

To validate Domain ownership, you could create a CNAME record with your DNS provider using the configuration below. Learn more

Type    Host    Value
CNAME   www or subdomain    somewebappxxx.azurewebsites.net

If so, your different customers could access the websites using different URL like https://customer1.myappname.com. Hope this could help you.

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • We have more than 1000+ potential customers with custom domains. So creating a new app services for each customer will become a nightmare and that's against SaaS architecture...right. – Abhimanyu Jul 25 '19 at 07:39
  • Yes, So you may consider using virtual paths and URL rewrite to identify different customers. refer to [this1](https://learn.microsoft.com/en-us/azure/app-service/configure-common#configure-path-mappings) and [this2](https://blogs.msdn.microsoft.com/benjaminperkins/2017/10/27/how-to-map-an-azure-app-service-web-app-virtual-directory-to-azure-storage-containter/) You could have unlimited apps with app service in basic or above price tier app service plan. – Nancy Jul 25 '19 at 07:55
  • Also, for long terns, you could consider creating an application gateway with URL path-based routing rules using Azure PowerShell, refer to [this](https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-create-url-route-arm-ps). – Nancy Jul 25 '19 at 07:58
  • we already using application based URL rewrite and we don't have issue in identifying customer either they use our subdomain or their custom domain. my concern is about the way app service (serverless systems) verifies domain ownership which is not the case in server based hosting. i'm looking for domain ownership verification at application level. like abc.com makes request, we validate in tenant list, then we allow to access our app. but in app service case, they need domain ownership verification at DNS level. that's what i'm looking to overcome. – Abhimanyu Jul 25 '19 at 11:11
  • if my current server based hosting works well, then why on azure web app we need domain owner verification ? – Abhimanyu Jul 25 '19 at 12:05
  • Azure app service is multi-tenant, it needs a domain verification to verify that you own the custom domain. – Nancy Aug 01 '19 at 02:52