Closed SebastianClaesson closed 3 months ago
Hi @SebastianClaesson, thanks for reaching out. This scenario/situation and the given outcome is expected.
AzOps requires the management group resource provider registered in the Azure subscription designated during initialization.
To move forward please ensure to register the management group resource provider in the designated Azure subscription used during initialization and re-run the pipeline.
Hi @Jefajers ,
Thanks for the response!
I guess the wiki could be updated here or added to the FAQ (to help anyone else implementing azops in the same way we've done); https://github.com/azure/azops/wiki/prerequisites#steps With the information box, with information that the "Microsoft.Management" resource provider will be registered (or requires that it's pre-registered).
The Initialize-AzOpsEnviroment function does not output the error from the PowerShell function, instead it provides a customized error message; https://github.com/Azure/AzOps/blob/2451859f4c99708fe387bcafbe42b275ed7005ee/src/functions/Initialize-AzOpsEnvironment.ps1#L121-L124
Seems the Azure PowerShell command itself does have this check;
So perhaps it wouldn't be a huge code change to implement it!
Exception provided by Get-AzManagementGroup function in Az PowerShell Module; https://github.com/Azure/azure-powershell/blob/8b31f633c9e5e27139a5922847b203819e340714/src/Resources/Resources/ManagementGroups/Common/AzureManagementGroupsCmdletBase.cs#L132-L138
Great idea @SebastianClaesson, lets adopt both of your suggestions by clarifying this requirement in the wiki and in addition to the custom message we could output the generated error code as well to improve clarity.
I will amend this issue as a feature request :)
Would you possibly like to create a PR for these changes for me to review or would you prefer that i implement these suggestions?.
I'll create a PR for these changes during the day for your reviewal.
Thanks a lot @Jefajers !
Describe the bug Unable to list Management groups if the resource provider "Microsoft.Management" is not registered in the subscription where AzOps is initialized.
This is only a bug due to the way we have decided to use AzOps, where we set it up in a Reader mode only.
The AzOps engine provides an error message that indicates it could be a permission issue, however, the issue is due to the resource provider not being registered in the subscription where the engine is initialized.
Steps to reproduce
Screenshots Not registered:![image](https://github.com/Azure/AzOps/assets/34689432/36d0d07e-b2d0-4422-939d-95c4b7a04267)
After registration:![image](https://github.com/Azure/AzOps/assets/34689432/fe2b8847-b60a-4c9a-88ae-b8bfe0c3dca7)