Sunday, September 3, 2017

Enable Diagnostics for a Azure resource and push the info to OMS

Go to the OMS portal and link the Azure subscription.

Get the Workspace Id of the OMS using powershell as show below 

·         (Get-AzureRmOperationalInsightsWorkspace).ResourceId

Get the Resource Id for a Azure resource

·         Get-AzureRmResource -ResourceGroupName webappenv -ResourceName webappenv

Push the Diagnostics information to OMS

·         Set-AzureRmDiagnosticSetting -ResourceId "/subscriptions/2a5fec51-17b3-4a42-a350-91950ce02925/re
sourceGroups/webappenv/providers/Microsoft.Web/sites/webappenv" -WorkspaceId "/subscriptions/2a5fec51-17b3-4a42-a350-919
50ce02925/resourcegroups/mms-cid/providers/microsoft.operationalinsights/workspaces/omsworkspacegirish" -Enabled $true



No comments:

Post a Comment