Create AAD user and import to D365FO

In this blog post i will show how easy it is to create user in the Azure Active Directory and to import them into dynamics 365 for finance and operations as employee and user.

This can also be a part of a complete onboarding process for a company.

For my example I use as a trigger the virtual flow button but this can also be for example a sharepoint list where a new employee is added. My list in this post is an easy small excel sheet with some informations regarding the new employee.

The first action in my flow is to get the new employees for that we want to run the process.

Because we can have a lot of entries in the list we get an „Apply to each“ so that the process for each list entry.

The first action in the „Apply to each“ is to create the AAD user. For this we map the fields from the employee list (excel) to the Create User action.

Now we want to add the user to an office group to f.e. give him the needed licenses and security rights for his job. This is not part of this flow description.

After creating an AAD user we will create an employee in the human ressource management of Dynamics 365 for Finance and Operations. In my example I give him the start date of today which is done by the expression „utcnow()“.

After creating the employee I want to setup an user because the new employee will work with D365FO in his job.

To create the user I will refer to the created AAD user we have created some steps before. A necessary field to setup is the  type field otherwise you can’t create an user. In my flow I use „Claim User“.

At last you have to add a user role to the new user. In my example I give him the „System Administrator“ role.

Now the user can login to D365FO and can do his work there.

I hope this give you an idea about the possibilities of Microsoft Flow.

Feel free to get in contact with me via Twitter (@dynamiacs).