Azure Monitor Agent not initializing or connecting to LAW for specific Production VMs deployed via Bicep module

Vaibhav Anand 0 Reputation points
2025-12-04T20:39:25.5466667+00:00

We use a Bicep module to deploy Azure Monitor Agent (AMA) along with DCE, DCR, and DCRA for all our Windows Server 2022 VMs. This setup works fine for every VM in Non-Prod and a few VMs in Prod. But Prod WebApp VMs never connect to Log Analytics, and one Prod RM VM that was previously sending logs suddenly stopped and now shows “Not Connected”.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
{count} votes

1 answer

Sort by: Most helpful
  1. Dio Xavier 270.1K Reputation points Volunteer Moderator
    2025-12-04T21:03:48.6+00:00

    Hello,

    Welcome to Microsoft Azure.

    Based on your description, the Prod VMs appear to be failing to communicate with Azure Monitor Agent and Log Analytics due to network configuration issues, i recommend validating the following:

    1.Network – Ensure the Prod VMs have outbound access to the required Azure Monitor endpoints:

    Azure Monitor Agent overview

    2. DCR/DCRA Association – Confirm that the data collection rules are correctly applied to the VMs:

    az monitor data-collection rule association list --resource <VM_ID>

    3.AMA Status – Check the agent service/extension:

    Get-Service AzureMonitorAgent

    Get-AzVMExtension -ResourceGroup <RG> -VMName <VM> -Name AzureMonitorWindowsAgent

    4.Local AMA Logs – Review logs for specific errors:

          C:\ProgramData\AzureMonitorAgent\logs

    If the VMs remain “Not Connected” after these checks, I recommend opening a support ticket with Microsoft for backend analysis of Azure Monitor.

    0 comments No comments

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.