Azure Monitor Agent (AMA) collects monitoring data from the guest operating system of Azure and hybrid virtual machines. It then delivers this data to Azure Monitor for use by various features, insights, and other services, such as Microsoft Sentinel and Microsoft Defender for Cloud. AMA replaces Azure Monitor’s legacy monitoring agents (MMA/OMS). This article will serve as an informative guide and give you a clear understanding of how to perform a silent installation of the Azure Monitor Agent from the command line using the MSI installer.
How to Install the Azure Monitor Agent Silently
Azure Monitor Agent Silent Install (MSI)
- Navigate to: https://learn.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-windows-client#install-the-agent
- Download the AzureMonitorAgentClientSetup.msi to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the “C:\Downloads” folder
- Enter the following command: MsiExec.exe /i AzureMonitorAgentClientSetup.msi /qn
- Press Enter
After a few moments you will find Azure Monitor Agent entries in the Installation Directory and Programs and Features in the Control Panel.
Software Title: | Azure Monitor Agent |
Vendor: | Microsoft Corporation |
Architecture: | x86_x64 |
Installer Type: | MSI |
Silent Install Switch: | MsiExec.exe /i AzureMonitorAgentClientSetup.msi /qn |
Silent Uninstall Switch: | MsiExec.exe /x AzureMonitorAgentClientSetup.msi /qn |
Repair Command: | MsiExec.exe /fa AzureMonitorAgentClientSetup.msi /qn |
Download Link: | Azure Monitor Agent Download |
PowerShell Script: | Azure Monitor Agent | PowerShell Script |
Detection Script: | Azure Monitor Agent | Custom Detection Script |
The information above provides a quick overview of the software title, vendor, silent install, and silent uninstall switches. The download links provided take you directly to the vendors website. Continue reading if you are interested in additional details and configurations.
Additional Configurations
Create an Azure Monitor Agent Installation Log File
The Azure Monitor Agent MSI installer offers the option to generate a log file during installation to assist with troubleshooting should any problems arise. You can use the following command to create a verbose log file with details about the installation.
Azure Monitor Agent Silent Install (MSI) with Logging
MsiExec.exe /i AzureMonitorAgentClientSetup.msi /qn /L*v "%WINDIR%\Temp\AzureMonitorAgent-Install.log" |
Change the Azure Monitor Agent Default Installation Directory
You can also change the default installation directory by using the following command line parameters. In this example, I’m installing Azure Monitor Agent to “C:\AzureMonitorAgent”
MsiExec.exe /i AzureMonitorAgentClientSetup.msi /qn INSTALLDIR="C:\AzureMonitorAgent" |
Change the Azure Monitor Agent Default Data Store Directory
MsiExec.exe /i AzureMonitorAgentClientSetup.msi /qn DATASTOREDIR="C:\AzureMonitorAgent\DataStore" |
Additional Azure Monitor Agent Parameters
Parameter | Description |
INSTALLDIR | Directory path where the agent binaries are installed |
DATASTOREDIR | Directory path where the agent stores its operational logs and data |
PROXYUSE | Must be set to “true” to use proxy |
PROXYADDRESS | Set to Proxy Address. PROXYUSE must be set to “true” to be correctly applied |
PROXYUSEAUTH | Set to “true” if proxy requires authentication |
PROXYUSERNAME | Set to Proxy username. PROXYUSE and PROXYUSEAUTH must be set to “true” |
PROXYPASSWORD | Set to Proxy password. PROXYUSE and PROXYUSEAUTH must be set to “true” |
CLOUDENV | Set to Cloud. “Azure Commercial”, “Azure China”, “Azure US Gov”, “Azure USNat”, or “Azure USSec |
How to Uninstall Azure Monitor Agent Silently
Check out the following posts for a scripted solution:
Azure Monitor Agent Install and Uninstall (PowerShell) |
Azure Monitor Agent Silent Uninstall (PowerShell) |
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Enter one of the following commands:
Version | Azure Monitor Agent Silent Uninstall String |
1.27.0.0 | MsiExec.exe /x {D3E0BA3C-4A79-4BE0-8FC4-C167D3C2CE1D} /qn |
1.26.0.0 | MsiExec.exe /x {0E61117D-EBF1-4920-BF23-36BE5EDD2C70} /qn |
Always make sure to test everything in a development environment prior to implementing anything into production. The information in this article is provided “As Is” without warranty of any kind.