CRM Crate

How to create a user in Azure AD using Power Automate?

We will learn to automatically create a user in Azure AD using Power Automate flow. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field Microsoft power platform.

Active Directory Power Automate

What is Azure Active Directory?

Azure Active Directory, also called Azure AD is a cloud-based Identity as a Service (IDaaS) multi-tenant solution by Microsoft. It is the backbone of the Office 365 system and allows organizations of varying sizes and applications like Concur, Salesforce.com, ServiceNow, etc. to enable Single Sign-On (SSO). Azure Active Directory can also provide easy integration and identity solutions for organizations that want to build their own applications.

The most prominent benefit is that an orginazation can manage its security, identity, and compliance controls across the enterprise through a single place using the Azure Active Directory.

Who uses Azure AD?

Azure AD is intended for:

  • IT admins –  As an IT admin, you can use Azure AD to control access to your apps and your app resources, based on your business requirements.
  • App developers – As an app developer, you can use Azure AD as a standards-based approach for adding single sign-on (SSO) to your app, allowing it to work with a user’s pre-existing credentials.
  • Microsoft 365, Office 365, Azure, or Dynamics CRM Online subscribers – As a subscriber, you’re already using Azure AD. Each Microsoft 365, Office 365, Azure, and Dynamics CRM Online tenant is automatically an Azure AD tenant.

Why do we need automatically create the users in Azure AD?

Consider a business scenario where we need to bulk create the users in Azure Active Directory as per the desired business logic instead of creating them manually. We can achieve this bulk user creation functionality with the help of the below given solution.

Power Automate connector for user creation –

We will leverage Microsoft’s Power Platform (Power Automate) for implementing an automatic Azure AD user creation process.

Power Automate Connector & Actions:

We will use the “Azure AD” Power Automate connector & the below given actions for achieving the automatic user creation.

Create User

You can create a new user in your AAD tenant with help of the “Create User” action.

Below are the details of the required action parameters –

NameKeyRequiredTypeDescription
Account EnabledaccountEnabledTruebooleanTrue if the new account should be enabled when it is created.
Display NamedisplayNameTruestringThe name displayed in the address book for the user.
Mail NicknamemailNicknameTruestringThe mail alias for the user.
PasswordpasswordTruestringThe password for the user. The user will be required to change the password on the next login.
User Principal NameuserPrincipalNameTruestringThe user principal name (UPN) of the user.
Given NamegivenNamestringThe user’s given name (first name).
SurnamesurnamestringThe user’s surname (family name or last name).
Business PhonebusinessPhonesstringBusiness phone number for the new user in any format such as ‘1 (234) 567-8910’.
DepartmentdepartmentstringThe name for the department in which the user works.
Job TitlejobTitlestringThe user’s job title.
Mobile PhonemobilePhonestringThe mobile phone number for the user in any format such as ‘1 (234) 567-8910’.
Office LocationofficeLocationstringThe office location in the user’s place of business.
Preferred LanguagepreferredLanguagestringThe preferred language for the user. Should follow ISO 639-1 Code; for example ‘en-US’.

Add User To A Group –

You can add a user to a group in your AAD tenant.

Below are the details of the required action parameters –

NameKeyRequiredTypeDescription
Group IdidTruestringUnique identifer of a group (Ex. ‘40639f36-46a6-73a6-91e2-9584b7913429’).
User Id@odata.idTruestringUnique identifer of a user (Ex. ‘5e6cf5c7-b511-4842-6aae-3f6b8ae5e95b’).

Power Automate Flow:

The below given flow has been triggered with a HTTP request where the parameters required by the above-mentioned actions are been passed inside the request’s body.

This HTTP based Power Automate flow has been called from Dynamics 365 CRM form.

Validate the implementation in Dynamics 365

Once the above given Power Automate flow has been saved & configured, validate the automated user creation implementation in your environment as shown below.

Thus, we learned to automatically create a user in Azure Active Directory using Power Automate flow.

5 1 vote
Article Rating
Subscribe
Notify of
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Julien
14 days ago

Thanks for sharing, could you please show us how u have called the flow by pressing the button and the spinner that waits until the user is created?

Prashant Tirlotkar
13 days ago
Reply to  Julien

Hi Julien,

This Power Automate flow has been trigger using a HTTP request connector.

Please refer the given link to understand the concept further – https://www.crmcrate.com/power-automate/dynamics-365-call-a-power-automate-flow-from-the-javascript/#more-4823

Thanks.

Prashant Tirlotkar
13 days ago

Also refer the given link to understand how I displayed the loading screen (Spinner) – https://www.crmcrate.com/javascript/how-to-display-a-progress-indicator-or-loading-screen-in-dynamics-365/

error: CRM Crate Security Engine - Disabled Right Click & Selection!

Congratulations!

Well Done,
Welcome to CRM Crate

Stay tuned with us and get all latest updates and learning in Microsoft CRM and related techonologes.

Practise EXams

Free!!

Sharpen your skills with our free practise exams.