An Azure service that provides an event-driven serverless compute platform.
Hi @Tomasz Pycia ,
Thanks for reaching out to Microsoft Q&A.
Azure Functions running on Linux with the Elastic/Flexible Consumption plan do not fully support some portal diagnostic features, including the Diagnostic Tool and certain log streaming capabilities. This is because the underlying sandbox environment on Linux hosts in this plan is more restricted compared to Windows or Premium plans.
The portal tries to load diagnostic information via Kudu/SCM APIs, which are either limited or not fully available for Linux in Flex Consumption. Hence, you just see a generic “Sorry, an error occurred” message.
Here are a few workarounds to get the same kind of insights:
- Diagnostics for Flex Consumption apps are accessed through the “Diagnose and solve problems” blade in the Function App:
- Open your Function App in the Azure portal=>Select Diagnose and solve problems from the left-hand menu.
- Use one of the supported workflows for Flex Consumption apps:
- Function App Down or Reporting Errors (Preview): Checks startup, runtime, configuration, and execution health issues.
- Flex Consumption Deployment: Reviews deployment history, package status, and related recommendations.
- Flex Consumption Quota: Monitors regional subscription memory/core usage and related quotas.
- Enable Application Insights
- Make sure you’ve set
APPLICATIONINSIGHTS_CONNECTION_STRING(orAPPINSIGHTS_INSTRUMENTATIONKEY) in your Function App settings. - Use the Logs (Analytics) blade in the portal to run Kusto queries (requests, traces, exceptions) against your function.
- Make sure you’ve set
- Use Azure Monitor Metrics Explorer
- In Flex Consumption on Linux you get the
FunctionsExecutionCountandFunctionsExecutionUnitsmetrics. - Open Metrics Explorer in Azure Monitor to chart those metrics over time.
- In Flex Consumption on Linux you get the
- Stream logs in real time
- In the portal go to your Function App > Streaming logs (Platform features > Log stream).
- Or from your dev box use the Azure Functions Core Tools:
func azure functionapp logstream --name <YourAppName> --resource-group <YourRG>
References:
Hope this helps!
If the resolution was helpful, kindly take a moment to click on and click on Yes for was this answer helpful. And, if you have any further query do let us know.