azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az ad app credential list --id xxxxx - not listing 'certificate' type details

Open paulpuvi06 opened this issue 6 years ago • 4 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug I am trying to get credentials list of my APP using **az ad app credential list --id ** , but it returns only client secret list.

To Reproduce Create AD SP Upload certificate to SPN and execute

az ad app credential list --id <applicaitonid>

az ad sp credential list --id <applicaitonid>

Expected behavior

it should return all type of credentials belongs to specific applicationid. i am able to get the types (AsymmetricX509Cert,Password) using below commands in pwsh, but really want to use az cli for --show-mine filter :)

Get-AzADApplication -ObjectId "xxxxxx" | Get-AzADAppCredential

Environment summary

azure-cli - 2.0.70 * | mac os 10.14.5 (18F132)

paulpuvi06 avatar Aug 16 '19 20:08 paulpuvi06

https://github.com/Azure/azure-cli/blob/c935aa431e4871979f1be2e5dd5cf2902eaca319/src/azure-cli/azure/cli/command_modules/role/custom.py#L1143

cert is False by default, so list_password_credentials is called. To get certificates listed, append --cert, so that CLI calls list_key_credentials.

az ad app credential list --id xxxx --cert

Also see: https://docs.microsoft.com/en-us/cli/azure/ad/app/credential?view=azure-cli-latest

jiasli avatar Aug 20 '19 07:08 jiasli

yes ! it works . it would be great if "az ad app credential list --id xxxx " returns both type of credentials which is easier to prepare reports rather than writing loops in script. can this be considered as feature request ?

paulpuvi06 avatar Aug 20 '19 10:08 paulpuvi06

Sure. We will discuss with our PM.

jiasli avatar Aug 23 '19 03:08 jiasli

yes ! it works . it would be great if "az ad app credential list --id xxxx " returns both type of credentials which is easier to prepare reports rather than writing loops in script. can this be considered as feature request ?

what would be greater would be adding this information to the documentation. current verbiage: --cert A certificate based credential.

suggested verbiage: --cert Show certificate based credentials only. (absence of flag will show password credentials only)

chrishayescodes avatar Aug 12 '22 20:08 chrishayescodes

This is updated

RakeshMohanMSFT avatar Oct 13 '22 09:10 RakeshMohanMSFT