Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a custom domain with an Azure Function app

I have an Azure Function app running on dynamic pricing and am trying to set up a custom domain.

I have added and verified the domain and setup the CNAME record accordingly. The custom domain shows up correctly as the "URL" when I view the App Service settings in the Azure portal. If I try to use this domain, however (to access an HTTP trigger function), I am returned with "Error 404 - Web app not found."

When I look at the Function URL in the portal, it still shows the x.azurewebsites.net domain, not the custom domain I have added. Is there anything additional I need to do to get Functions working with a custom domain?

like image 354
Adam Stiskala Avatar asked May 29 '16 22:05

Adam Stiskala


People also ask

Can you register domains with Azure?

Azure DNS doesn't currently support the option to buy domain names. To buy domains, you must use a third-party domain name registrar. Azure DNS allows you to host a DNS zone and manage the DNS records for a domain in Azure.

How do I create a custom Azure DNS server?

Access the management portal and go in the section NETWORKS > {Your Network Name} > CONFIGURE > DNS servers. Add the name and an IP to it. Now, deploy a new VM inside the Virtual Network and configure its IP to the same IP you have defined inside the portal. You can easily do it through PowerShell.


2 Answers

Copying from my answer on MSDN forum:

Indeed, custom domains are not yet supported for Dynamic Function plans. This support will come a bit later (no clear ETA to share at this point).

like image 178
David Ebbo Avatar answered Oct 03 '22 10:10

David Ebbo


Thanks to @David Ebbo I figured out how to do this for a Function App running in a consumption plan (e.g. Y1). Here is the MSFT docs article:

https://docs.microsoft.com/en-us/azure/app-service/scripts/cli-configure-custom-domain

It seems that it cannot currently be done via the Azure Portal GUI and instead you must use Azure CLI to run the commands. It's easy to do directly from that article page using the "Try It" link to the embedded azCLI.

like image 43
Deron Dilger Avatar answered Oct 03 '22 10:10

Deron Dilger