Graph API addPassword - Secret not shown in portal

Stephen Hemby 0 Reputation points
2023-04-13T19:28:09.4866667+00:00

I was exploring the use of the Graph API in conjunction with a Logic App to regenerate application secrets. I get a successful response back from the API with the new secret information, however, when navigating to the application in the portal I don't see any secrets associated with the SPN. The activity log on the application shows that the SPN had passwords added successfully. Why is this?
This is the API I'm calling https://graph.microsoft.com/v1.0/servicePrincipals(appId='{id}')/addPassword and this is the 200 response I get.

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential",
  "customKeyIdentifier": null,
  "displayName": "testsecret",
  "endDateTime": "2023-07-13T00:00:00Z",
  "hint": "hidden for post",
  "keyId": "hidden for post",
  "secretText": "hidden for post",
  "startDateTime": "2023-04-13T00:00:00Z"
}
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
{count} votes

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.