Home
%3CLINGO-SUB%20id%3D%22lingo-sub-898506%22%20slang%3D%22en-US%22%3ETroubleshooting%20Azure%20Functions%20Runtime%20Unreachable%20on%20ILB%20ASE%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-898506%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWhen%20working%20with%20Azure%20Function%20Apps%20on%20ILB%20ASE%20(Internal%20Load%20Balancing%20App%20Service%20Environment)%2C%20one%20of%20the%20common%20errors%20we%20see%20is%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%E2%80%9DAzure%20Functions%20Runtime%20is%20unreachable%E2%80%9D.%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20564px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135766iB62439B2D531D687%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAzure%20Functions%20Runtime%20is%20unreachable%20-%20message%20on%20the%20portal%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20this%20error%20occurs%2C%20the%20Azure%20portal%20points%20us%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Ffunctions-recover-storage-account%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Edoc%2C%20which%20lists%20the%20following%20potential%20causes%20for%20this%20error%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EStorage%20Account%20deleted%3C%2FLI%3E%0A%3CLI%3EStorage%20Account%20application%20settings%20deleted%3C%2FLI%3E%0A%3CLI%3EStorage%20Account%20credentials%20invalid%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EStorage%20Account%20Inaccessible%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ENow%2C%20once%20you%E2%80%99ve%20isolated%20that%20the%20Storage%20account%20%26amp%3B%20application%20settings%20exist%2C%20and%20the%20credentials%20for%20it%20are%20in%20place%20%E2%80%93%20you%E2%80%99ll%20need%20to%20further%20investigate%20if%20the%20ILB%20ASE%20Function%20App%20can%20reach%20the%20Storage%20account.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%20things%20first%2C%20ensure%20the%20firewall%20at%20the%20storage%20account%20level%20does%20not%20block%20access%20to%20the%20function%20App%20(having%20a%20firewall%20enabled%20at%20the%20Storage%20Account%20is%20not%20an%20issue%20%E2%80%93%20but%20you'll%20need%20to%20ensure%20it%20does%20not%20block%20the%20function%20app's%20accessing%20to%20it).%20So%20on%20the%20Storage%20Account's%20'Firewalls%20and%20Virtual%20Networks'%20settings%2C%20you%20may%20%3CSTRONG%3Eeither%3C%2FSTRONG%3E%20choose%20%22%3CSTRONG%3EAllow%20access%20from%20All%20networks%3C%2FSTRONG%3E%22%20%3CSTRONG%3Eor%3C%2FSTRONG%3E%20you%20may%20choose%20%22%3CSTRONG%3EAllow%20access%20from%20Selected%20networks%3C%2FSTRONG%3E%22%20and%20configure%20the%20ILB%20ASE's%20VNet%20%26amp%3B%20Subnet%20under%20the%20Virtual%20Networks%20section.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20ensure%20that%20the%20storage%20firewall%20isn't%20blocking%20the%20traffic%2C%20you%20can%20simply%20test%20connectivity%20from%20Function%20App%20using%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EConsole%20tcpping%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20the%20storage%20account%20URL%20as%20follows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26gt%3B%26gt%3Btcpping%20%3CSTORAGEACCOUNTNAME%3E.blob.core.windows.net%3C%2FSTORAGEACCOUNTNAME%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20an%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EILB%20ASE%20Function%20App%3C%2FSTRONG%3E%2C%20tcpping%20could%20sometimes%20lead%20to%20the%20following%20result%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135767i1CCC0FBD71A38A94%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20problem%20here%20is%20not%20quite%20intuitive.%20Capturing%20an%20F12%20network%20trace%20while%20running%20a%20tcpping%20will%20give%20you%20a%20hint%20about%20the%20problem%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135768iAFADEEB25F0E03E0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20simply%20means%20that%20when%20you%20use%20Console%20to%20tcpping%2C%20the%20console%20takes%20commands%20that%20you%20give%20it%2C%20calls%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EKudu%E2%80%99s%20REST%20API%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eusing%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ESCM%20endpoint%3C%2FSTRONG%3E%2C%20and%20then%20displays%20you%20the%20output%20in%20the%20console.%20Hence%2C%20access%20to%20the%20KUDU%20endpoint%20is%20essential.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAlthough%20you%20can%20access%20the%20Azure%20portal%20from%20anywhere%2C%20to%20do%20a%20tcpping%20test%20for%20ILB%20ASE%2C%20you%E2%80%99ll%20need%20a%20machine%20that%20is%20either%20a%20VM%20in%20the%20same%20VNet%20as%20the%20ILB%20ASE%2C%20or%20from%20a%20machine%20has%20VPN%E2%80%99ed%20into%20the%20ILB%20ASE%20VNet%2C%20or%20from%20a%20machine%20that%E2%80%99s%20in%20a%20network%20connected%20to%20the%20ILB%20ASE%20VNet.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CLI%3EFurther%2C%20it%20is%20essential%20that%20your%20machine%20must%20be%20able%20to%20resolve%20to%20both%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EFunction%20App%20hostname%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EFunction%20App%20KUDU%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CLI%3ETo%20do%20this%2C%20you%20can%20either%20update%20the%20existing%20DNS%20Server%20accessible%20within%20that%20network%2C%20or%20simply%20add%20a%20hosts%20file%20entry%20at%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EC%3A%5CWindows%5CSystem32%5Cdrivers%5Cetc%5Chosts%20%3C%2FSTRONG%3Eas%20follows%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20759px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135769i76D044D16DDE3DEA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%2C%20the%20IP%20192.168.252.24%20is%20the%20IP%20of%20my%20ILB%20ASE.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPS%3A%20So%20far%2C%20I%20haven%E2%80%99t%20found%20the%20need%20to%20reboot%20the%20machine%20after%20altering%20the%20hosts%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EI%E2%80%99ve%20seen%20customers%20promptly%20update%20the%20DNS%20to%20resolve%20to%20the%20Function%20App%20name%20but%20not%20to%20the%20KUDU%2C%20and%20this%20leaves%20them%20confused%20about%20the%20Console%20behavior%20during%20a%20tcpping.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOnce%20the%20above%20settings%20are%20in%20place%2C%20the%20Console%20tcpping%20should%20be%20working%20fine%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135770iFC2780BC74E0CBC7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20even%20after%20this%20point%2C%20the%20console%20tcpping%20to%20the%20storage%20endpoint%20fails%2C%20try%20accessing%20the%20KUDU%20site%20of%20the%20function%20App%20from%20the%20same%20machine.%20If%20you%20receive%20a%20%3CSTRONG%3Ecertificate%20mismatch%3C%2FSTRONG%3E%20or%20%3CSTRONG%3EInsecure%3C%2FSTRONG%3E%20message%20on%20the%20browser%2C%20it%20is%20likely%20to%20be%20caused%20due%20to%20the%20%3CSTRONG%3Eself-signed%20certificate%3C%2FSTRONG%3E%20that%20you%20may%20have%20uploaded%20on%20the%20ILB%20ASE.%20Self-signed%20certificate%20is%20accepted%20by%20an%20ILB%20ASE%2C%20but%20it%20is%20your%20responsibility%20to%20ensure%20that%20this%20certificate%20is%20installed%20on%20the%20Trusted%20Root%20CA%20store%20on%20your%20machine.%20If%20your%20machine%20does%20not%20trust%20this%20SSL%20certificate%20during%20an%20SSL%20Handshake%2C%20you%20may%20not%20be%20allowed%20to%20access%20KUDU%20site%20from%20that%20machine.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere's%20a%20snippet%20of%20the%20Trusted%20Root%20CA%20certificates%20folder%20-%20this%20is%20where%20you'll%20need%20to%20install%20the%20ILB%20Certificate.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20350px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135771i951D97F26D0078A2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you've%20done%20this%2C%20the%20KUDU%20site%20access%20should%20work%20and%20tcpping%20to%20storage%20endpoint%20should%20be%20successful%20as%20well.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20also%20brings%20me%20touch%20upon%20a%20new%20change%20that%20has%20been%20introduced%20into%20ILB%20ASE's%20domain%20names.%20Newly%20created%20ILB%20ASEs%20will%20now%20have%20an%20extension%20of%20%3CSTRONG%3E*.appserviceenvironment.net.%20%3C%2FSTRONG%3EThis%20means%20that%20the%20certificate%20for%20this%20domain%20will%20be%20provided%20by%20Azure.%20This%20eliminates%20the%20need%20for%20a%20CA%20approved%20ILB%20Certificate%20or%20the%20need%20to%20install%20ILB's%20self-signed%20certificate%20in%20your%20machine's%20Trusted%20Root%20CA%20store.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20an%20ILB%20ASE%20with%20domain%20%3CSTRONG%3Elittleilb.appserviceenvironment.net%3C%2FSTRONG%3E%20and%20ILB%20IP%20%3CSTRONG%3E10.3.0.11%3C%2FSTRONG%3E%20%2C%20the%20hosts%20file%20now%20looks%20like%20this%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorclipboard_image_4%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20786px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135774iBCD00B28FBC2A1ED%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEarlier%2C%20only%20the%20first%202%20entries%20above%20were%20required.%20You%20need%20to%20add%20the%20last%20DNS%20entry%20(%3CEM%3Efor%20littleilb.appserviceenvironment.net%3C%2FEM%3E)%2C%20otherwise%20the%20access%20to%20KUDU%20will%20fail%20with%20a%20DNS%20resolution%20error%20for%20the%20ILB%20Domain%20%3Asmiling_face_with_smiling_eyes%3A%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-898506%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWhen%20working%20with%20Azure%20Function%20Apps%20on%20ILB%20ASE%20(Internal%20Load%20Balancing%20App%20Service%20Environment)%2C%20one%20of%20the%20common%20errors%20we%20see%20is%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%E2%80%9DAzure%20Functions%20Runtime%20is%20unreachable%E2%80%9D.%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20564px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135766iB62439B2D531D687%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAzure%20Functions%20Runtime%20is%20unreachable%20-%20message%20on%20the%20portal%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E

When working with Azure Function Apps on ILB ASE (Internal Load Balancing App Service Environment), one of the common errors we see is ”Azure Functions Runtime is unreachable”. 

 

image.pngAzure Functions Runtime is unreachable - message on the portal

 

When this error occurs, the Azure portal points us to this doc, which lists the following potential causes for this error:

  1. Storage Account deleted
  2. Storage Account application settings deleted
  3. Storage Account credentials invalid
  4. Storage Account Inaccessible

Now, once you’ve isolated that the Storage account & application settings exist, and the credentials for it are in place – you’ll need to further investigate if the ILB ASE Function App can reach the Storage account.

 

First things first, ensure the firewall at the storage account level does not block access to the function App (having a firewall enabled at the Storage Account is not an issue – but you'll need to ensure it does not block the function app's accessing to it). So on the Storage Account's 'Firewalls and Virtual Networks' settings, you may either choose "Allow access from All networks" or you may choose "Allow access from Selected networks" and configure the ILB ASE's VNet & Subnet under the Virtual Networks section.

 

Once you ensure that the storage firewall isn't blocking the traffic, you can simply test connectivity from Function App using the Console tcpping to the storage account URL as follows.

 

>>tcpping <storageaccountname>.blob.core.windows.net

 

For an ILB ASE Function App, tcpping could sometimes lead to the following result:

 

image.png

 

The problem here is not quite intuitive. Capturing an F12 network trace while running a tcpping will give you a hint about the problem:

 

image.png

 

This simply means that when you use Console to tcpping, the console takes commands that you give it, calls Kudu’s REST API using the SCM endpoint, and then displays you the output in the console. Hence, access to the KUDU endpoint is essential.

  • Although you can access the Azure portal from anywhere, to do a tcpping test for ILB ASE, you’ll need a machine that is either a VM in the same VNet as the ILB ASE, or from a machine has VPN’ed into the ILB ASE VNet, or from a machine that’s in a network connected to the ILB ASE VNet.
  • Further, it is essential that your machine must be able to resolve to both the Function App hostname and Function App KUDU.
  • To do this, you can either update the existing DNS Server accessible within that network, or simply add a hosts file entry at C:\Windows\System32\drivers\etc\hosts as follows:image.png

 

Here, the IP 192.168.252.24 is the IP of my ILB ASE.

 

PS: So far, I haven’t found the need to reboot the machine after altering the hosts file.

 

I’ve seen customers promptly update the DNS to resolve to the Function App name but not to the KUDU, and this leaves them confused about the Console behavior during a tcpping.

 

Once the above settings are in place, the Console tcpping should be working fine:

 

image.png

 

If even after this point, the console tcpping to the storage endpoint fails, try accessing the KUDU site of the function App from the same machine. If you receive a certificate mismatch or Insecure message on the browser, it is likely to be caused due to the self-signed certificate that you may have uploaded on the ILB ASE. Self-signed certificate is accepted by an ILB ASE, but it is your responsibility to ensure that this certificate is installed on the Trusted Root CA store on your machine. If your machine does not trust this SSL certificate during an SSL Handshake, you may not be allowed to access KUDU site from that machine. 

 

Here's a snippet of the Trusted Root CA certificates folder - this is where you'll need to install the ILB Certificate.

 

image.png

 

Once you've done this, the KUDU site access should work and tcpping to storage endpoint should be successful as well.

 

This also brings me touch upon a new change that has been introduced into ILB ASE's domain names. Newly created ILB ASEs will now have an extension of *.appserviceenvironment.net. This means that the certificate for this domain will be provided by Azure. This eliminates the need for a CA approved ILB Certificate or the need to install ILB's self-signed certificate in your machine's Trusted Root CA store.

 

For an ILB ASE with domain littleilb.appserviceenvironment.net and ILB IP 10.3.0.11 , the hosts file now looks like this:

 

image.png

 

Earlier, only the first 2 entries above were required. You need to add the last DNS entry (for littleilb.appserviceenvironment.net), otherwise the access to KUDU will fail with a DNS resolution error for the ILB Domain :smiling_face_with_smiling_eyes: