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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Johanno
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors