SP Display Name and SP ID are not interchangeable
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62
**Describe the bug**
When connecting up a service principal for terraform and AZ CLI to log in and do things, it will not recognize the SP by its human readable identifier. The only ID it takes is the appID
**To Reproduce**
```
[ bagira @ forge.silogroup.lan ] << ~ >>
[- az ad sp show --id='tf-appgw'
Service principal 'tf-appgw' doesn't exist
[ bagira @ forge.silogroup.lan ] << ~ >>
[- az ad sp show --id='8ae414df-e6b2-47fb-982c-f6b94c3be002'
{
"accountEnabled": "True",
"addIns": [],
"alternativeNames": [],
"appDisplayName": "tf-appgw",
"appId": "8ae414df-e6b2-47fb-982c-f6b94c3be002",
"appOwnerTenantId": "0a6d54f1-b47a-4bd1-99a7-e8577b8c0bee",
"appRoleAssignmentRequired": false,
"appRoles": [],
"applicationTemplateId": null,
"deletionTimestamp": null,
"displayName": "tf-appgw",
"errorUrl": null,
"homepage": null,
"informationalUrls": {
"marketing": null,
"privacy": null,
"support": null,
"termsOfService": null
},
"keyCredentials": [],
"logoutUrl": null,
"notificationEmailAddresses": [],
"oauth2Permissions": [],
"objectId": "70ad2848-8d41-4f06-94de-a82cba50d8a4",
"objectType": "ServicePrincipal",
"odata.metadata": "https://graph.windows.net/0a6d54f1-b47a-4bd1-99a7-e8577b8c0bee/$metadata#directoryObjects/@Element",
"odata.type": "Microsoft.DirectoryServices.ServicePrincipal",
"passwordCredentials": [],
"preferredSingleSignOnMode": null,
"preferredTokenSigningKeyEndDateTime": null,
"preferredTokenSigningKeyThumbprint": null,
"publisherName": "Default Directory",
"replyUrls": [],
"samlMetadataUrl": null,
"samlSingleSignOnSettings": null,
"servicePrincipalNames": [
"8ae414df-e6b2-47fb-982c-f6b94c3be002"
],
"servicePrincipalType": "Application",
"signInAudience": "AzureADandPersonalMicrosoftAccount",
"tags": [
"WindowsAzureActiveDirectoryIntegratedApp"
],
"tokenEncryptionKeyId": null
}
```
**Expected behavior**
az cli to show the same result when using either the SP's displayName attribute or appId attribute.
**Environment summary**
az-cli installed via rpm on amd64 linux systems, though this issue is going to be on the platform end.
**Additional context**
The service principal concept in general is non-standard and broken.
Contributor guide
Assessment
This issue has not been assessed yet.