web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Import AAD users using API

(0) ShareShare
ReportReport
Posted on by 30

I'm trying to find a way to import Azure AD users to Dynamics 365 Finance & Operations (D365FO).

It is possible to get all system users using this endpoint (like using Postman):

/data/SystemUsers

However, not sure how the new user could be imported from Azure AD. If I go to D365FO UI I can do this using System administration -> Users -> Import users and there is an option to add users from AAD. Is there a way to do the same using API? Looking through the web was not very helpful so far.

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    You can create users through this entity. SecurityIdentifier is found in AAD based on Alias, NetworkDomain and AccountType, therefore make sure that you set values of these fields. (I found this information by looking into code of SystemUserEntity.)

    If you want to get a list of AAD users to select from, then you need an AAD API and not F&O API.

  • c4b14ca1-82ae-4ba1-81d9-375da19bad52 Profile Picture
    30 on at

    Thank you for your response.

    Finding a user using AAD API is not a problem, however is there some strict rule that one can rely on when adding a new AAD user to F&O? I mean how AAD user is liked to D365FO user and I can be sure that identities are linked?

    I've just checked those properties for existing users and I see that:

    Alias - looks like AAD UPN

    NetworkDomain - is set to "https://sts.windows.net/" for existing users and may be some other values for external users

    AccountType - looks like always has "ClaimsUser" value.

    So my concern is if I just try to create user and set Alias as AAD UPN, NetworkDomain as "https://sts.windows.net/" and AccountType = "ClaimsUser", will user be linked somehow to AAD? In this case it looks like magic :)

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    I wouldn't say that finding a user in AAD by name (UPN) isn't magical. That's what happens every time when I'm trying to log in and I type in my user name.

    Note that you can create a user in exactly the same way in GUI; using the function for importing from AAD is optional. If you know the user name and the AAD tentant, you can populate their values manually, instead of selecting them from the list loaded from AAD.

    As I mentioned, there is also the security identifier involved, but it's loaded automatically under the hood.

  • c4b14ca1-82ae-4ba1-81d9-375da19bad52 Profile Picture
    30 on at

    Thank you!

    I will do some tests around this and will write back, so if it works other people could get this information as well.

  • migi111 Profile Picture
    485 on at

    You don't need API to automate the user import from AAD to D365FO.  Just enable the ADD user groups from license configuration and configure the settings in System administration -> users -> Groups

  • c4b14ca1-82ae-4ba1-81d9-375da19bad52 Profile Picture
    30 on at

    Migi111, thank you, but isn't it in this case generates some unmeaningful ID like ‘$C0BA’, like described below? And user is actually gets created during the first logon:

    dynamicspedia.com/.../

  • migi111 Profile Picture
    485 on at

    That is correct, but you can rename the user afterwards. It's basically a question how often new users are generated.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi,

    You can use Microsoft Graph API to retrieve the Azure AD users. Use Postman with the Microsoft Graph API - Microsoft Graph | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans