Issue with Installing Azure Monitor Agent (AMA) on VMs Using OS Disk Images Despite Policy Configuration using this policy - "Configure Windows virtual machines to run Azure Monitor Agent using system-assigned managed identity"

Pardeep 100 Reputation points
2025-08-19T07:20:31.8966667+00:00

Hello Team,

I’ve configured the Azure Policy “Configure Windows virtual machines to run Azure Monitor Agent using system-assigned managed identity” to ensure AMA is installed across all Windows VMs in our environment.

Here’s what I’ve observed in testing scenarios:

  1. VMs with standard images: AMA was successfully installed.
  2. VMs using custom images: I included the relevant image IDs in the policy parameters, and AMA was installed correctly.
  3. VMs using OS disk images: These VMs did not get the AMA installed, even though they are compliant with the policy in other aspects. Especially these VMs using their OS disk images.

Could you please let me know, Why AMA is not being installed on VMs created from OS disk images, What are the possible ways to ensure AMA installation on these VMs?

Thanks in advance!

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
{count} votes

Answer accepted by question author
  1. Siva shunmugam Nadessin 1,990 Reputation points Microsoft External Staff Moderator
    2025-08-22T07:36:37.15+00:00

    Hello Pardeep,

    After investigation here are some things to consider, along with possible next steps:

    1.Policy Limitations: It may be that the policy behaves differently for OS disk images compared to standard or custom images. There could be intrinsic limitations concerning installations via images versus using OS disks.

    2.Manual Installation: If the policy isn’t applying as expected to the OS disk-based VMs, you might consider installing the AMA manually via PowerShell or using the Azure CLI. This would bypass the policy application:

    You can use the PowerShell command to install the agent:

    Install-Module -Name Az -AllowClobber -Scope CurrentUser
    
    

    Then proceed with the installation command for AMA.

    3. Custom Script: If manual installation isn't feasible for all VMs, you might create a custom script that you can run on these VMs, ensuring they get the AMA installed without relying solely on the policy.

    4.Using PowerShell for Compliance Check: You can check if the extensions are installed and their status by running:

    Get-AzVM -ResourceGroupName <ResourceGroupName> -Name <VMName> -Status
    

    5.Review Installation and Application Logs: Analyzing the installation logs might reveal any errors or warnings specifically related to the AMA installation process on these images. Ensure that DCRs are properly associated with the VMs as well.

    6.Known Issues: Check for known issues documented by Microsoft about AMA installations on virtual machines, particularly concerning different image types.

    Look into reference document:

    https://free.blessedness.top/en-us/troubleshoot/azure/azure-monitor/azure-monitor-agent/ama-windows-installation-issues-prepare-troubleshooting?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#verify-that-at-least-one-dcr-is-associated-with-the-vm

    Troubleshoot known issues with Azure Update Manager | Microsoft Learn

    https://free.blessedness.top/en-us/troubleshoot/azure/azure-monitor/azure-monitor-agent/ama-windows-installation-issues-detailed-troubleshooting-steps?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider

    https://free.blessedness.top/en-us/azure/azure-monitor/agents/azure-monitor-agent-policy?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#known-issues

    Please click Accept Answer if the answer was helpful.

    Thanks,

    Siva shunmugam.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.