Azure-MG-Sub-Governance-Reporting icon indicating copy to clipboard operation
Azure-MG-Sub-Governance-Reporting copied to clipboard

Issue Running Script

Open clifpi opened this issue 1 year ago • 7 comments

Hi, I am running the script point specifically the management group, it looks to run well but I get this error

!Please report at aka.ms/AzGovViz and provide the following dump Caching built-in Role definitions - try #1; returned: (StatusCode: '404') <.code: ''> <.error.code: 'InvalidResourceType'> | <.message: ''> <.error.message: 'The resource type 'roleDefinitions' could not be found in the namespace 'Microsoft.Authorization' for api version '2022-04-01'. The supported api-versions are '2014-04-01-preview,2014-07-01-preview,2014-10-01-preview,2015-05-01-preview,2015-06-01,2015-07-01,2016-07-01,2017-05-01,2017-09-01,2018-01-01-preview,2018-07-01'.'> - (plain : @{error=}) - EXIT

Followed by this Line | 1738 | $arrayBuiltInCaching | ForEach-Object -parallel { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Error - check the last console output for details

Any thoughts? thank you for your time!

clifpi avatar Aug 15 '22 19:08 clifpi

hi, assuming you are not running in public cloud (AzureCloud) but some sovereign cloud.
Please try the following: in the azGovVizParallel.ps1 file replace 2022-04-01 (3 occurrences) with 2018-07-01.

JulianHayward avatar Aug 15 '22 20:08 JulianHayward

sorry this is Azure government cloud.

clifpi avatar Aug 15 '22 20:08 clifpi

Did you still want mt to attempt your suggestion? How would I do this? thank you for your feedback.

clifpi avatar Aug 15 '22 20:08 clifpi

yes, just edit the file AzGovVizParallel.ps1 and replace the string 2022-04-01 with 2018-07-01. Then it should work in Azure Government. Seems that API version 2022-04-01 is not available in sovereign clouds, yet.

JulianHayward avatar Aug 15 '22 20:08 JulianHayward

Hi, I replaced $ProductVersion = 'v6_major_20220803_1', with $ProductVersion = 'v6_major_20180701_1', in the AzGovVizParallel.ps1 file

I received the same error, did I modify the correct line? I did not see anything else referencing 2022

!Please report at aka.ms/AzGovViz and provide the following dump Caching built-in Role definitions - try #1; returned: (StatusCode: '404') <.code: ''> <.error.code: 'InvalidResourceType'> | <.message: ''> <.error.message: 'The resource type 'roleDefinitions' could not be found in the namespace 'Microsoft.Authorization' for api version '2022-04-01'. The supported api-versions are '2014-04-01-preview,2014-07-01-preview,2014-10-01-preview,2015-05-01-preview,2015-06-01,2015-07-01,2016-07-01,2017-05-01,2017-09-01,2018-01-01-preview,2018-07-01'.'> - (plain : @{error=}) - EXIT

Exception: C:\temp\Azure-MG-Sub-Governance-Reporting-master\pwsh\AzGovVizParallel.ps1:1738 Line | 1738 | $arrayBuiltInCaching | ForEach-Object -parallel { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Error - check the last console output for details

clifpi avatar Aug 16 '22 13:08 clifpi

please ping me on LinkedIn ..

JulianHayward avatar Aug 16 '22 13:08 JulianHayward

unfortunately I do not have linkedin, I sent you an email to your MS email or if you have another way to contact you

clifpi avatar Aug 16 '22 14:08 clifpi

Fixed with release v6_major_20220817_1

  • Update: IMPORTANT Fix for custom Role definitions / missing DataActions and NotDataActions
    • Update API reference roleDefinitions use API version 2018-07-01 (API version 2022-04-01 not available in sovereign clouds)
  • BugFix

JulianHayward avatar Aug 17 '22 16:08 JulianHayward