its happen beacuse az104-02-mg1 is the default management group, you should change the default management group first.
Azure: Cannot delete a child management group (AZ104 Lab 2)
Hello,
I am working on the AZ104 exercise Lab 2 (link) and I am literally at the FINAL STEP of the exercise (Clean Up Resources Step 11) but I could not delete the 'az104-02-mg1' management group - screenshot below shows the 'hierarchy' of the management groups - the 'az104-02-mg1' is currently UNDER the Tenant Root Group.
So I am using my main azure account to log on to the Azure Portal to attempt to delete that management group. So I clicked on the 'az104-02-mg1' which brings me to its details page. However, I see that the "Delete" icon is greyed out screenshot below)
So I tried to run the Azure CLI in the Powershell - and here is the error message when I tried to delete it using the Powershell Azure CLI -
> PS /home/s> az account management-group delete --name 'az104-02-mg1'
>
> AuthorizationFailed: The client '<account>' with object id '65a8ff19-9f21-4ad1-a93b-dc94e2ee37bc' does not have authorization to perform action 'Microsoft.Management/managementGroups/delete' over scope '/providers/Microsoft.Management/managementGroups/**az104-02-mg1**' or the scope is invalid. If access was recently granted, please refresh your credentials.
I followed the AZ104 Lab 2 (link) instructions faithfully. I couldn't get why I am getting this issue. I re-read the instructions a few times and there is no other privilege or access settings change other than the following:
The error says "Authorization error" - what did I miss?
Appreciate your help and inputs!
6 answers
Sort by: Newest
-
-
Imran Abdul Rauf 6 Reputation points
2022-01-20T09:40:29.53+00:00 Probably azure has incorrectly assigned your ownership to the management group you created.
This happened one time with me
Try these steps;
- Select the required MG
- Select Access Control (IAM) from the blade
- Click on "Role Assignments" tab
- Here you may see Unknown ownership
- Remove it and add yourself as Owner
- Now you can remove it easily.
-
Alexander K. Whittenberg 1 Reputation point
2021-10-08T17:21:09.273+00:00 Finally figured it out. For some reason my subscription was still tied to my Child Management group. Once I moved the subscription from the child management group back onto my Root management group it allowed me to delete the management group. Finally.
-
Alexander K. Whittenberg 1 Reputation point
2021-10-08T16:50:59.557+00:00 If anyone ever got the answer to this please let me know I am still unable to delete my child management group.
-
S Ty 1 Reputation point
2021-08-26T23:42:20.01+00:00 Thank you! I will post this over to the other forum.