| title | Monitor Azure Functions |
|---|---|
| description | Start here to learn how to monitor Azure Functions. |
| ms.date | 12/08/2025 |
| ms.custom | horz-monitor |
| ms.topic | concept-article |
| ms.service | azure-functions |
[!INCLUDE horz-monitor-intro]
[!INCLUDE horz-monitor-insights]
Azure Functions has built-in integration with Application Insights to monitor function executions. For detailed information about how to integrate, configure, and use Application Insights to monitor Azure Functions, see the following articles:
- Monitor executions in Azure Functions
- Configure monitoring for Azure Functions
- Analyze Azure Functions telemetry in Application Insights
- Monitor Azure Functions with Application Insights
[!INCLUDE horz-monitor-resource-types] For more information about the resource types for Azure Functions, see Azure Functions monitoring data reference.
[!INCLUDE horz-monitor-data-storage]
[!INCLUDE horz-monitor-platform-metrics] For a list of available metrics for Azure Functions, see Azure Functions monitoring data reference.
Note
App Service metrics (Microsoft.Web/sites) aren't available when your function app runs on Linux in a Consumption plan.
[!INCLUDE horz-monitor-resource-logs]
Azure Functions integrates with Azure Monitor Logs to monitor functions. For detailed instructions on how to set up diagnostic settings to configure and route resource logs, see Create diagnostic settings in Azure Monitor.
:::image type="content" source="media/monitor-functions/choose-table.png" alt-text="Screenshot of adding a diagnostic setting for Azure Functions.":::
For the available resource log categories, their associated Log Analytics tables, and the logs schemas for Azure Functions, see Azure Functions monitoring data reference.
Important
Application Insights processes telemetry in batches. When a batch payload is too large or contains unescaped special characters, log entries might be dropped. To help prevent data loss:
- Limit individual log messages to 10,000 characters, especially when you log large XML or JSON payloads.
- Escape special characters in log data.
- Summarize or truncate large payloads before you log them.
[!INCLUDE horz-monitor-activity-log]
Azure Functions also offers the ability to collect more than Azure Monitor resource logs. To view a near real time stream of application log files generated by your function running in Azure, you can connect to Application Insights and use Live Metrics Stream. Or, you can use the App Service platform built-in log streaming to view a stream of application log files. For more information, see Enable streaming execution logs in Azure Functions.
[!INCLUDE horz-monitor-analyze-data]
[!INCLUDE horz-monitor-external-tools]
Functions provides these two dynamic scale plans that support serverless hosting:
[!INCLUDE functions-consumption-plans-compare-tabs]
[!INCLUDE functions-monitor-metrics-consumption]
To learn more about estimating costs for these plans, see Estimating consumption plan costs.
Azure Functions writes all logs to the FunctionAppLogs table under LogManagement in the Log Analytics workspace where you send the data. You can use Kusto queries to query the data.
:::image type="content" source="media/monitor-functions/querying.png" alt-text="Screenshot of the Query window for Azure Functions in a Log Analytics workspace.":::
[!INCLUDE horz-monitor-kusto-queries]
The following sample queries can help you monitor all your functions app logs:
FunctionAppLogs
| order by TimeGenerated desc
FunctionAppLogs
| project TimeGenerated, HostInstanceId, Message, _ResourceId
| order by TimeGenerated descThe following sample query can help you monitor a specific functions app's logs:
FunctionAppLogs
| where FunctionName == "<Function name>"
| order by TimeGenerated descThe following sample query can help you monitor exceptions on all your functions app logs:
FunctionAppLogs
| where ExceptionDetails != ""
| order by TimeGenerated asc
The following sample query can help you monitor exceptions on a specific functions app's logs:
FunctionAppLogs
| where ExceptionDetails != ""
| where FunctionName == "<Function name>"
| order by TimeGenerated desc[!INCLUDE horz-monitor-alerts]
[!INCLUDE horz-monitor-insights-alerts]
The following table lists common and recommended alert rules for Azure Functions. These alerts are just recommendations. You can set alerts for any metric, log entry, or activity log entry listed in the Monitoring data reference for Azure Functions.
| Alert type | Condition | Description |
|---|---|---|
| Metric | Average connections | When number of connections exceed a set value |
| Metric | HTTP 404 | When HTTP 404 responses exceed a set value |
| Metric | HTTP Server Errors | When HTTP 5xx errors exceed a set value |
| Activity Log | Create or update function app | When app is created or updated |
| Activity Log | Delete function app | When app is deleted |
| Activity Log | Restart function app | When app is restarted |
| Activity Log | Stop function app | When app is stopped |
[!INCLUDE horz-monitor-advisor-recommendations]
For more information about monitoring Azure Functions, see the following articles:
- Azure Functions monitoring data reference provides a reference of the metrics, logs, and other important values available for your function app.
- Monitor Azure resources with Azure Monitor gives general details about monitoring Azure resources.
- Monitor executions in Azure Functions details how to monitor a function app.
- How to configure monitoring for Azure Functions describes how to configure monitoring.
- Analyze Azure Functions telemetry in Application Insights describes how to view and query the data being collected from a function app.