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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors