Azure Functions | Unable to retrieve Functions keys | The function runtime is unable to start | Function host is not running
Issue:
You might face one of the following exceptions while working with Azure functions.
· Unable to retrieve Functions Keys
· We are not able to retrieve the keys for function
· The function runtime is unable to start.
· Function host is not running.
· Internal Server error.
· Service Unavailable.
Analysis:
When you create an Azure functions then few keys are created with it.
You can check those keys in “Function app Settings” section.
Same keys can also be checked in the managed section.
These keys are known as authorization keys. Refer below URL for more info
The most probable root cause of these exception is, “MISSING HOST KEYS”.
You can check below screen shot where I deleted the host keys and I started getting these exception messages.
These messages indicate REST API failure which retrieve host keys.
Solution:
The quickest way to resolve this issue is to RESET/CREATE these keys.
· Go to KUDU https://<yourapp>.scm.AzureWebsites.net
· Debug Console-> CMD.
· Go to the secret keys path d:\home\data\functions\secrets
· Download host.json file for backup and delete host.json file
· Go to Process Explorer from top menu
· Right click on the w3wp.exe process -> Kill
· RESTART your function app.
· This action will create host.json and will create new keys.
Now, when you will open your function app again, you will observe that those keys are created, and exception message is disappeared.
Hope this helps. Please share your feedback.
Thanks. This helps and resolved my issue
ReplyDelete