question

SujinaSJ-1789 avatar image
0 Votes"
SujinaSJ-1789 asked SujinaSJ-1789 commented

Azure policy to deploy log analytics extension on VM

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.

@MohammedThahifBK-3336

azure-policy
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SujinaSJ-1789 Did you get chance to review my previous comment? Do revert if you have further questions.

0 Votes 0 ·
SujinaSJ-1789 avatar image SujinaSJ-1789 SwathiDhanwada-MSFT ·

@SwathiDhanwada-MSFT Thanks for replying and apologies for late reply. As I told the remediation task didn't solve the issue, there were no task created when the remediation task was done and the log was empty. And thus no resources were deployed using remediation task




0 Votes 0 ·

@SujinaSJ-1789 Checking in to see if the answer helped. If yes, please do "Accept Answer" and Up-Vote it. Let us know if there are still any additional issues we can help with.

0 Votes 0 ·

1 Answer

SwathiDhanwada-MSFT avatar image
0 Votes"
SwathiDhanwada-MSFT answered

@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



image.png (50.6 KiB)
image.png (55.3 KiB)
image.png (57.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.