Have seen this under multiple conditions:
- Firewall rules blocking "global.handler.control.monitor.azure.com:443" or "<region>.handler.control.monitor.azure.com:443"
- Agent provisioning state of the agent is either "Transitioning" or "Failed" or "Provision state is Successful but the "Handler Status" is Not Ready"
- VMInsights: Dependency Agent version MUST be 9.10 or above and configured as "Enabled for AMA"
The first and third are fairly straight forward to identify and resolve. The one that is unusual in many differenct scenarios is the second one as I've found in some cases it appears the Agent did not complete the provisioning configuration and had to do some one of the following in order:
- Remove the VM from the DCR(s)
- Remove the Azure Monitor Agent and wait 5 min.
- Reinstall the azure monitor agent and check for heartbeat with: Set-AzVMextension - Name 'AzureMonitorWindowsAgent - ExtensionType 'AzureMonitorWindowsAgent' -Publisher Microsoft.Azure.Monitor -ResourceGroupName <rg name> -VMName <vm name> -Location < vm location> -TypeHandlerVersion "1.26" -EnableAutomaticUpgrade $true -SettingString '{"authentication":{managedIdentity":"identifier-name":"mi_res_id","identifier-value":"<UMI resource id>"}}}'
- If get a heartbeat then re-associate the VM to the Data Collection Rule and monitor Logs ingestion
- If NO heartbeat, open task manager and check if "moniAgentCore.exe" process is running and if it is then wait 5-10 more minutes for a heartbeat. If Not you have to check the local machine logs for errors.
- If still no heartbeat, then remove the azure agent extension again and wait 5-10 min.
- Manually associate the VIrtual machine to the "Data Collection Rule"
- The DCR will check for the existance of the Azure Monitor Agent and if not, it will install it for you. (Please note it will not configure the agent with the UMI)
- Wait 5-10 min. again and monitor for heartbeat and monitor for logs
- If this doesn't resolve your issue you should contact MSFT support as their are other things that can be done to address this but should be provided to you from MSFT support.
I hope these step help as they are based upon the following article: https://learn.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-troubleshoot-windows-vm