Azure policy to deploy log analytics extension on VM

SujinaSJ-1789 251 Reputation points
2022-04-08T04:40:13.607+00:00

We applied below built-in policy to automatically deploy log analytics extension at the time of VM creation.

Deploy - Configure Log Analytics extension to be enabled on Windows virtual machines
Deploy Log Analytics extension for Linux VMs

But it didn't deploy extension while we create VM. Remediation task didn't solve the issue as well.

Can someone help with this. Thanks in advance.

@Mohammed Thahif BK

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

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,211 Reputation points
    2022-04-08T14:20:29.207+00:00

    @SujinaSJ-1789 Welcome to Microsoft Q & A Community Forum. I see you are trying to deploy log analytics extensions using Azure Policy. When a resource is deployed to or updated within a scope with assignment via Azure Resource Manager, REST API, or a supported SDK. In this scenario, the effect event (append, audit, deny, deploy) and compliant status information for the individual resource becomes available in the portal and SDKs around 15 minutes later. This event doesn't cause an evaluation of other resources.

    You also mentioned remediation task hasn't shown any change in the resources. Can you please check the logs related to the resources which are deployed using remediation task? To view the logs, Go to the Policy Assignment and select Remediation Tab and click on the ellipses(...) icon and select View Remediation Task.

    191403-image.png

    In Remediation Task page, scroll to the bottom and click on the ellipses(...) of a resource and select View Deployment.

    191431-image.png

    This opens the deployment page, where you can click on red highlighted warning "Deployment failed. Click here for more details". This shows the error why the deployment failed. In my case, vm was in shut down mode.However, once I started the vm, the extension was deployed by creating remediation task.

    191373-image.png

    0 comments No comments