Can I generate Azure AD Client Credentials Secrets using an API?

Vinay Shiva 1 Reputation point
2021-05-14T17:20:57.397+00:00

I want to use my Azure AD App Registration to create multiple Client Secrets. I saw that I can do it manually. However, I want to be able to do the same programmatically through an API. That brings me to the following 2 questions:

  1. Is there an API (Graph, or any other) which I can use to automate generation and deletion of the Client Secrets?
  2. Is there a limit on how many Client Secrets there can be within a single app?
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2021-05-14T17:37:39.8+00:00
    2 people found this answer helpful.
    0 comments No comments

  2. Marco von Hagen 6 Reputation points
    2021-05-14T18:10:46.533+00:00

    You can use PowerShell like so:

       New-AzureADApplicationPasswordCredential -ObjectId "YourAppObjectId"  
    

    Response:

       CustomKeyIdentifier :  
       EndDate             : 9/28/2017 3:57:10 PM  
       KeyId               :  
       StartDate           : 9/28/2016 3:57:10 PM  
       Value               : ZJ0V1Yg4cp4eWIey9DrYspqVdX1pdvY437P/ueGxVLU=  
    

    Find more in the [MSFT DOCS] (https://learn.microsoft.com/en-us/powershell/module/azuread/new-azureadapplicationpasswordcredential?view=azureadps-2.0#example-1--create-a-password-credential)

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.