Closed MoChilia closed 7 months ago
Resolved in Az.Accounts 2.16.0
.
See https://github.com/Azure/azclitools-actions-test/actions/runs/8340363505/job/22824150533
I have the same problem on Windows. Using mainly PS core 7.4.2, but I get the same result in 5.1.
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.17.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Get-AzContext -ListAvailable -Debug
DEBUG: 10:04:28 - GetAzureRMContextCommand begin processing with ParameterSet 'ListAllContexts'.
DEBUG: 10:04:28 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:04:28 - [ConfigManager] Got nothing from [DisableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 10:04:28 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
Get-AzContext: Object reference not set to an instance of an object.
DEBUG: 10:04:28 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:04:28 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:04:28 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.17.0; CommandName: Get-AzContext; PSVersion: 7.4.2; IsSuccess: False; Duration: 00:00:00.0342198; Exception: Object reference not set to an instance of an object.;
DEBUG: 10:04:29 - GetAzureRMContextCommand end processing.
Description
Get-AzContext -ListAvailable
failed with errorObject reference not set to an instance of an object
. Az: 9.3.0 Az.Accounts: 2.15.1 PSVersion: 7.4.1Workflow file
The azure account should be valid and logged successfully since
Get-AzContext
works well.Update:
Get-AzContext -ListAvailable
failed in both GitHub Action and local terminal inAz.Accounts 2.15.1
.Issue script & Debug output
Environment data
Module versions
Error output