In this Power Apps Tutorial, We will discuss what is Azure AD in PowerApps, What are the various issues and limitations in Power Apps Azure.
Also, We will see what are the actions that you can use for PowerApps Azure AD. By taking a simple scenario, We will discuss how we can get the azure groups in PowerApps using PowerApps Azure AD Connectors.
And also, We will cover these below topics:
- How to get azure group members in PowerApps
- Get azure ad user in PowerApps
- Power Apps Azure AD get user information (Job Title and Location)
- PowerApps check if user is in Azure ad group or PowerApps Filter and check users belong to Azure Ad Group
PowerApps Azure AD
- Microsoft Azure Active Directory (Azure AD) is a cloud based identity and access management service.
- Azure AD helps to employees sign in and access resources in external resources. To work with the Azure AD connector, some administrator permissions required. Such as:
- Group.ReadWrite.All
- User.ReadWrite.All
- Directory.ReadWrite.All
Various issues and limitations in PowerApps Azure AD
There are some issues and as well some limitations in PowerApps Azure AD. Such as:
- The connector does not support Mail-Enabled Security groups.
- AAD groups with the attribute “isAssignableToRole” are not supported for now.
- The connector does not return custom attributes of Azure AD entities.
Read Upload PowerApps Attachments to SharePoint Library Folder
PowerApps Azure AD Actions
The below table represents some of the important actions that are present in the PowerApps Azure AD Actions.
Actions | Description |
Add user to group | It helps to add a user to a group in this AAD tenant. |
Assign manager | It helps to assign a manager for a user. |
Check group membership (V2) | It specifies if the user is a member of the given group, then the result will contain the given id. Otherwise, the result will be empty. |
Check group membership [DEPRECATED] | Here this action has been deprecated. Please use Check group membership (V2) instead. |
Create group | This action helps to create a group in your AAD tenant. |
Create Office 365 group | This action helps to create an Office 365 group in your AAD tenant. |
Create security group | This action helps to create a security group in your AAD tenant. |
Create user | This action helps to create a new user in your AAD tenant. |
Get group | It helps to retrieve the details for a group. |
Get group members | It helps to get the users who are members of a group. |
Get groups of a user (V2) | It helps to get the groups a user is a member of. |
Get groups of a user [DEPRECATED] | This action has been deprecated. Please use Get groups of a user (V2) instead. |
Get user | It helps to retrieve all the details for a user. |
Refresh tokens | It helps to invalidate all refresh tokens for a user |
Remove Member From Group | It helps to remove Member From Group |
Update user | It helps to update the info for a user. |
Connect Azure AD Connector in PowerApps
Now we will see how to connect the Azure AD connector in Power Apps.
- As we discussed, whenever you are creating the Azure AD app, you must need to connect the Azure AD connector to the PowerApps.
- To connect the Azure AD in the app, go to the Data tab (from the left navigation pane) -> + Add data -> Search Azure AD in the search box as shown below.
- Click on the Azure AD connector and then tap the Connect button. Once you will click on it, then the Azure connector will connect to the app. Without an Azure AD connector, it is not possible to work with Azure related things in the app. Now the connector is ready to use.
PowerApps Azure AD get all groups
Do you want to retrieve all the Azure AD groups in PowerApps? Check out the below scenario to achieve it easily.
- The below screenshot represents all the Azure groups that are present in the Azure portal. Now I would like to display all these Azure groups in PowerApps.
- For this, insert a Combo box control and a Button control to the app. When a user will press the button (named Hit and Get Azure Groups), all the Azure groups will retrieve and display in the combo box control.
- To achieve this, select the Button (Hit and Get Azure Groups) and apply the below formula on its OnSelect property as:
OnSelect = ClearCollect(
ColAzureGroups,
AddColumns(
AzureAD.GetMemberGroups(
User().Email,
false
).Value,
"AzureGroupName",
AzureAD.GetGroup(Value).displayName
)
)
Where,
- colAzureGroups = Specify a Collection name. Refer to this link to get more information about collection: Power Apps Collection
- AddColumns = PowerApps AddColumns function helps to add a column to a table. To know more details about AddColumns function, you can refer to this link: PowerApps AddColumns
- “AzureGroupName” = Provide a new column name where all the Azure groups will store
- Next, select the Combo box control and set its Items property to the collection name as:
Items = ColAzureGroups
- After all, you need to specify the new column name (AzureGroupName) in the Combo box’s DisplayFields and SearchFields properties as:
DisplayFields and SearchFields = ["AzureGroupName"]
Refer to the below screenshot.
- Now save and preview the app. When the user will hit the Button (Hit and Get Azure Groups), then all the Azure groups will retrieve and display in the combo box control.
This is how we can work with PowerApps Azure AD to get all groups.
PowerApps azure get group members
In this scenario, We will see how to get all the Azure group members in PowerApps.
- To do this, add a Dropdown control and apply the below code on its Items property as:
Items = AzureAD.GetGroupMembers("af641583-a427-409c-9ca1-8411d4b87a22").value
Where,
“af641583-a427-409c-9ca1-8411d4b87a22” = Provide Azure group ID that contains all the group members. You need to specify the group ID within the inverted comma (” “) including the .value
- Save, Preview, and Close the app. Reopen the app again and click on the chevron symbol. You can able to view all the group members of the specific group (the ID that has specified by the user).
This is how to work with PowerApps azure get group members.
PowerApps get azure ad user
Do you want to get Azure AD Directory Users or to get Azure active directory users within the canvas app? Go through the below simple scenario.
- As you can see in the below screenshot, there is a text input control, a Button input, and a Datatable control.
- A user will enter the Azure Active Directory user ID and press the button (GET). Once the user will press it, it will retrieve all the user details and display in the data table control as shown in the below screenshot.
- To work around with this, select the button control (GET) and apply the below formula on its OnSelect property as:
OnSelect = ClearCollect(
colAzureUserDetails,
AzureAD.GetUser(txtAzureID.Text)
)
Where,
- colAzureUserDetails = Specify a collection name
- txtAzureID = Provide the text input control name. Here you need to enter the Azure active directory user ID
- Next, apply the collection name in the Data table’s Items property as:
Items = colAzureUserDetails
- If you want to view more user details (like id, Profile, Location, etc) in the Data table, then you can add it by using + Add field option as like below.
- Save, preview the app and do the performance as per your need. This is how we can work with PowerApps to get azure ad users.
Azure AD get user information (Job Title and Location) in PowerApps
- In this scenario, I would like to get the user job title and office location and many more information from Azure AD.
- As we know, in PowerApps, to get the Azure user, We are using Get.User() method. But in some cases you may want to retrieve more user information like user email, user id, user display name, then in that case, you may follow the below formulas.
- Here in the below screen, I have retrieved two different user information as Job Title and Office Location.
PowerApps Azure AD get User Job Title
- To get the Azure user job title, you can apply the below formula to Label’s Text property as:
Text = "Job Title: " & AzureAD.GetUser(User().Email).jobTitle
- If you want to get the currently logged-in user information, then you need to specify as User().Email. Otherwise, you can apply the below code:
Text = "Job Title: " & AzureAD.GetUser("User-Email-Address").jobTitle
Refer to the below screenshot.
PowerApps Azure AD get User Location
- To get the Azure user office location, you can apply the below formula to Label’s Text property as:
Text = "Office Location: " & AzureAD.GetUser(User().Email).officeLocation
Refer to the below screenshot.
- Not only you can get the user’s Job title and Office location, but also you can try the below parameters to get the user info like:
- displayName
- givenName
- id
- mobilePhone
- preferredLanguage
- surname
- userPrincipalName
- businessPhones
PowerApps check if user is in Azure ad group
Suppose you want to filter and check the record if the currently logged-in user belongs to a member of a specified Azure Ad group or not, then in that case you can try the below things:
PowerApps check if the user is in the Azure ad group
Also, you may like the below PowerApps Tutorials:
- Power Apps RSS Feed
- PowerApps Weather
- PowerApps Twitter Connector
- Power Apps Calculate + 13 Examples
- Build a Calculator in Power Apps
- Power Apps Rating Control – How to use
- Power Apps Slider Control
- Power Apps Gallery Pagination
- Power Apps Data Table – Complete tutorial
- Migrate PowerApps from one tenant to another
- Power Apps Export Import Control – How to use
- Power Apps PDF Viewer – Complete tutorial
- How to use date time picker in PowerApps
- Power Apps Gallery Control – Helpful tutorial
- Power Apps Dropdown Control – How to use
In this Power Apps Tutorial, We discussed what is Azure AD in PowerApps, What are the various issues and limitations in PowerApps Azure.
Also, We saw what are the actions that you can use for PowerApps Azure AD. By taking a simple scenario, We discussed how to get the azure groups in PowerApps using PowerApps Azure AD Connectors.
And also, We covered these below topics:
- PowerApps get azure group members
- PowerApps get azure ad user
- PowerApps Azure AD get user information (Job Title and Location)
- PowerApps check if user is in Azure ad group or PowerApps Filter and check users belong to Azure Ad Group
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
perfect sir.
I wonder if there is a straightforward way like this to fetch the group ID using group name – that was pulled earlier using AzureAD.GetMemberGroups – so everything will be automated?