How to Fix Azure Functions Runtime is Unreachable Error

How to Fix Azure Functions Runtime is Unreachable Error

If you are developing or deploying Azure Functions, you may encounter the following error message in the Azure portal:

Error: Azure Functions Runtime is unreachable. Click here for details on storage configuration.

This error indicates that the Functions runtime cannot start, which prevents your functions from running. The most common reason for this error is that the function app has lost access to its storage account, which is required for every function app to operate.

In this post, we will explain the possible causes of this error and how to troubleshoot and fix them.

Storage Account Was Deleted

The first thing to check is whether your storage account still exists. You can find the name of your storage account in your function app’s application settings, under either AzureWebJobsStorage or WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. These settings contain the connection string to your storage account, which looks something like this:

The AccountName part is the name of your storage account. Search for it in the Azure portal to see if it still exists. If it has been deleted, you need to recreate it and replace your storage connection strings in your function app’s application settings. You also need to redeploy your function code, as it is stored in the storage account.

Storage Account Application Settings Were Deleted

If your storage account still exists, but you can’t find the connection string in your function app’s application settings, it means that the settings were deleted or overwritten. This can happen if you are using deployment slots or Azure Resource Manager scripts to set application settings.

The following application settings are required for every function app:

  • AzureWebJobsStorage: The connection string to a general-purpose Azure Storage account.
  • WEBSITE_CONTENTAZUREFILECONNECTIONSTRING: The connection string to an Azure Files share in the same storage account. This is required for Premium plan functions.
  • WEBSITE_CONTENTSHARE: The name of the Azure Files share.

You need to add these settings back to your function app’s application settings, using the correct values from your storage account. For more information, see App settings reference for Azure Functions.

Some guidance on how to manage these settings:

  • Don’t check “slot setting” for any of these settings. If you swap deployment slots, the function app breaks.
  • Don’t modify these settings as part of automated deployments. These settings must be provided and valid at creation time. An automated deployment that doesn’t contain these settings results in a function app that won’t run, even if the settings are added later.

Storage Account Credentials Are Invalid

Another possible cause of the error is that the storage account credentials in your connection strings are invalid. This can happen if you regenerate the storage keys or change the access policies of your storage account.

To fix this, you need to update your connection strings with the new keys or policies. You can find them in your storage account’s “Access keys” or “Shared access signature” blade in the Azure portal. For more information, see Create an Azure Storage account.

Storage Account Is Inaccessible

The last possible cause of the error is that your function app cannot access your storage account due to network restrictions. This can happen if:

  • Your function app is deployed to an App Service Environment (ASE) without the correct network rules to allow traffic to and from the storage account.
  • Your function app or storage account is configured with a virtual network (VNet) integration or service endpoint that blocks or limits access.
  • Your function app or storage account is configured with a firewall or private endpoint that blocks or limits access.

To fix this, you need to review and adjust your network configurations to ensure that your function app and storage account can communicate with each other. For more information, see Networking considerations for an Azure Function App.

Conclusion

The Azure Functions Runtime is unreachable error is a common issue that can prevent your functions from running. It usually means that your function app has lost access to its storage account, which is required for every function app to operate.

To troubleshoot and fix this error, you need to check whether your storage account still exists, whether your storage connection strings are correct and present in your function app’s application settings, whether your storage credentials are valid, and whether your network configurations allow access between your function app and storage account.

We hope this post has helped you resolve this error and get your functions running again. If you have any questions or feedback, please leave a comment below.