Reputation: 464
How can I use AZ commands to create client secret the same way I can do it from the portal?
Upvotes: 24
Views: 23377
Reputation: 3156
Get ID Client of app register for example: "appId": "b23e2416-xxxx-xxxx-98d4"
Create:
az ad app credential reset --id b23e2416-xxxx-xxxx-98d4 --append \
--display-name 'Description: Secret Bolivian client' --end-date '2024-12-31'
Output:
The output includes credentials that you must protect.
Be sure that you do not include these credentials in your code or check the credentials into your source control.
For more information, see https://aka.ms/azadsp-cli
{
"appId": "b23e2416-xxxx-xxxx-98d4",
"password": "rp28Q~VNlFt-xxxxxxxxxxxxxxxxxxxxxxx",
"tenant": "67f3b853-xxxx-xxxx-xxxx"
}
Upvotes: 0
Reputation: 42063
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
Upvotes: 31