How can I use AZ commands to create client secret the same way I can do it from the portal?
Asked
Active
Viewed 1.6k times
1 Answers
29
You are looking for az ad app credential reset
, it appends or overwrites an application's password(i.e. client secret
) or certificate credentials.
az ad app credential reset --id
[--append]
[--cert]
[--create-cert]
[--credential-description]
[--end-date]
[--keyvault]
[--password]
[--years]
Sample(you can also specify other parameters, it depends on you):
az ad app credential reset --id xxxxxxxxxxxx --append

Joy Wang
- 39,905
- 3
- 30
- 54
-
What exactly does append do? Will it create a second secret? – Nicolai Sep 11 '19 at 05:55
-
2@Nicolai yes it creates an additional client secret every time you run it with --append – alv Jan 10 '20 at 20:24
-
1I get "Property identifierUris is invalid." no matter if I use powershell (AzureAD) or the Cli :/ – Johan Danforth Nov 16 '21 at 22:48
-
1Just in case anyone is equally confused, there can be a lag between running this command, and the new secret being visible in the Azure Portal. Also, you can use `--display-name` to set a Description. – Mike Mar 29 '23 at 15:36