Azure Functions Portal error - The function runtime is unable to start
Asked Answered
S

3

17

I have a VS 2017 C# developed Azure Function App deployed on the consumption plan using the VS 2017 Publish mechanism. All functions are timer or Service Bus triggered. I see a status of running in the Azure Portal and the functions appear to be working e.g. writing rows to a SQL Azure database, however, I am constantly encountering errors in the Azure Portal when trying to inspect or Monitor the functions e.g. a red error box pops up with the Error :

The function runtime is unable to start. 
Session Id : xxxxxxxx
Timestamp : xxxxxxx

I have looked in the logs and cannot see anything obvious in the log files, I tried deploying to a new App Service and that fixed the issue for a while but it has come back. I have wrapped all my functions in exception handlers and Exception messages to the TraceWriter, all functions are quite fast to execute ~ max 30-40seconds. Occasionally I have also seen errors saying "You do not have permission xxx".

Any help much appreciated.

Sympathetic answered 10/3, 2018 at 19:13 Comment(8)
I would submit a support request. You shouldn't randomly be getting permissions errors. Seems more likely that something is flakey in the back end.Grillroom
Thanks @BrianHauger will do - flakey seems to be a general pattern with Azure functions - for no apparent reason they all stopped running last weekend !Sympathetic
How was this resolved? Please post as an answer if possible.Remex
What was your solution?Otway
I dont know if this is relevant but i was facing same issue and was going crazy with it. I tried with edge browser (was trying with firefox before) and realized that everything is working as expected. Maybe this will help someone in the future.Hypostyle
I'm facing this problem too, it's funny because I moved the code from another function app to this one, while it works perfectly on the original function app, the second one only triggers the timer function once every several hours? despite being designated to run every 5 min. Also, @Otway baby don't hurt me (sorry couldn't help it)Nonrigid
In the end we gave up with Azure Functions. Support was not much help and the entire framework felt very flaky - basically Beta. We switched to using the Azure App Service - you can host batch & scheduled jobs in there. Deployment is not the greatest experience but its reliable.Sympathetic
Did you try this: https://mcmap.net/q/746972/-calling-azure-function-calls-fail-with-quot-function-host-is-not-running-quot?Alpine
M
2

This issue can be caused by numerous things. Really you need to look into the logs to see the underlying issue.

A good debugging option here is to connect to live streaming. So in your function scroll down the left hand pane to Monitoring and select the Log streaming option:

enter image description here

This will connect a live stream to your functions logging:

enter image description here

Where you should see logs identifying why the function is unable to start

Maugre answered 15/1, 2020 at 15:45 Comment(0)
Y
0

For those who are coming across this issue. You can refer the related links to solve your issue.

The function Runtime is unable to start which states:

changed the FUNCTIONS_EXTENSION_VERSION to ~1 and restarted, and it looks like things are at least working initially.

The function runtime is unable to start which states:

Without any further info, I assume you may forget to add MyServiceBusConnection in Application settings on Azure portal, which will cause same error you have seen.If it's not the case, you could go to ttps://.scm.azurewebsites.net/DebugConsole and navigate to D:\home\LogFiles\Application\Functions\Host to see function runtime logs.

York answered 30/11, 2019 at 17:39 Comment(0)
A
0

This issue can also be caused by a Block rule in Access Restrictions. If a Block rule is added for a range of IP addresses that includes yours, you will get this message. You need to either change the Block Rule or add an Allow Rule with your IP Address. You can do this in the portal by navigating to the following

Function App -> Task Name -> Networking -> Access Restrictions

Adolphadolphe answered 7/5, 2020 at 11:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.