Skip to content

Commit 7aa670b

Browse files
authored
Merge pull request #208957 from guywi-ms/activity-log-collection-delete
Remove legacy collection of activity logs
2 parents 0c85d6b + ae5634d commit 7aa670b

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

articles/azure-monitor/essentials/activity-log.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Azure activity log
33
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
55
services: azure-monitor
66
ms.topic: conceptual
77
ms.date: 07/01/2022
8-
ms.author: bwren
9-
ms.reviewer: lualderm
8+
ms.author: guywild
9+
ms.reviewer: orens
1010
---
1111

1212
# Azure Monitor activity log
@@ -182,9 +182,24 @@ Each event is stored in the PT1H.json file with the following format. This forma
182182

183183
## Legacy collection methods
184184

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+
185200
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.
186201

187-
### [PowerShell](#tab/powershell)
202+
#### [PowerShell](#tab/powershell)
188203

189204
If a log profile already exists, you first must remove the existing log profile and then create a new one.
190205

@@ -234,7 +249,7 @@ This sample PowerShell script creates a log profile that writes the activity log
234249
Add-AzLogProfile -Name $logProfileName -Location $locations -StorageAccountId $storageAccountId -ServiceBusRuleId $serviceBusRuleId
235250
```
236251

237-
### [CLI](#tab/cli)
252+
#### [CLI](#tab/cli)
238253

239254
If a log profile already exists, you first must remove the existing log profile and then create a log profile.
240255

272 KB
Loading
562 KB
Loading
282 KB
Loading

0 commit comments

Comments
 (0)