Accessing Azure Functions on ILB ASEs in the Azure Portal
There are two versions of ILB ASEs, one where a custom domain must be provided with a certificate and the newer version that is created with the .appserviceenvrionment.net domain (default configuration after May 2019 unless you specify an older version of the API). If you have an ASE that has the .appserviceenvironment.net domain you will only need to make sure steps 1, 2, 3 are configured otherwise check the following configurations to make sure the functionality works as expected.
A common error when the connectivity is setup incorrectly is the “Azure Function Runtime is unreachable” message. The steps below cover the common misconfigurations
- Make sure the user has reader access on the ASE – unfortunately this is currently required. With reader role on the ASE the user cannot make any changes to the ASE itself. This requirement may change in the future (blog written July 2019).
- The user viewing the function app in the portal needs to be connected to the same VNET that the ILB ASE exists in whether that’s with a jumpbox as described here or through some sort of VPN (P2S or S2S) or Express route or Jumpbox (VM on the subnet).
- DNS needs to be configured: whether from the DNS servers configured on the actual VNET or using the hostfile change (Navigate to C:\windows\system32\drivers\etc\hosts). The document below covers the newer version of ILB ASEs with the appserverviceevenvironment.net domain.
If you are using the ILB domain type with your own custom domain you’ll need the following entries using contoso.com as the example of your ILB ASE domain:
Here’s the typical error you will see if DNS is not correctly configured for both URLs mentioned above.
- Certs – If the certificate is signed by a public trusted CA you can skip this step. Otherwise you need to make sure the certificate is trusted by your local machine. (This is not needed if the domain of your ASE has appserviceenvironment.net).
- Navigate to the root of the site ie myfunctionappname.contoso.com and make sure you get the Function App Splash screen. If you get an error saying the certificate is not trusted go ahead and ignore the warning which will trust the certificate. This works best with Chrome, IE and Edge have more strict policies.
- Navigate to Kudu ie functionappname.scm.contoso.com and skipping the certificate message as mentioned in number three (Using the Advanced option if you are using Chrome).
- When you get the credential prompt log in using the publishing profile downloadable from the Azure Portal -> Function App
Username = $functionappname
Password = longstringvalue
At the point you “should” be able to see the functionality in the portal working as expected. If you don’t I’d recommend creating a support case to investigate what additional steps are needed. In most scenarios this should get you up and running. If you are unable to deploy using something like Azure Dev Ops check out the blog below which shows how to set up the private agent to deploy to the function app.