Policy to deny VM & VMSS creation with installing the Entra ID (formerly AAD) extension on them

Virender Rathore 0 Reputation points
2024-10-24T10:38:28.84+00:00

Can we have a custom policy to deny VM & VMSS creation with installing the Entra ID (formerly AAD) extension on them, Also I there a way to auto remediate and install VM extention for Entra ID (formerly AAD) extension on linux and windows VMs

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

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 25,321 Reputation points MVP
    2024-10-25T06:06:38.46+00:00

    Hi,

    You can deny the installation of specific VM extension as the Entra ID extension via policy: Windows and Linux. Note that when you apply the policy you also will not be able to create those extensions. This is due to Azure Policy sits on the ARM layer and policies apply to anyone doing changes no matter if it is from Portal, CLI, PowerShell, etc. or whatever account it has. In order to remediate them manually you will have to first create exclusions, install the extension and at the end either leave the exclusions or remove them. Overall it is unclear what you want to achieve exactly. It is unusual to want something to be blocked so it can be applied later.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.