1

Is there a way to configure Azure Activity logs to be forwarded to a Log Analytics instance using Azure CLI?

Hopefully equivalent to the PowerShell command:

New-AzureRmOperationalInsightsAzureActivityLogDataSource -ResourceGroupName <LogAnalyticsOMSWorkspaceResourceGroupName> -WorkspaceName <LogAnalyticsOMSWorkspaceName> -Name <NameOfThisOperationalInsightsAzureActivityLogDataSource> -SubscriptionId <SubscriptionId>
  • None for now according to https://feedback.azure.com/forums/598699-azure-cloud-shell/suggestions/37143496-azurecli-support-for-new-azurermoperationalinsight. Vote up please. – f01 May 02 '20 at 20:04

1 Answers1

0

Significant changes have been made to Azure Monitor recently, with different services being consolidated in order to simplify monitoring for Azure customers.

Dedicated Azure CLI commands under the set az monitor activity-log alert are available for managing activity log alert rules.

To create a new activity log alert rule, use in this order:

To retrieve one activity log alert rule resource, the Azure CLI command az monitor activity-log alert show can be used. And for viewing all activity log alert rule resource in a resource group, use az monitor activity-log alert list. Activity log alert rule resources can be removed using Azure CLI command az monitor activity-log alert delete.

https://learn.microsoft.com/en-us/azure/azure-monitor/platform/alerts-activity-log#cli

Ken W - Zero Networks
  • 3,533
  • 1
  • 13
  • 18
  • I think this does not do `New-AzureRmOperationalInsightsAzureActivityLogDataSource`. – f01 May 02 '20 at 20:02