I received error message:
{
"error": {
"code": "BadRequest",
"message": "Management group XYZ does not have any valid subscriptions. (Request ID: c6a2b5dc-f198-5365-804e-04240727f3a8)"
}
}
(postman) when I'm trying to get any information related to Azure management group. Example above becomes from url:
https://management.azure.com/providers/Microsoft.Management/managementGroups/{{managementGroupId}}/providers/Microsoft.CostManagement/query?api-version=2022-10-01
My SPN is assigned to "Reader" and "Cost Management Reader" roles for affected management group (marked red circle on screenshot). what is the cause of the issue?
I have access to another azure environment, and there all works fine with those roles assigned.
Here is the MS explanation of my problem : https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/understand-work-scopes#cloud-solution-provider-csp-scopes.
"Management groups in CSP scopes aren't supported by Cost Management. If you have a CSP subscription and you set the scope to a management group in cost analysis, an error similar the following one is shown:
Management group does not have any valid subscriptions"