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
Anonymous
Not applicable

Getting photo from Azure Active Directory to Power BI/Query

Hi!

 

I am trying to get data from Azure Active Directory to Power BI Desktop. I though that would be easy through the Active Directory Connector. But that wasn't easy. After spending to much time on that I come over using Azure AD Graph in stead. That seems to work and the graph explorer was helpful. 

https://graph.windows.net/{mytenant.Onmicrosoft.com}/users?api-version=1.6 gave me all users data. See code below. Take note of the field thumbnailPhoto@odata.mediaEditLink, it is a part of link to the picture. Adding https://graph.windows.net/{mytenant.Onmicrosoft.com}/ before this text we got a correct address to the picture. Then I though I could create this code below to get the picture perhaps as Base64 binary code, and hopefully could add this field in a chiclet slicer component or something to show the picture. The code below gave me an error

 

DataFormat.Error: We found extra characters at the end of JSON input.
Details:
Value=
Position=0

 

Perhaps it is a better way to get photos on power bi service/office365, but if any of you have a clue what is wrong and how to correct this I would be grateful

 

Regards Geir

 

 

let

    Source = Json.Document(Web.Contents("https://graph.windows.net/mytenant.OnMicrosoft.com/directoryObjects/af894aa1-9fad-4400-818b-580c7258a115/Microsoft.DirectoryServices.User/thumbnailPhoto?api-version=1.6")),
       value = Source[value],
    ConvertedtoTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
 
    in

    ConvertedtoTable

 

1 REPLY 1
dax
Community Support
Community Support

Hi geirf,

If you want to add image to powerbi  from AAD, you could try to refer to Add Photos to Power BI from Active Directory for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.