|
| 1 | +--- |
| 2 | +title: Enable diagnostic settings for Microsoft Discovery resources |
| 3 | +description: Learn how to configure Azure Monitor diagnostic settings to collect platform logs from Microsoft Discovery workspaces, bookshelves, and supercomputers. |
| 4 | +author: anzaman |
| 5 | +ms.author: alzam |
| 6 | +ms.service: azure |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 04/10/2026 |
| 9 | +--- |
| 10 | + |
| 11 | +# Enable diagnostic settings for Microsoft Discovery resources |
| 12 | + |
| 13 | +When you have critical applications and business processes relying on Microsoft Discovery, you want to monitor those resources for availability, performance, and compliance. This article describes how to configure Azure Monitor diagnostic settings to collect platform logs from Microsoft Discovery resources. |
| 14 | + |
| 15 | +Microsoft Discovery 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, see [Monitor Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource). |
| 16 | + |
| 17 | +## Supported resource types and destinations |
| 18 | + |
| 19 | +You can enable diagnostic settings on the following Microsoft Discovery resource types: |
| 20 | + |
| 21 | +| Resource type | Resource provider path | |
| 22 | +| --- | --- | |
| 23 | +| Workspace | `Microsoft.Discovery/workspaces` | |
| 24 | +| Bookshelf | `Microsoft.Discovery/bookshelves` | |
| 25 | +| Supercomputer | `Microsoft.Discovery/supercomputers` | |
| 26 | + |
| 27 | +Currently, the following destination is supported for diagnostic log export: |
| 28 | + |
| 29 | +- **Azure Storage Account** — Archive logs for auditing, troubleshooting, and compliance. |
| 30 | + |
| 31 | +## Prerequisites |
| 32 | + |
| 33 | +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/). |
| 34 | +- The [Azure Az PowerShell module](/powershell/azure/install-azure-powershell) installed. |
| 35 | +- **Monitoring Contributor** role or higher on the Discovery resource. |
| 36 | +- **Storage Account Contributor** role or higher on the destination storage account. |
| 37 | +- An [Azure Storage account](/azure/storage/common/storage-account-create) to receive the diagnostic logs. |
| 38 | + |
| 39 | +## Connect to Azure |
| 40 | + |
| 41 | +Sign in to Azure PowerShell and set the subscription context: |
| 42 | + |
| 43 | +```azurepowershell |
| 44 | +Connect-AzAccount |
| 45 | +Set-AzContext -SubscriptionId "<subscription-id>" |
| 46 | +``` |
| 47 | + |
| 48 | +## Configure the log category |
| 49 | + |
| 50 | +Before you create a diagnostic setting, define which log categories to collect. You can enable all logs or only audit logs. |
| 51 | + |
| 52 | +### [All logs](#tab/all-logs) |
| 53 | + |
| 54 | +To collect all available log categories, run the following command: |
| 55 | + |
| 56 | +```azurepowershell |
| 57 | +$log = New-AzDiagnosticSettingLogSettingsObject ` |
| 58 | + -Enabled $true ` |
| 59 | + -CategoryGroup "allLogs" |
| 60 | +``` |
| 61 | + |
| 62 | +### [Audit logs only](#tab/audit-logs) |
| 63 | + |
| 64 | +To collect only audit logs, run the following command: |
| 65 | + |
| 66 | +```azurepowershell |
| 67 | +$log = New-AzDiagnosticSettingLogSettingsObject ` |
| 68 | + -Enabled $true ` |
| 69 | + -CategoryGroup "audit" |
| 70 | +``` |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## Create a diagnostic setting |
| 75 | + |
| 76 | +Use the `New-AzDiagnosticSetting` cmdlet to create a diagnostic setting for your Discovery resource. Replace the `<placeholder>` values with your resource information. |
| 77 | + |
| 78 | +### [Workspace](#tab/workspace) |
| 79 | + |
| 80 | +```azurepowershell |
| 81 | +New-AzDiagnosticSetting ` |
| 82 | + -Name "<diagnostic-setting-name>" ` |
| 83 | + -ResourceId "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Discovery/workspaces/<workspace-name>" ` |
| 84 | + -StorageAccountId "/subscriptions/<subscription-id>/resourceGroups/<storage-resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account-name>" ` |
| 85 | + -Log $log |
| 86 | +``` |
| 87 | + |
| 88 | +### [Bookshelf](#tab/bookshelf) |
| 89 | + |
| 90 | +```azurepowershell |
| 91 | +New-AzDiagnosticSetting ` |
| 92 | + -Name "<diagnostic-setting-name>" ` |
| 93 | + -ResourceId "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Discovery/bookshelves/<bookshelf-name>" ` |
| 94 | + -StorageAccountId "/subscriptions/<subscription-id>/resourceGroups/<storage-resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account-name>" ` |
| 95 | + -Log $log |
| 96 | +``` |
| 97 | + |
| 98 | +### [Supercomputer](#tab/supercomputer) |
| 99 | + |
| 100 | +```azurepowershell |
| 101 | +New-AzDiagnosticSetting ` |
| 102 | + -Name "<diagnostic-setting-name>" ` |
| 103 | + -ResourceId "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Discovery/supercomputers/<supercomputer-name>" ` |
| 104 | + -StorageAccountId "/subscriptions/<subscription-id>/resourceGroups/<storage-resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account-name>" ` |
| 105 | + -Log $log |
| 106 | +``` |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +### Parameter reference |
| 111 | + |
| 112 | +| Placeholder | Description | |
| 113 | +| --- | --- | |
| 114 | +| `<diagnostic-setting-name>` | A descriptive name for the diagnostic setting. | |
| 115 | +| `<subscription-id>` | The Azure subscription ID that contains the Discovery resource. | |
| 116 | +| `<resource-group>` | The resource group of the Discovery resource. | |
| 117 | +| `<workspace-name>` | The name of the Microsoft Discovery workspace. | |
| 118 | +| `<bookshelf-name>` | The name of the Microsoft Discovery bookshelf. | |
| 119 | +| `<supercomputer-name>` | The name of the Microsoft Discovery supercomputer. | |
| 120 | +| `<storage-resource-group>` | The resource group of the destination storage account. | |
| 121 | +| `<storage-account-name>` | The name of the destination Azure Storage account. | |
| 122 | + |
| 123 | +## Verify the diagnostic setting |
| 124 | + |
| 125 | +To confirm that the diagnostic setting was created successfully, run the following command: |
| 126 | + |
| 127 | +```azurepowershell |
| 128 | +Get-AzDiagnosticSetting ` |
| 129 | + -ResourceId "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Discovery/<resource-type>/<resource-name>" |
| 130 | +``` |
| 131 | + |
| 132 | +Replace `<resource-type>` with `workspaces`, `bookshelves`, or `supercomputers`, and `<resource-name>` with the name of your resource. |
| 133 | + |
| 134 | +A successful response returns the diagnostic setting name, the storage account destination, and the enabled log categories. |
| 135 | + |
| 136 | +> [!NOTE] |
| 137 | +> Diagnostic logs might take several minutes to appear in the storage account after you create the setting. |
| 138 | +
|
| 139 | +## Manage log retention |
| 140 | + |
| 141 | +Logs exported to the storage account are stored in Azure Monitor resource-specific containers. To manage how long logs are retained, configure a [lifecycle management policy](/azure/storage/blobs/lifecycle-management-overview) on the destination storage account. |
| 142 | + |
| 143 | +## Related content |
| 144 | + |
| 145 | +- [Azure Monitor diagnostic settings](/azure/azure-monitor/essentials/diagnostic-settings) |
| 146 | +- [Azure Monitor resource logs](/azure/azure-monitor/essentials/resource-logs) |
| 147 | +- [Create a storage account](/azure/storage/common/storage-account-create) |
| 148 | +- [Install Azure PowerShell](/powershell/azure/install-azure-powershell) |
0 commit comments