@Igor
Thank you for reaching out and sorry for the delayed response here.
Based on your statement above.
I have a Static Web Page and a few Function Apps. I want to route my traffic as:
- mydomain.com -> static web app
- mydomain.com/api/function_one -> Function App "One"
- mydomain.com/api/function_two -> Function App "Two"
I understand the example domain mydomain.com
is procured as a domain with CloudFlare Registrar.
I this case I think you can configure Azure Front Door with static web app
, Function App "One"
and
Function App "Two"
as the origin and then use routing rules in Azure Front Door to establish the routes in your statement above.
A route in Azure Front Door defines how traffic gets handled when the incoming request arrives at the Azure Front Door edge. You can find more information in the articles below.
https://video2.skills-academy.com/en-us/azure/frontdoor/front-door-route-matching?pivots=front-door-standard-premium
https://video2.skills-academy.com/en-us/azure/frontdoor/front-door-routing-architecture?pivots=front-door-standard-premium
How can I achieve the same setup with Azure? I'm trying to use Azure DNS; Azure Storage & FrontDoor for web-page; Azure Function Apps & Azure API Management for serverless functions;
Is the only way to do it is to register each URL with a unique CNAME on Cloudflare? i.e. one CNAME for each Function App & Front Door?
Now since the Web App and Function Apps will be added as origin to the Front Door, so will need to register the CNAME of the Front Door with Cloudflare.
In order to do this, you can follow this documentation to add a custom domain on your Azure Front Door.
When you add a domain to your Azure Front Door profile, you configure two records in your DNS server:
- A DNS TXT record, which is required to validate ownership of your domain name. For more information on the DNS TXT records, see Domain validation.
- A DNS CNAME record, which controls the flow of internet traffic to Azure Front Door.
In this case when you add the domain mydomain.com
to Azure Front Door as a custom domain name then it will resolve to Azure Front Door over the internet using the CNAME and Azure Front Door based on the routing rules configured will forward the traffic to respective web apps and functions apps.
In your statement above you have also mentioned about Azure APIM, depending on your architecture you can go over this tutorial to Configure Front Door Standard/Premium in front of Azure API Management.
Hope this helps! Please let me know if you have any additional questions. Thank you!
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.