Hi rajesh.john,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
To troubleshoot the installation of software agents on your Azure VMs using Azure Policy, you can find logs related to policy remediations in several places within the Azure portal. Here’s where to look for logs and troubleshoot your Azure Policy remediation tasks:
Azure Portal - Policy Compliance:
Navigate to the Azure Portal.
Go to Policy and select Assignments.
Locate the specific policy assignment related to your VM applications.
Click on the assignment to view its compliance state. This will show which resources are compliant or non-compliant.
Activity Log:
In the Azure Portal, go to Monitor > Activity Log.
Filter the logs by resource type (e.g., Virtual Machines) and the specific time frame during which you executed the policy.
Look for events related to policy evaluations and remediation actions.
Guest Configuration Logs (for Guest Configuration Policies):
If using Guest Configuration policies, check the logs on the VM itself. The Guest Configuration extension logs are typically located at: C:\Windows\Logs\Azure\GuestConfiguration
These logs provide insights into whether the Guest Configuration agent was able to apply the desired settings or install applications.
Azure Automation Runbook Logs:
If you are using Azure Automation runbooks to handle installations based on policy compliance, check the output of those runbooks in the Azure Automation account.
Go to Automation Accounts, select your account, then navigate to Jobs under Process Automation to see details of each runbook execution.
For better understanding please refer attached link: https://techcommunity.microsoft.com/blog/coreinfrastructureandsecurityblog/software-installation-using-machine-configuration-and-azure-policy/3695636
If you have any further queries, do let us know. If the Answer is helpful, please click "Accept Answer".