Hundreds of Azure Functions under common domain - azure

I have a deployment of several hundred Azure Functions that I would like to have accessible under my domain. I can see in the Azure Portal that for each function, I can individually hook it up with a custom domain by adding an A and TXT record to point to that specific function. This works great but does not scale at all.
What I would like to achieve is that I can freely start and stop functions (named let's say a,b,c,d etc.) and have them automatically accessible under a subdomain of the domain I have. Like for example: a.my.domain, b.my.domain, etc. From what I see I would have to add A and TXT records for each a.my.domain, b.my.domain...
Is there any way I can solve it in some generic fashion? Like adding A and TXT record for just my.domain and have the Azure do the magic to route {name}.my.domain to function named {name}?
Thanks in advance for any help.

As per my understanding, multiple function app domains should be under a common domain.
For this, Application Gateway helps to configure multiple domains in single domain with the help of Path based routing concept.
You can configure the different Azure Function Apps URLs/domains with different paths under the same domain name which redirects every azure function app domain to its respective site.
As #Skin Suggested to look into APIM:
From the Domain Registrar, Configure the APIM Gateway IP Address with the A record or any other Azure DNS Server.
References:
MS Q&A #1065676 for more information provided by #MayankBaragali-MSFT
MS Tutorial for configuring the multiple function apps under one domain (APIM).

Related

Azure storage containers and routing from wildcard root domain

I have a storage account in Azure with a container named clients. Inside the container I have folders for various clients, i.e:
mysite.blob.core.windows.net/clients/one
mysite.blob.core.windows.net/clients/two
I also have my own site set up as a static website, i.e:
mysite.z33.web.core.windows.net
On top of that, I have a custom domain: mysite.com. Is it possible, using Azure CDN or Azure Front Door/Application Gateway to route traffic like so (in a way that doesn't require further configuration per client):
one.mysite.com -> mysite.blob.core.windows.net/clients/one
two.mysite.com -> mysite.blob.core.windows.net/clients/two
mysite.com -> mysite.z33.web.core.windows.net
So far I have tried doing this with Azure CDN but I don't think it's possible, it has a rules engine that seems quite flexible but I don't think they support wildcard domains, unless I'm (hopefully) wrong. Ideally I'd like it to be done in some sort of wildcard way, so that is maps:
<client>.mysite.com -> mysite.blob.core.windows.net/clients/<client>
I don't really want to have to add more rules or configuration every time I have a new client.
In fact, you could use an alias record to add a root domain as the custom domains in your CDN endpoints if you use Azure CDN to host your DNS zone. In this case, you need to set up multiple endpoints for each custom domain. See this document for more details. But Pointing a zone apex to CDN endpoints for Azure CDN from Akamai is currently not supported. You can use other CDN price tier.
If you use the Azure application gateway, you may configure multiple sites listener to receive different incoming host traffic and use path-based URL rules to route the traffic to the backends. It looks like a complex configuration and hard to troubleshoot the app gw related issue.
The azure front door should also do this trick, it supports onboard a root domain on your Front Door also allows wildcard domains. The route path is also easy to configure. See path matching for more details.
Hope this information could help you.

Adding custom domain names to an Azure webapp in a Nested traffic manager profile

I want to have the following setup in Azure.
* Main Traffic manager
        - WebAppA (West Europe)
        - Nested Endpoint
                 * WebAppB (West Europe)
WebappA has a custom domain name linked with a CName to the main traffic manager.
Now WebAppB also needs this custom domain name, but I'm not possible to add this.
I receive the message "Hostname is already being used in the following App WebAppA".
What I want to achieve is to have 2 WebApps running in the same datacenter with a Traffic manager on top to have better control control over the setup while doing BlueGreen deployments.
We currently have a setup spread over 2 datacenters, but we experience a lot of latency while hopping to the SQL server in WestEurope from UKSouth?
Is there any setup what can make this work?
I would suggest you to raise a support ticket where MS engineers can force add the Custom Domain if you are able to prove your Domain ownership.
The error which you are getting has nothing to do with the Traffic Manager Nested configuration. Since you have added the Custom Domain to the WebApp A, you are not able to add it to the Web App B due to some validation check.
There are probably two methods.
You could associate the same hostname to multiple web apps regardless of subscription (or even AAD tenant!) using the awverify method of validating domains. That is to create two TXT records for your two web app services.
Hostname — awverify.targethostname.yourdomain.com
Set type = TXT
value = <yourwebappname>.azurewebsites.net
TTL — short. Like seconds or minutes.
You could get more details from this blog: Azure Traffic Manager with Web Apps in different subscriptions.
Another option is to assign the same hostname to Web Apps in different app service plans. Bear in mind that if you're using IP addresses/A records in your DNS, you'd need both web apps to have different IP addresses for the DNS to be able to differentiate between your web apps. Read the details in the the SO answer.

Azure App Service accept all domain names

Is it possible to have an App Service respond to all domain names that it receives? I would really like to be able to deploy to an App Service plan, rather than a VM. Note I am not trying to do wildcard subdomains - these require adding them through the Azure console. I am trying to accept any domain name that the app service receives. Adding and verifying each domain is not practical.
I have a multitenant app, so this is really important to me so that customers can use their own domain names.
I've tried adding the domain * and ., but it fails validation.
I don't think you can do this because Azure requires validation of domain ownership by adding specific records to DNS. Here is a discussion as to why they do that.
The best you might be able to do is to automate or script the binding, but even then you would need assistance from your third party partners/customers to verify their DNS ownership.
An alternative would be to transfer your DNS to Azure and use subdomains. I know you've said you're not looking at that solution, but using the Azure DNS offering would allow you to fully script out the onboarding process for a new customer.
Could you ensure that the changes to your DNS settings have been confirmed and validated from your DNS provider’s end. For certain providers, such as GoDaddy, changes to DNS records don't become effective until you select a separate Save Changes link.
For more details, refer "Map an existing custom DNS name to Azure Web Apps".
You may refer MSDN thread, which addresses similar issue.

How to perform third party Domain setup on Microsoft Azure?

I have set up AD Azure and since I have a domain from a third party hosting provider(re-seller) i needed to assign MX and TX values in order to verify the Domain.
Re-seller refused to manually setup the records in the domain registrar and provided a free shared hosting package for me to setup those values in the control panel which i did with no effort and successfully verified the domain name within Azure portal.
I had made all the wire up within azure portal to use the domain i had verified but when i browse y.com i get responses from the Re-seller server instead of Azure.
The only thing i had left to do is to change the NS records which the Re-Seller refused to do so - so far.
Please provide some details of how the request travels in this kind of Domain name setup and what measures should i take in order to use my domain in Azure hosted environment?
To bind a custom domain for your Azure app, you need to do three main steps to map the custom domain to your app( more detail refer here):
And if you also want to add a custom domain for Azure AD, you can refer this document.

Custom domains for Azure Web App

I'm trying to set up multiple custom domains for our web app.
Basically it's a dynamic website that checks the url and displays specific content based on the customer determined by the url.
Let's say we have contoso.com our customer.
In order for the website to work we need and A record poiting to our server ip provided by Azure and a TXT record poiting to mywebsite.azurewebsites.net.
But this is not enough, we also have to go to Azure portal, and add the Hostname there, 'contoso.com', otherwise our customer will get a 404 error.
My question is, can we tell Azure, our web app, to accept any hostname, not only the ones defined in the Azure portal?
I know we can add hostnames via powershell or rest api, but we have thousands of customers and is just too much to maintain.
No that's not possible. Just think, you can have multiple sites running on the same VM and they'll all have the same IP address. The service requires each site to register it's hostname ahead of time so that when a request comes in, the service knows which site the request should be routed to.

Resources