Skip to content

az ad app credential reset should result same format than az ad app credential listΒ #32307

@jikuja

Description

@jikuja

Related command
az ad app credential reset

The issue

Current implementation of az ad app credential reset drops some of the data that is returned by the MS Graph endpoint

Command output:

{
  "appId": "xxxx-84e4c88e4a08",
  "password": "yyyyyLMFQT2dt7",
  "tenant": "cccccccc8236f"
}

Endpoint payload:

{
  "@odata.context":"https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential",
  "customKeyIdentifier":null,
  "displayName":"uhassagyasygasasgy",
  "endDateTime":"2027-10-22T12:10:18Z",
  "hint":"xxx",
  "keyId":"xxxx-a7c6-fe8b991543a4",
  "secretText":"xxxxxT2dt7",
  "startDateTime":"2025-10-22T12:10:18Z"
}

Output of the list command

[
  {
    "customKeyIdentifier": null,
    "displayName": "uhassagyasygasasgy",
    "endDateTime": "2027-10-22T12:10:18Z",
    "hint": "xxx",
    "keyId": "xxxx-b2f4-45a4-a7c6-fe8b991543a4",
    "secretText": null,
    "startDateTime": "2025-10-22T12:10:18Z"
  }
]

Describe the solution you'd like
The Command should return data in same format than az ad app credential list to make scripting easier.

There is comment about return value format on _reset_credential. On potential solution could be making a new format optional by adding control flag for output generation

Describe alternatives you've considered

  • Calling Graph API directly.
  • Not outputting exact enddate and keyId as scripting return values

Additional context

# Keep backward compatibility
# TODO: Should we return the passwordCredential or keyCredential directly?
result = {
'appId': graph_object['appId'],
# 'keyId': key_id,
'password': password
}

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamGraphaz adcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions