Raw New Markdown
Generating updated version of doc...
Rendered New Markdown
Generating updated version of doc...
---
title: Monitor Microsoft Dev Box and Diagnostic Data Logs
titleSuffix: Microsoft Dev Box
description: Start here to learn how to monitor Dev Box and explore how to use Azure diagnostic logs to see an audit history for your dev center.
services: dev-box
ms.service: dev-box
ms.topic: how-to
author: delvissantos
ms.author: delvissantos
ms.custom: horz-monitor, subject-monitoring
ms.date: 08/29/2025
#Customer intent: As a Dev Box administrator, I want to monitor Dev Boxes so I can ensure my applications and business processes are running smoothly.
---
# Monitor Microsoft Dev Box
When you have critical applications and business processes relying on Azure resources, you want to monitor those resources for their availability, performance, and operation.
This article describes the monitoring data generated by Microsoft Dev Box. Microsoft Dev Box uses [Azure Monitor](/azure/azure-monitor/fundamentals/overview). If you're unfamiliar with the features of Azure Monitor common to all Azure services that use it, read [Monitor Azure resources with Azure Monitor](/azure/azure-monitor/platform/monitor-azure-resource).
## Prerequisites
- To enable logging with Azure Storage, you need a storage account in the same region as your dev center. For more information, see [Create an Azure Storage account](../storage/common/storage-account-create.md?tabs=azure-portal&toc=%2fazure%2fstorage%2fblobs%2ftoc.json).
- To send Log Analytics for the logs, you need a log analytics workspace. For more information, see [Create a Log Analytics workspace in the Azure portal](/azure/azure-monitor/logs/quick-create-workspace).
## Explore data collection and routing for Dev Box
Dev Box collects the same kinds of monitoring data as other Azure resources that are described in [Monitor data from Azure resources](/azure/azure-monitor/platform/monitor-azure-resource#monitoring-data-from-Azure-resources).
- Platform metrics and the Activity log are collected and stored automatically, but this data can be routed to other locations by using a diagnostic setting.
- Resource Logs aren't collected and stored until you create a diagnostic setting and route them to one or more locations.
For more information on the metrics and logs metrics created by Dev Box, see [Monitoring Dev Box data reference](monitor-dev-box-reference.md).
For the detailed process for creating a diagnostic setting using the Azure portal, CLI, or PowerShell, see [Create diagnostic setting to collect platform logs and metrics in Azure](/azure/azure-monitor/platform/diagnostic-settings). When you create a diagnostic setting, you specify which categories of logs to collect. The categories for *Dev box* are listed in [Microsoft Dev Box monitoring data reference](monitor-dev-box-reference.md#resource-logs).
## Configure Azure diagnostic logs for a dev center
With Azure diagnostic logs for DevCenter, you can view audit logs for data plane operations in your dev center. The logs can be routed to an Azure Storage account or Log Analytics workspace. This feature is available on all dev centers.
Diagnostics logs allow you to export basic usage information from your dev center to different sources so that you can consume them in a customized way. The data plane audit logs expose information around CRUD operations for dev boxes within your dev center. Including, for example, start and stop commands executed on dev boxes. Some sample ways you can choose to export this data include:
- Export data to Blob storage
- Export data to CSV (comma separated value) format
- Export data to Azure Monitor logs and view and query data in your own Log Analytics workspace
To learn more about the different types of logs available for dev centers, see [Monitor Dev Box data reference](monitor-dev-box-reference.md).
## Enable logging with the Azure portal
Follow these steps to enable logging for your Azure DevCenter resource:
1. Sign in to the [Azure portal](https://portal.azure.com).
1. In the Azure portal, navigate to your dev center.
1. In the **Monitoring** section, select **Diagnostics settings**.
1. Select **Add diagnostic setting**:
:::image type="content" source="media/how-to-monitor-dev-box/add-diagnostic-setting.png" alt-text="Screenshot that shows how to select the Add diagnostic setting to monitor a dev center.":::
The **Diagnostic Setting** dialog opens:
:::image type="content" source="media/how-to-monitor-dev-box/diagnostic-setting-dialog.png" alt-text="Screenshot of the Diagnostic Setting dialog.":::
### Enable logging with Azure Storage
To use a storage account to store the logs, follow these steps.
> [!NOTE]
> The following procedure requires an [Azure Storage account](../storage/common/storage-account-create.md?tabs=azure-portal&toc=%2fazure%2fstorage%2fblobs%2ftoc.json) in the same region as your dev center.
1. For the **Diagnostic setting name** field, enter a name for your diagnostic log settings.
1. Under **Logs**, select **Dataplane audit logs**.
1. Under **Destination details**, select **Archive to a storage account**.
1. Select the **Subscription** and **Storage account** for the logs.
1. Select **Save**.
### Send to Log Analytics
To use Log Analytics for the logs, follow these steps:
> [!NOTE]
> The following procedure requires a [Log Analytics workspace](/azure/azure-monitor/logs/quick-create-workspace).
1. For the **Diagnostic setting name** field, enter a name for your diagnostic log settings.
1. Under **Logs**, select **Dataplane audit logs**.
1. Under **Destination details**, select **Send to Log Analytics workspace**.
1. Select the **Subscription** and **Log Analytics workspace** for the logs.
1. Select **Save**.
### Enable logging with PowerShell
The following example shows how to enable diagnostic logs by using Azure PowerShell Cmdlets.
[!INCLUDE [updated-for-az](~/reusable-content/ce-skilling/azure/includes/updated-for-az.md)]
#### Enable diagnostic logs in a storage account
1. Sign in to Azure PowerShell:
```azurepowershell-interactive
Connect-AzAccount
```
1. Enable Diagnostic Logs in a Storage account by using the following commands. Replace the `<placeholder>` variables with your values:
```azurepowershell-interactive
$rg = <your-resource-group-name>
$devcenterid = <your-devcenter-ARM-resource-id>
$storageacctid = <your-storage-account-resource-id>
$diagname = <your-diagnostic-setting-name>
$log = New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category DataplaneAuditEvent -RetentionPolicyDay 7 -RetentionPolicyEnabled $true
New-AzDiagnosticSetting -Name $diagname -ResourceId $devcenterid -StorageAccountId $storageacctid -Log $log
```
#### Enable diagnostics logs for Log Analytics workspace
1. Sign in to Azure PowerShell:
```azurepowershell-interactive
Connect-AzAccount
```
1. Enable Diagnostic Logs for a Log Analytics workspace by using the following commands. Replace the `<placeholder>` variables with your values:
```azurepowershell-interactive
$rg = <your-resource-group-name>
$devcenterid = <your-devcenter-ARM-resource-id>
$workspaceid = <your-log-analytics-workspace-resource-id>
$diagname = <your-diagnostic-setting-name>
$log = New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category DataplaneAuditEvent -RetentionPolicyDay 7 -RetentionPolicyEnabled $true
New-AzDiagnosticSetting -Name $diagname -ResourceId $devcenterid -WorkspaceId $workspaceid -Log $log
```
## Analyze diagnostic logs
This section describes existing tables for DevCenter diagnostic logs and how to query them.
All resource logs in Azure Monitor have the same fields followed by service-specific fields. The common schema is outlined in [Common and service-specific schemas for Azure resource logs](/azure/azure-monitor/platform/resource-logs-schema#top-level-common-schema).
DevCenter stores data in the following tables:
| Table | Description |
|---|---|
| **DevCenterDiagnosticLogs** | Stores data plane request/response information on dev box or environments within the dev center. |
| **DevCenterResourceOperationLogs** | Contains operation logs pertaining to DevCenter resources, including information around resource health status changes. |
| **DevCenterBillingEventLogs** | Lists billing event related to DevCenter resources. This log contains information about the quantity and unit charged per meter. |
## Explore sample Kusto queries
After you enable diagnostic settings on your dev center, you should be able to view audit logs for the tables within a log analytics workspace.
Here are some queries you can enter into Log search to help your monitor your dev boxes.
To query for all data plane logs from DevCenter:
```kusto
DevCenterDiagnosticLogs
```
To query for a filtered list of data plane logs, specific to a single devbox:
```kusto
DevCenterDiagnosticLogs
| where TargetResourceId contains "<devbox-name>"
```
To generate a chart for data plane logs, grouped by operation result status:
```kusto
DevCenterDiagnosticLogs
| summarize count() by OperationResult
| render piechart
```
These examples are just a small sample of the rich queries that can be performed in Monitor by using the Kusto Query Language. For more information, see [Tutorial: Learn common operators](/kusto/query/tutorials/learn-common-operators?view=azure-data-explorer&preserve-view=true&pivots=azuremonitor).
## Related content
- [Monitor Dev Box](monitor-dev-box.md)
- [Azure Monitor data sources and data collection methods](/azure/azure-monitor/fundamentals/data-sources)
- [Log queries in Azure Monitor](/azure/azure-monitor/logs/log-query-overview)