-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report - AMA Policy - UAMI Permission #1831
Comments
Apologies. I thought this was getting logged upstream. Will move the issue and ping the relevant people |
This is the issue that I flagged internally |
Hi @HeiGeorge, Thank you for reporting the issue. I have replicated the issues and reviewed possible workarounds and next steps. Issue 1: ResizingThe UAMI configuration should not need to change when resizing. I am consulting internally to understand how PowerShell and CLI handle this scenario. As this requires review from other teams, it may take some time to provide a response. Workarounds
Issue 2: Moving a VM to an availability zoneIn this scenario, a new virtual machine (VM) is created with the specified zone configuration, and the source VM is deallocated. As a result of creating a new VM, the User Assigned Managed Identity (UAMI) configuration for that VM is also updated, which necessitates having access to manage the UAMI. Even if you possess the permissions to manage the UAMI, the tools will display an error message indicating that the UAMI is outside the permissible scope (UserManagedIdentityOutsideSubscriptionScope). You can opt not to retain the UAMI, but only when the user has the necessary permissions on the UAMI. Removing a UAMI from a VM configuration shouldn't require access to the UAMI. I will consult internal teams to clarify why access might be needed when not retaining the UAMI. Workarounds
I'll update when I have more information. |
Thanks @arjenhuitema ! Much appreciated! |
Community Note
Versions
terraform: 1.5.7
azure provider: 3.90.0
module: "Azure/caf-enterprise-scale/azurerm" - 5.2.1
Description
Describe the bug
Assigning the policy "Enable Azure Monitor for VMs with Azure Monitoring Agent(AMA)" (/providers/Microsoft.Authorization/policySetDefinitions/924bfe3a-762f-40e7-86dd-5c8b95eb09e6) with an UAMI in a central subscription is restricting certain VM operations on Landing Zones like resizing a VM or moving a VM to an availability zone.
Steps to Reproduce
Policy Assignment
Issue 1 - VM Resize from CLI
Issue 2 - Moving VM to an availability zone from the portal
Additional context
We are a Platform Team and provisioned more than 100 Landing Zones using caf-enterprise-scale/azurerm. After deploying the AMA Policy, some Landing Zone users have reported that they are not able to perform the above actions on VMs because the UAMI is created in a different subscription on which they don't have access. We don't want to allow the access to the central subscription where the UAMI is created as it needs to be managed only by us.
For Issue 1 - The action can be performed from the Azure Portal but not from Azure CLI or PowerShell.
For Issue 2 - A workaround was to apply a temporary policy exemption but it is not sustainable on the long run.
The text was updated successfully, but these errors were encountered: