Closed tbish967 closed 2 years ago
Hi everyone,
Just a quick update - I've confirmed that this is an issue with Az.Accounts 2.8.0, and specifically the AzureSessionInitializer code here:
It looks like module imports lock PSConfig.json and cause concurrent ones to fail.
Thanks for reporting. @isra-fel , let's fix it in upcoming release.
Yes, confirmed that switching the Az.Accounts module to an older version resolved our issue.
Install-Module -Name Az ;
Uninstall-Module -Name Az.Accounts -AllVersions ;
Install-Module -Name Az.Accounts -RequiredVersion 2.7.6 -Force -Verbose ;
I seem to also have this new error relating to psconfig.json
Import-Module: The process cannot access the file 'C:\Users\<user>\.Azure\PSConfig.json' because it is being used by another process.
.: The script 'Get-PimRole.ps1' cannot be run because the following modules that are specified by the "#requires" statements of the script are missing: Az.Resources.
commenting to follow.
@brwilkinson Hi Ben, if the issue persists, or if you have more info, could you submit a new issue so that I can follow up? Thanks.
Thanks @isra-fel I saw this a few times. Will keep an eye and provide more info if persists. I wanted to drop a note if others have the similar issue.
I am getting this error in WAC
We are still having this issue
Is there any update on this?
Description
The Az module cannot be imported by jobs running in parallel because of contention for access to the ~/.azure/psconfig.json file, as seen in the first error line in the debug output. This seems like a recent issue, since our organization first saw it on 5/24, but I've seen it on both the current PS5 version and a version released before 5/24, so there might be some external factor.
This may also happen with multiple session - it behaves like an issue with the filesystem, rather than the individual Powershell session. I've tried this with delays between jobs, and this resolves the issue, but isn't a reliable fix since module imports vary in timing, so concurrent jobs importing any module dependent on Az will intermittently fail.
Issue script & Debug output
Environment data
Module versions
Error output