I ran into a similar issue where the "Repair" button didn't work and indicating that the:
"The previously created System Assigned Managed Identity doesn't have enough permissions to access the resources in the subscription Abonnement Visual Studio Enterprise. Click on Repair to fix this issue."
The System Assigned Managed Identity needs to have 2 roles assigned to it.
- Contributor
- User Access Administrator
In my instance my System Assigned Managed Identity didn't have the "User Access Administrator" role assigned to it.
To fix this first you need to verify you can assign both Roles.
How to verify you can assign the 2 above roles (Contributor, User Access Administrator):
- Goto your subscription
- Click on Access Control (IAM)
- Click Add->"Add role assignment"
- In "Add role assignment" click on the "Privileged administrator roles"
- Verify you see: Contributor and "User Access Administrator" in there. If you do not you might have a Role Assignment Condition set on your account and you will need someone with the ability to remove the condition from your account in order for you to proceed.
If you can assign both those roles, follow the steps here: https://learn.microsoft.com/en-us/azure/resource-mover/tutorial-move-region-powershell?tryIt=true&source=docs#grant-access-to-the-managed-identity to assign those roles to your System Assigned Managed Identity. Steps copied below for reference:
- Retrieve identity details from the MoveCollection object.
$moveCollection = Get-AzResourceMoverMoveCollection -SubscriptionId $subscriptionId -ResourceGroupName "RG-MoveCollection-demoRMS" -Name "PS-centralus-westcentralus-demoRMS"
$identityPrincipalId = $moveCollection.IdentityPrincipalId
- Assign the required roles to the identity so Azure Resource Mover can access your subscription to help move resources.
New-AzRoleAssignment -ObjectId $identityPrincipalId -RoleDefinitionName Contributor -Scope "/subscriptions/$subscriptionId"
New-AzRoleAssignment -ObjectId $identityPrincipalId -RoleDefinitionName "User Access Administrator" -Scope "/subscriptions/$subscriptionId"
Note: you need to replace the values -ResourceGroupName, -Name with appropriate values for your Azure resource and define a string $subscriptionId variable equal to your Azure SubscriptionId
See this (https://learn.microsoft.com/en-us/azure/role-based-access-control/delegate-role-assignments-portal?tabs=template) article on Azure Resource Mover for more information on why the Azure Resource Mover needs the above roles.