web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / AD user authentication...
Power Apps
Unanswered

AD user authentication from PCF -> Azure Function -> Dataverse

(0) ShareShare
ReportReport
Posted on by 22
I have a model driven power app which contains a PCF control embedded on a form.  That PCF control needs to execute an Azure Function (with an HTTP trigger) to perform some complex processing, and that processing requires the Azure Function to access a number of records in Dataverse.

 

I need the Azure Function to access Dataverse in the context of the user that is viewing the form on which the PCF is displayed, so that this doesn't open up a security hole by enabling users to gain access to information from records that they should not have access to.  Is that possible?   I think that means that I need to:

- require AD authentication on my Azure Function HTTP API (easy)

- authenticate as the currently logged in user when invoking the function from the PCF (don't know if this is possible)

- in the Azure function use the same AD credentials that were used to invoke the function to access the Dataverse API (don't know if this is possible either)?

 

Help and pointers hugely appreciated!  Many thanks.

I have the same question (0)
  • Parvez Ghumra Profile Picture
    1,579 Moderator on at

    Hi @matmeredith 

     

    I think you should be able to connect to Dataverse from your Azure Function as normal using an AppID/ClientSecret based connection string. More info on Connection Strings here. You should then be able to impersonate the contextual user using the approach described here

     

     

  • matmeredith Profile Picture
    22 on at

    Thanks -- I'll take a look!   Still interested if anyone can give me any pointers on whether it's possible for a PCF to invoke an Azure function using the AD credentials of the user accessing the power app.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard