How to add the new key to the Service Principal in AAD?

Sometimes you will need a new key for the existing principal in the Azure Active Directory. This can be done in the portal of by using the AZ CLI.

This example shows how to add a new key on the existing principal:

az ad sp credential reset --id ***** --append

This is the output of the command:

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": "",
"password": "YOUR NEW KEY",
"tenant": ""
}