Home > Software engineering >  Azure CLI - How to create a new client secret with a specific "Description"
Azure CLI - How to create a new client secret with a specific "Description"

Time:11-24

I used this command to create a client secret,

az ad sp create-for-rbac  -n my_app --years 99

but I found this command will create a new secret named "rbac" to override the old secret as below.

I want to create a new secret with a specific "Description", but I have not found any way in doc to do that.

CodePudding user response:

I tried to reproduce the same in my environment and got below results:

I ran the same command as you and got same response with rbac in Description like below:

az ad sp create-for-rbac -n my_app --years 99

enter image description here

To get these results from Azure CLI, you can use below command:

az ad app credential list --id <ApplicationID>

Response:

enter image description here

To create a new secret with a specific "Description", you can make use of below command:

az ad app credential reset --id <ApplicationID> --display-name <Enter description here> --append

I ran the above command and created new secret with description.

When I tried to list the secrets of that application, I got both client secret details successfully like below:

az ad app credential list --id <ApplicationID>

Response:

enter image description here

When I checked the same in Azure Portal, I can see the new client secret with description like below:

enter image description here

  • Related