Steps to configure MMA Agent on Windows VM
Step 1: Log in to Azure Portal.
Step 2: Access the Azure Cloud Shell and Switch to the PowerShell console
Step 3: Now Use the below command to create a new file named installMMAAgent.ps1
touch installMMAAgent.ps1
Step 4: use the command to write the code in the newly created file:installMMAAgent.ps1
code installMMAAgent.ps1
Step 5: Paste the below-following code in the install MMAAgent.ps1 file
$subName = "<default subscription name>" Select-AzSubscription -Subscription $subName $workspaceRG = "<resource group name>" $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName $workspaceRG $workspaceId = $workspace.CustomerId $workspaceKey = Get-AzOperationalInsightsWorkspaceSharedKeys -ResourceGroupName $workspaceRG -Name $Workspace.Name $Publicsettings=@{"workspaceId" = $workspaceId} $Protectedsettings=@{"workspaceKey" = $workspaceKey.primarysharedkey} Set-AzVMExtension -ExtensionName "Microsoft.EnterpriseCloud.Monitoring" ` -ResourceGroupName "<add VM resource group> ` -VMName "<add server name>" ` -Publisher "Microsoft.EnterpriseCloud.Monitoring" ` -ExtensionType "MicrosoftMonitoringAgent" ` -TypeHandlerVersion 1.0 ` -Settings $PublicSettings ` -ProtectedSettings $ProtectedSettings ` -Location "<location name>"
Step 6: Save the file and run the code. Use the following command to run the code.
./installMMAAgent.ps1
Step 7: Go to your target Azure VM and check the Extensions + applications. You should see this âMicrosoftMonitoringAgentâ extension on Azure VM if successful.
This is how you can install a Microsoft Monitoring Agent (MMA) extension for a Windows Virtual Machine in Microsoft Azure.
How to Install MMA Agent for a Windows Virtual Machine using PowerShell?
Pre-requisite:- Azure
Here in this article, we will show how to add or install MMA Agent on a Windows Virtual Machine in Azure using PowerShell. Before diving into the process letâs know what an MMA agent is. MMA Stands for Microsoft Monitoring Agent can be configured to collect the performance logs or the application logs of an Azure Virtual Machine by connecting it to Log Analytics Workspace in Azure.
Contact Us