Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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