JulianHayward / Azure-MG-Sub-Governance-Reporting

Azure Governance Visualizer aka AzGovViz is a PowerShell script that captures Azure Governance related information such as Azure Policy, RBAC (a lot more) by polling Azure ARM, Storage and Microsoft Graph APIs.
MIT License
853 stars 306 forks source link

Error getting consumption data #101

Closed CerveloRS closed 2 years ago

CerveloRS commented 2 years ago

After setting:

Define if Azure Consumption data should be reported

I get these messages in the log: (ids replaced with )


2022-05-25T07:08:52.4227102Z Getting Consumption data (scope MG '') for period 1 days (2022-05-24 - 2022-05-24) 2022-05-25T07:08:53.8543010Z Getting Consumption data (scope MG '') for period 1 days (2022-05-24 - 2022-05-24) - try #1; returned: (StatusCode: '400') <.code: ''> <.error.code: 'BadRequest'> | <.message: ''> <.error.message: 'Management group does not have any valid subscriptions. (Request ID: )'> - (plain : @{error=}) seems there are no valid Subscriptions present - skipping CostManagement 2022-05-25T07:08:53.8561133Z Seems there are no valid Subscriptions present - skipping CostManagement 2022-05-25T07:08:53.8562085Z Action: Setting switch parameter 'DoAzureConsumption' to false 2022-05-25T07:08:53.8569848Z Getting Consumption data duration: 1.4344381 seconds

Invoke-WebRequest: /home/vsts/.local/share/powershell/Modules/AzAPICall/1.1.12/functions/AzAPICallFunctions.ps1:170 Line | 170 | … PIRequest = Invoke-WebRequest -Uri $uri -Method $method -Body $body - … | ~~~~~~~~~~~~~ | {"error":{"code":"BadRequest","message":"Management group | does not have any valid subscriptions. (Request ID: | )"}}

Get-Package: No match was found for the specified search criteria and module names 'PSRule.Rules.Azure'.

Get-Package: No match was found for the specified search criteria and module names 'AzAPICall'.

Running in Azure Devops.

Please advise.

JulianHayward commented 2 years ago

please try the dev branch

JulianHayward commented 2 years ago

should be fixed with latest release

CerveloRS commented 2 years ago

Confirmed resolved.