Azure / Azure/azure-powershell

Running Get-AzADServicePrincipal -ObjectId fails

Open
#23,073 2 comments 0 reactions 0 assignees View on GitHub
Azure PS Team bug customer-reported Graph.Microsoft needs-team-attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Running Get-AzADServicePrincipal -ObjectId fails

ObjectId is not being returned from command line

### Issue script & Debug output

```PowerShell
Az.MSGraph.internal\Get-AzADServicePrincipal : Resource 'd3043b4c-55be-42db-b5ff-2896f68b7a8e' does not exist or one of its queried reference-property objects are not present.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.2.0\MSGraph.Autorest\custom\Get-AzADServicePrincipal.ps1:208 char:5
+ Az.MSGraph.internal\Get-AzADServicePrincipal @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = d3043b4c...= , Expand = }:<>f__AnonymousType4`4) [Get-AzADServicePrincipal_Get], Exception
+ FullyQualifiedErrorId : Request_ResourceNotFound,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.GetAzADServicePrincipal_Get
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 5.1.19041.3031
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3031
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.10.1 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script 6.2.0 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment...}
```

### Error output

```PowerShell
Message : [Request_ResourceNotFound] : Resource 'd3043b4c-55be-42db-b5ff-2896f68b7a8e' does not exist or one of its queried reference-property objects are not present.
StackTrace :
Exception : System.Exception
InvocationInfo : {Get-AzADServicePrincipal_Get}
Line : Az.MSGraph.internal\Get-AzADServicePrincipal @PSBoundParameters

Position : At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.2.0\MSGraph.Autorest\custom\Get-AzADServicePrincipal.ps1:208 char:5
+ Az.MSGraph.internal\Get-AzADServicePrincipal @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 11
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.