Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don'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.

Reply
Johanno
Continued Contributor
Continued Contributor

Microsoft Graph - Azure AD - manager specifically

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:

DataSource.NotFound: OData: Request failed (404)

 

Has anyone succeded getting information about manager for each person from Azure AD?

 

Thank you in advance,

Johan

 

4 REPLIES 4
Johanno
Continued Contributor
Continued Contributor

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.

Johanno
Continued Contributor
Continued Contributor

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?

V-pazhen-msft
Community Support
Community Support

@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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors