Enable ServiceMaps for Azure VM´s
Azure ServiceMap is a great extension to LogAnalytics, measuring Processes, Connectivity and Performance for Windows and Linux Computers onPrem and in the Cloud. This script (from https://blogs.technet.microsoft.com/msoms/2017/08/29/azure-vm-extension-for-dependency-agent/ ) enables the ServiceMap extension to all VM´s in a defined ResourceGroup. I just tested this again and it still works fine.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$version = "9.1" $ExtPublisher = "Microsoft.Azure.Monitoring.DependencyAgent" $OsExtensionMap = @{ "Windows" = "DependencyAgentWindows"; "Linux" = "DependencyAgentLinux" } $rmgroup = "Place the ResourceGroupName in here" Get-AzureRmVM -ResourceGroupName $rmgroup | ForEach-Object { "" $name = $_.Name $os = $_.StorageProfile.OsDisk.OsType $location = $_.Location $vmRmGroup = $_.ResourceGroupName "${name}: ${os} (${location})" Date -Format o $ext = $OsExtensionMap.($os.ToString()) $result = Set-AzureRmVMExtension -ResourceGroupName $vmRmGroup -VMName $name -Location $location -Publisher $ExtPublisher -ExtensionType $ext -Name "DependencyAgent" -TypeHandlerVersion $version $result.IsSuccessStatusCode } |
Hope that helps. R.