The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi! We connect to Azure AD using this URL. The query looks like:
let
token_uri = "https://login.windows.net/" & "9c8e48932-4282ad2a" & "/oauth2/token",
resource="https://graph.microsoft.com",
tokenResponse = Json.Document(Web.Contents(token_uri,
[
Content = Text.ToBinary(Uri.BuildQueryString(
[
client_id = "ae46c5352352352352353914",
resource = resource,
grant_type = "client_credentials",
client_secret = "asdfdfsdfasdfsadfadsf"
]
)),
Headers = [Accept = "application/json"], ManualStatusHandling = {400}
])),
access_token = tokenResponse[access_token],
Source = OData.Feed("https://graph.microsoft.com/beta/users?$top=999&$select=id, deletedDateTime, accountEnabled, AgeGroup, assignedLicenses, assignedPlans, businessPhones, city, companyName, consentProvidedForMinor, country, createdDateTime, creationType, department, deviceKeys, displayName, employeeHireDate, employeeId, employeeOrgData, employeeType, externalUserState, externalUserStateChangeDateTime, faxNumber, givenName, identities, imAddresses, infoCatalogs, isResourceAccount, jobTitle, lastPasswordChangeDateTime, legalAgeGroupClassification, licenseAssignmentStates, manager, mail, mailNickname, mobilePhone, officeLocation, onPremisesDistinguishedName, onPremisesDomainName, onPremisesExtensionAttributes, onPremisesImmutableId, onPremisesLastSyncDateTime, onPremisesProvisioningErrors, onPremisesSamAccountName, onPremisesSecurityIdentifier, onPremisesSyncEnabled, onPremisesUserPrincipalName, otherMails, passwordPolicies, passwordProfile, postalcode, preferredDataLocation, preferredLanguage, provisionedPlans, proxyAddresses, refreshTokensValidFromDateTime, showInAddressList, signInSessionsValidFromDateTime, state, streetAddress, surname, usageLocation, userPrincipalName, userType", [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"}, ODataVersion = 4, Implementation = "2.0" ]),
#"Expanded manager" = Table.ExpandRecordColumn(Source, "manager", {"id"}, {"manager.id"})
in
#"Expanded manager"
I get all the information from AD but the thing that doesn't work is expanding record manager with the error:
Has anyone succeded getting information about manager for each person from Azure AD?
Thank you in advance,
Johan
To my understading this was only security related information and not Azure AD, also the Microsoft Graph Security connector is deprecated as of May 2021. So as of now, it seems we can collect everything we need from Azure AD but we can't expand the manager id for some reason.
Thank you I will give it a try. Strange is that on one computer I don't find this connector at all (updated 27th of August) and on my other computer (updated 17th of Augusti) I find a similar "CustomConnectorGraph.Contents (beta)". I will look further into this and reply.
How can we query Azure AD information from Power BI?
@Johanno
Not sure about that method, but to connect to Microsoft graph, there is a default connector:
Connect to the Microsoft Graph Security API in Power BI Desktop - Power BI | Microsoft Docs
Paul Zheng _ Community Support Team
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.