azure-powershell
azure-powershell copied to clipboard
Get-AzADAppCredential > MSGraph.Autorest: Object reference not set to an instance of an object
Description
I've hit Object reference not set to an instance of an object. on a script. But I have a hard time reproducing it. All runs are doing fine today.
I'm using module Az version 8.1.0 as you can see in the trace.
Issue script & Debug output
69 | $x.value | ForEach-Object -Parallel {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The running command stopped because the preference variable
| "ErrorActionPreference" or common parameter is set to Stop:
| x > Update-X unexpected failure. With stack
| trace error: 'at Get-AzADApplication<Process>,
| /usr/share/az_8.1.0/Az.Resources/6.0.1/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1: line 1065 at Get-AzADApplication<Process>, /usr/share/az_8.1.0/Az.Resources/6.0.1/MSGraph.Autorest/custom/Get-AzADApplication.ps1: line 208 at Get-AzADAppCredential<Process>, /usr/share/az_8.1.0/Az.Resources/6.0.1/MSGraph.Autorest/custom/Get-AzADAppCredential.ps1: line 103 at Get-AzADAppCredential<Process>, /usr/share/az_8.1.0/Az.Resources/6.0.1/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1: line 1444 at Update-X, /agent/_work/3/.../platform/somescript.psm1: line 170 at <ScriptBlock>, <No file>: line 37'.
Line 170 in somescript.psm1 is: $oldCredentials = Get-AzADAppCredential -ApplicationId $adApplicationObject.AppId | Where-Object { $_.DisplayName -eq $keyDisplayname }
Environment data
Can't reproduce right now.
Module versions
Can't reproduce right now.
Error output
No response
@VeryEarly , do you have any insight to this error message?
Hi @erwinkramer this looks related with PowerShell "ForEach-Object -Parallel", we cannot identify the root cause from Get-AzADAppCredential if no further detail provided.
If the issue comes from line of Get-AzAdAppcredtial | Where-Object, I believe other Get-{} cmdlet with the same pattern should have similar issue.
@erwinkramer , let's keep this issue open for a while. If you hit the issue again, please share to us.
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!