问题
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.
回答1:
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 go to Platform features tab and select the Log streaming option under Monitoring:
This will connect a live stream to your functions logging:
Where you should see logs identifying why the function is unable to start
回答2:
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.
回答3:
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
来源:https://stackoverflow.com/questions/49213015/azure-functions-portal-error-the-function-runtime-is-unable-to-start