How to Map (Sync) profile photo from Azure AD

ahmed26
Tera Contributor

Hi Team,

We have requirment to map Profile photo from Azure to ServiceNow. Is it possible and anyone done it?

Thanks,

Ahamed Rahiman

23 REPLIES 23

hanaphouse
Giga Guru

Has anyone successfully implemented this after 3 years?

Yes. I have been successful in implementing this via the Flow Designer.

Requirements:

  • OAuth connectivity to MS Exchange from ServiceNow & a valid token response
  • Scope privileges - 'User.ReadWrite.All' (could perhaps get away with just read - go for RW first to be sure/safe)
  • Integration Hub license
  • Access to the following MS Graph API: https://docs.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0
    find_real_file.png
  • Access to AD User Principle Name data from within your instance of SN.

Method:

  • Flow Action which includes a REST step:
    find_real_file.png
  • Notice how we have check the box 'Save as Attachment'.
  • Now look up the sys_attachment record using the REST response (which will be the sys_id of the attachment record):
    find_real_file.png
  • Create an attachment record output:
    find_real_file.png
  • Now within your Flow apply the sys_id of the attachment record to both the sys_user and Live Profile tables:
    find_real_file.png

 

So, in summary:

  • ServiceNow to MS Graph with the right level of access
  • OAuth with valid token
  • Flow Integration Hub
  • Rest call - gets profile pic as attachment and gives you sys_id
  • Look up attachment record
  • Apply it to sys_user and live_profile tables

laavanya
Giga Contributor

Hello gputker,

 

Can you help us achieve syncing the user profile photo/Avatar from AZURE AD to ServiceNow?

 

Thanks!

gputker
Tera Contributor

Absolutely. What do you need in addition to what's above? 

laavanya
Giga Contributor

Your solution above explains getting photos from MS Exchange and I'm looking to import from Azure AD. Can you please help me achieve that?