@tbgangav-MSFT To configure enabling the Log Analytics and Dependency agents and identified virtual machines that aren't compliant using Policy i.e., to enable Azure Monitor for VMs by using Azure Policy in your tenant:
Assign the initiative to a scope: management group, subscription, or resource group.
Review and remediate compliance results.
For more information w.r.t it, refer this document.