Azure Graph API transaction

(Neusoft)龍 挙兵(Ryuu.Kixyoheyi) 121 Reputation points


I using Azure AD(free) to store user login information.
When I want change user's password in my application by application way(appID, appSecurity).
But changePassword not support application way.
So I send two graph api: first delete user, second add user.
But how can I keep the two times call all success or all failure. (in a transaction)
User user = graphServiceClient.users(id).buildRequest().get();
// first : delete the user

// second: add user
PasswordProfile passwordProfile = new PasswordProfile();
passwordProfile.forceChangePasswordNextSignIn = true;
passwordProfile.password = "Abc,123.";
user.passwordProfile = passwordProfile;

Best wishes.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,394 questions
{count} votes

Accepted answer
  1. James Hamil 21,546 Reputation points Microsoft Employee

    Hi @Anonymous , your workaround method seems a bit complicated. We should try to get changePassword working for you instead. Have you made sure that you have the appropriate permissions for this?


    Unless you're using the unsupported types, which I assume you are? Are you just trying to change the users passwords? Have you looked into SSPR? If not, please let me know what your use case is and I can find a better solution for you.


0 additional answers

Sort by: Most helpful