Azure Graph API transaction

jubing long 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.

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,579 questions
{count} votes

Accepted answer
  1. James Hamil 12,976 Reputation points Microsoft Employee

    Hi @jubing long , 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