0
votes

We are using API key to call custom API from B2C custom policy as part of seamless migration. We are looking for automated way to rotate policy key.

I have tried following C# code using graph client and its updating new key but wanted to know if there is PS command to perform similar kind of operation?

C# code:

var result = graphClient.TrustFramework.KeySets["B2C_1A_keyset"]
                .UploadSecret(use, k, nbf, exp)
                .Request()
                .PostAsync().Result;

            if (result != null)
                Console.WriteLine("Updated policy key secret");
1

1 Answers

0
votes

Follow this guidance on best practices Policy key management with Azure AD B2C.

Use any sample that does REST API calls via C# and follow these two docs to call the correct Microsoft Graph endpoint: