Raw New Markdown
Generating updated version of doc...
Rendered New Markdown
Generating updated version of doc...
---
title: Monitor Azure IoT Hub Device Provisioning Service
description: Start here to learn how to monitor metrics and logs from the Azure IoT Hub Device Provisioning Service by using Azure Monitor.
ms.date: 08/04/2025
ms.topic: concept-article
author: cwatson-cat
ms.author: cwatson
ms.service: azure-iot-hub
ms.subservice: azure-iot-hub-dps
ms.custom:
- horz-monitor
- subject-monitoring
- sfi-image-nochange
---
# Monitor Azure IoT Hub Device Provisioning Service
[!INCLUDE [horz-monitor-intro](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-intro.md)]
This article describes the monitoring data generated by Azure IoT Hub Device Provisioning Service (DPS). DPS uses Azure Monitor.
[!INCLUDE [horz-monitor-resource-types](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-resource-types.md)]
For more information about the resource types for IoT Hub DPS, see [Azure IoT Hub Device Provisioning Service monitoring data reference](monitor-iot-dps-reference.md).
[!INCLUDE [horz-monitor-data-storage](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-data-storage.md)]
### Collection and routing
Resource logs aren't collected and stored until you create a diagnostic setting and route them to one or more locations.
In Azure portal, you can select **Diagnostic settings** under **Monitoring** on the resource pane of your DPS instance, followed by **Add diagnostic setting** to create diagnostic settings scoped to the logs and platform metrics emitted by your instance.
The following screenshot shows a diagnostic setting for routing to a Log Analytics workspace.
:::image type="content" source="media/monitor-iot-dps/diagnostic-setting.png" alt-text="Diagnostic Settings pane for a DPS instance.":::
See [Diagnostic settings in Azure Monitor](/azure/azure-monitor/platform/diagnostic-settings) for the detailed process for creating a diagnostic setting using the Azure portal, CLI, or PowerShell. When you create a diagnostic setting, you specify which categories of logs to collect. The categories for DPS are listed in the [Resource logs](monitor-iot-dps-reference.md#resource-logs) section of the [Azure IoT Hub Device Provisioning Service monitoring data reference](monitor-iot-dps-reference.md).
[!INCLUDE [horz-monitor-platform-metrics](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-platform-metrics.md)]
For a list of available metrics for IoT Hub DPS, see [IoT Hub DPS monitoring data reference](monitor-iot-dps-reference.md#metrics).
### Using Azure Monitor to view metrics and set up alerts
To view and set up alerts on IoT Hub Device Provisioning Service metrics:
1. Sign in to the [Azure portal](https://portal.azure.com).
1. Browse to your IoT Hub Device Provisioning Service.
1. From the resource pane, under **Monitoring**, select **Metrics**.
1. Select the desired metric. For supported metrics, see [Metrics](monitor-iot-dps-reference.md#metrics).
1. Select desired aggregation method to create a visual view of the metric.
1. To set up an alert of a metric, select **New alert rule** from the top right of the metric. Similarly you can go to the **Alert** panes from the resource menu and select **Create alert rule**.
1. Select the **Condition** tab, then select the desired metric and threshold by following prompts.
To learn more about viewing metrics and setting up alerts on your DPS instance, see [Analyzing metrics](#analyzing-metrics) and [Alerts](#alerts).
### Analyzing metrics
You can analyze metrics for DPS with metrics from other Azure services using metrics explorer by opening **Metrics** from the **Azure Monitor** menu. See [Analyze metrics with Azure Monitor metrics explorer](/azure/azure-monitor/essentials/analyze-metrics) for details on using this tool.
In Azure portal, you can select **Metrics**, under **Monitoring** on the resource menu of your DPS instance, to open metrics explorer scoped, by default, to the platform metrics emitted by your instance:
:::image type="content" source="media/monitor-iot-dps/metrics-portal.png" alt-text="Screenshot showing the metrics explorer page for a DPS instance." border="true":::
For a list of the platform metrics collected for DPS, see [Metrics](monitor-iot-dps-reference.md#metrics). For reference, you can see a list of [all resource metrics supported in Azure Monitor](/azure/azure-monitor/essentials/metrics-supported).
[!INCLUDE [horz-monitor-resource-logs](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-resource-logs.md)]
For the available resource log categories, their associated Log Analytics tables, and the log schemas for IoT Hub DPS, see [IoT Hub DPS monitoring data reference](monitor-iot-dps-reference.md#resource-logs).
[!INCLUDE [horz-monitor-activity-log](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-activity-log.md)]
### Analyzing logs
Data in Azure Monitor Logs is stored in tables where each table has its own set of unique properties.
To route data to Azure Monitor Logs, you must create a diagnostic setting to send resource logs or platform metrics to a Log Analytics workspace. To learn more, see [Collection and routing](#collection-and-routing).
In Azure portal, you can select **Logs** under **Monitoring** on the left-pane of your DPS instance to perform Log Analytics queries scoped, by default, to the logs and metrics collected in Azure Monitor Logs for your instance.
:::image type="content" source="media/monitor-iot-dps/logs-portal.png" alt-text="Screenshot shows the Logs page for a DPS instance.":::
> [!IMPORTANT]
> When you select **Logs** from the DPS menu, Log Analytics is opened with the query scope set to the current DPS instance. This query scope means that log queries only include data from that resource. If you want to run a query that includes data from other DPS instances or data from other Azure services, select **Logs** from the **Azure Monitor** menu. See [Log query scope and time range in Azure Monitor Log Analytics](/azure/azure-monitor/logs/scope) for details.
Run queries against the **AzureDiagnostics** table to see the resource logs collected for the diagnostic settings you created for your DPS instance.
```kusto
AzureDiagnostics
```
All resource logs in Azure Monitor have the same fields followed by service-specific fields. The common schema is outlined in [Azure Monitor resource log schema](/azure/azure-monitor/essentials/resource-logs-schema) The schema for DPS resource logs is found in [Resource logs in the Monitoring Azure IoT Hub Device Provisioning Service data reference](monitor-iot-dps-reference.md#resource-logs).
### Using Log Analytics to view and resolve errors
1. Sign in to the [Azure portal](https://portal.azure.com).
1. Browse to your Device Provisioning Service.
1. Select **Diagnostics settings**.
1. Select **Add diagnostic setting**.
1. Configure the desired logs to be collected. For supported categories, see [Resource logs](monitor-iot-dps-reference.md#resource-logs).
1. Select the box **Send to Log Analytics** ([see pricing](https://azure.microsoft.com/pricing/details/log-analytics/)) and save.
1. Go to **Logs** tab in the Azure portal under Device Provisioning Service resource.
1. Write **AzureDiagnostics** as a query and select **Run** to view recent events.
1. If there are results, look for `OperationName`, `ResultType`, `ResultSignature`, and `ResultDescription` (error message) to get more detail on the error.
[!INCLUDE [horz-monitor-analyze-data](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-analyze-data.md)]
[!INCLUDE [horz-monitor-external-tools](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-external-tools.md)]
[!INCLUDE [horz-monitor-kusto-queries](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-kusto-queries.md)]
[!INCLUDE [horz-monitor-alerts](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-alerts.md)]
### IoT Hub Device Provisioning Service alert rules
You can set alerts for any metric, log entry, or activity log entry listed in the [IoT Hub DPS monitoring data reference](monitor-iot-dps-reference.md).
[!INCLUDE [horz-monitor-advisor-recommendations](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-advisor-recommendations.md)]
## Related content
- See [Azure IoT Hub Device Provisioning Service monitoring data reference](monitor-iot-dps-reference.md) for a reference of the metrics, logs, and other important values created for IoT Hub Device Provisioning Service.
- See [Monitoring Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource) for general details on monitoring Azure resources.