Aram
Aram

Reputation: 5705

How to create a user (work account) with specified directory role in Azure Active Directory Graph API

I'm trying to find out a way to create a User (work account) with specified DirectoryRole in Azure Active Directory Graph API using one Azure AD Graph API call.

I can make two separate calls (one to create the user and one to assign the DirectoryRole) but is it possible to include the role in the POST user payload and assign the role in the same call?

Upvotes: 0

Views: 153

Answers (1)

Aram
Aram

Reputation: 5705

Apparently as of today, the Azure AD Graph REST Api is not able to create a user with a non-default directory role in one call

So we should make 2 separate calls To create a user and a second call to make the user a member of the Directory Role.

I didn't find any documentation around this, but had a chat with someone from AD team and he informed me of this.

Upvotes: 2

Related Questions