|
1 | 1 | ---
|
2 | 2 | title: Azure activity log
|
3 | 3 | description: View the Azure Monitor activity log and send it to Azure Monitor Logs, Azure Event Hubs, and Azure Storage.
|
4 |
| -author: bwren |
| 4 | +author: guywi-ms |
5 | 5 | services: azure-monitor
|
6 | 6 | ms.topic: conceptual
|
7 | 7 | ms.date: 07/01/2022
|
8 |
| -ms.author: bwren |
9 |
| -ms.reviewer: lualderm |
| 8 | +ms.author: guywild |
| 9 | +ms.reviewer: orens |
10 | 10 | ---
|
11 | 11 |
|
12 | 12 | # Azure Monitor activity log
|
@@ -182,9 +182,24 @@ Each event is stored in the PT1H.json file with the following format. This forma
|
182 | 182 |
|
183 | 183 | ## Legacy collection methods
|
184 | 184 |
|
| 185 | +If you're collecting activity logs using the legacy collection method, we recommend you [export activity logs to your Log Analytics workspace](#send-to-log-analytics-workspace) and disable the legacy collection using the [Data Sources - Delete API](/rest/api/loganalytics/data-sources/delete?tabs=HTTP) as follows: |
| 186 | + |
| 187 | +1. List all data sources connected to the workspace using the [Data Sources - List By Workspace API](/rest/api/loganalytics/data-sources/list-by-workspace?tabs=HTTP#code-try-0) and filter for activity logs by setting `filter=kind='AzureActivityLog'`. |
| 188 | + |
| 189 | + :::image type="content" source="media/activity-log/data-sources-list-by-workspace-api.png" alt-text="Screenshot showing the configuration of the Data Sources - List By Workspace API." lightbox="media/activity-log/data-sources-list-by-workspace-api.png"::: |
| 190 | + |
| 191 | +1. Copy the name of the connection you want to disable from the API response. |
| 192 | + |
| 193 | + :::image type="content" source="media/activity-log/data-sources-list-by-workspace-api-connection.png" alt-text="Screenshot showing the connection information you need to copy from the output of the Data Sources - List By Workspace API." lightbox="media/activity-log/data-sources-list-by-workspace-api-connection.png"::: |
| 194 | + |
| 195 | +1. Use the [Data Sources - Delete API](/rest/api/loganalytics/data-sources/delete?tabs=HTTP) to stop collecting activity logs for the specific resource. |
| 196 | + |
| 197 | + :::image type="content" source="media/activity-log/data-sources-delete-api.png" alt-text="Screenshot of the configuration of the Data Sources - Delete API." lightbox="media/activity-log/data-sources-delete-api.png"::: |
| 198 | +### Managing legacy log profiles |
| 199 | + |
185 | 200 | Log profiles are the legacy method for sending the activity log to storage or event hubs. If you're using this method, consider transitioning to diagnostic settings, which provide better functionality and consistency with resource logs.
|
186 | 201 |
|
187 |
| -### [PowerShell](#tab/powershell) |
| 202 | +#### [PowerShell](#tab/powershell) |
188 | 203 |
|
189 | 204 | If a log profile already exists, you first must remove the existing log profile and then create a new one.
|
190 | 205 |
|
@@ -234,7 +249,7 @@ This sample PowerShell script creates a log profile that writes the activity log
|
234 | 249 | Add-AzLogProfile -Name $logProfileName -Location $locations -StorageAccountId $storageAccountId -ServiceBusRuleId $serviceBusRuleId
|
235 | 250 | ```
|
236 | 251 |
|
237 |
| -### [CLI](#tab/cli) |
| 252 | +#### [CLI](#tab/cli) |
238 | 253 |
|
239 | 254 | If a log profile already exists, you first must remove the existing log profile and then create a log profile.
|
240 | 255 |
|
|
0 commit comments