Azure / Azure/azure-cli

Can you add notes or example about how to retrieve data from the app "manifest"?

Open
#23,402 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-identity-squad Auto-Assign Azure CLI Team feature-request Graph
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

I'm not sure if this is a product or documentation issue but if the issue is confirmed I think they could both be improved.

I recently created a new service principal and wanted to get the application ids and object ids.

If I use the Azure cli, and use commands similar to show on the page, I would do something like this:

```powershell
az ad sp show --id bf360302-7aa5-48fc-82af-859abdf922c1 --query "{appId:appId, id:id}"
```
Which returns
```
{
"appId": "bf360302-7aa5-48fc-82af-859abdf922c1",
"id": "11265b2a-86b0-455f-ae4e-2636e2016d70"
}
```

I thought the "id" here WAS the Object ID.
However, if I view that SAME service principal in Azure Portal, it shows the "Object ID" as a different GUID!!

I then removed the `--query` and returned the entire object and don't see the GUID from portal anywhere using the `az cli` result and am wondering where the Portal is getting this information.

If I view the "Manifest" in the Portal, I can see the "id" property is the "Object ID" guid.

**This would imply to me that the application manifest object is different than the azure resource object.**

1. Can you confirm the issue with `az cli` `sp show` command returning a different ID than the object id?
1. If it is different can you add a warning to the documentation page saying why
1. Can you add example showing how to return the application manifest for a service principal using the `az cli` so that I could retrieve the object id?

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: e99d25ff-03e2-e015-37f4-a29b59ec50d4
* Version Independent ID: 1a8e88ed-72c7-fbe7-b0ad-68f23b3946cd
* Content: [az ad sp](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest)
* Content Source: [latest/docs-ref-autogen/ad/sp.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/latest/docs-ref-autogen/ad/sp.yml)
* Service: **active-directory**
* GitHub Login: @rloutlaw
* Microsoft Alias: **routlaw**

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.