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
817 stars 295 forks source link

AzAPICall - Deviating module version 1.1.52 #147

Closed merlin145160 closed 1 year ago

merlin145160 commented 1 year ago

Yesterday, everything was ok but today AzGovVizParallel.ps1 -ManagementGroupId FranceXXXXXXXXXX -DoPSRule -DoAzureConsumption 'True' -NoPIMEligibility 'False' -OutputPath /home/nicolas/xxxxxxxxxxxx/AzGovViz-result/

tart AzGovViz 18-Nov-2022 12:42:40 (#v6_major_20221113_1) Checking PowerShell edition and version PS check passed : (Major[7]; Minor[3] gt 0); (minimum supported version '7.0.3') PS Edition: Core; PS Version: 7.3.0 PS Version check succeeded Output/Files will be created in path '/home/nicolas/xxxxxxxxxxxx/AzGovViz-result/.' Verify 'AzAPICall' (False) AzAPICall - Deviating module version 1.1.52 'AzAPICall False' not installed Do you want to install AzAPICall module (False) from the PowerShell Gallery? (y/n): y Exception: /home/nicolas/Azure-MG-Sub-Governance-Reporting/pwsh/AzGovVizParallel.ps1:27128 Line | 27128 | … throw " 'Install-Module -Name $($module.ModuleName) -Req … | ~~~~~~~~~~~~~ | 'Install-Module -Name AzAPICall -RequiredVersion False' failed

I've tried to remove AzAPICall and install the ast one, but it still failling

PS /home/cloud> Get-InstalledModule -Name AzAPICall -AllVersions Version Name Repository Description


1.1.52 AzAPICall PSGallery Azure API call handler for Microsoft Graph, Azure Resource Management, KeyVa… 1.1.45 AzAPICall PSGallery Azure API call handler for Microsoft Graph, Azure Resource Management, KeyVa… 1.1.50 AzAPICall PSGallery Azure API call handler for Microsoft Graph, Azure Resource Management, KeyVa…

Could you help ?

Thanks Nicolas

bovrhovn commented 1 year ago

We had the same challenge after upgrading PWSH to last version. Re-Installing the module (removing it before) or use -Force flag and then calling Connect-AzAccount again to refresh the creds. Then call script again. It worked for us.

itsjuha commented 1 year ago

what platform is this - a simple Linux worker or a AzDO pipeline / GH Action ?

merlin145160 commented 1 year ago

Hi @itsjuha and @bovrhovn, I am using AzGovViz in WSL2 ubuntu with security constraint environment and CSP environment. I would love to be able to run it with AzDO pipeline or GH Action but I fail to setup graph API with CSP. So I am running it with global reader account. After removing all AzAPICall (Uninstall-Module AzAPICall) and restart pwsh, I've re-install new 1.1.53 AzAPICall, I was able to run it again. Thanks for your help.

JulianHayward commented 1 year ago

hi @merlin145160 I´d like to better understand the csp related issue, please ping me on LinkedIn so we can take a look?

JulianHayward commented 1 year ago

@merlin145160 strike :)