Nov 12 2019
09:15 AM
- last edited on
Apr 08 2022
10:12 AM
by
TechCommunityAP
Nov 12 2019
09:15 AM
- last edited on
Apr 08 2022
10:12 AM
by
TechCommunityAP
Our organization has a single Log Analytics Workspace that all our subscriptions are connected and sending their logs to.
Currently we must browse to that LA blade in the portal, click Azure Activity Log, find the subscription and the click Connect on the new blade.
Is there a way to automate this?
Thanks!
Nov 12 2019 10:37 AM
SolutionYou will need to know the workspace ID. Then use PowerShell.
Azure AZ module:
New-AzOperationalInsightsAzureActivityLogDataSource -ResourceGroupName <LogAnalyticsOMSWorkspaceResourceGroupName> -WorkspaceName <LogAnalyticsOMSWorkspaceName> -Name <NameOfThisOperationalInsightsAzureActivityLogDataSource> -SubscriptionId <Subscription>
AzureRM module:
New-AzureRmOperationalInsightsAzureActivityLogDataSource -ResourceGroupName <LogAnalyticsOMSWorkspaceResourceGroupName> -WorkspaceName <LogAnalyticsOMSWorkspaceName> -Name <NameOfThisOperationalInsightsAzureActivityLogDataSource> -SubscriptionId <Subscription>
Cheers
Craig
Nov 15 2019 07:04 AM
@Craig Wilson Thanks for the response.
This is a great option for us. Do you know if this can be enforced with a DINE policy?