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 Pages / Is it possible to use ...
Power Pages
Unanswered

Is it possible to use the Dataverse Web API from the portal?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

Is it possible to use the general Web API from a Power Platform Portal (not the portal web api)?
I want to perform a batch operation with the Web API coming from a portal but I'm struggling with the authentication.

Thanks

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    You haven't disclosed enough information to adequately answer this.  Technically, probably yes but I don't know that I would recommend it or if there is a better way to achieve what you want to do - I suspect there is a more appropriate way to achieve what you may want.  

     

    You would need to treat the portal as though it was a stand alone page https://docs.microsoft.com/en-us/power-apps/developer/data-platform/webapi/authenticate-web-api#authenticate-with-javascript-in-web-resources using the adal.js library. https://docs.microsoft.com/en-us/power-apps/developer/data-platform/oauth-cross-origin-resource-sharing-connect-single-page-application

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for your response.
    Authentication in the portal is currently done with Azure AD.
    Is it possible for example to use a user token that is obtained with [portal-url]/_services/auth/token?

    Ideally I would like to retrieve a token in the background without any user interaction as they are already logged in to access the portal.

  • Guido Preite Profile Picture
    1,490 Super User 2024 Season 1 on at

    if you get a token from the portal it will not work with the Dataverse Web API because the context is different.

    Keep in mind that the authentication against a Portals is done with contacts, against Dataverse is done against users and app registrations.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @GuidoPreiteSo is there any way I can retrieve a token for the Dataverse Web API from the browser without user interaction?

    Thanks

  • Guido Preite Profile Picture
    1,490 Super User 2024 Season 1 on at

    as I wrote before the context of a Portal is different, I am not aware of way to get a Dataverse token without user interaction starting from a Portal user

  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    If the user is logged into the Portal you could look into the Portals support of Implicit Grant Flow.  https://docs.microsoft.com/en-us/power-apps/maker/portals/oauth-implicit-grant-flow

     

    Not sure why you need batch from the portal so it is difficult to provide an answer - if we know why, may be able to suggest other options.

  • oliver.rodrigues Profile Picture
    9,471 Most Valuable Professional on at

    have you considered using Azure Functions? does your process have to run on a Batch operation? 

    is that a sync/async operation? from a Web Portal perspective, a large operation should always be done in the background, otherwise the user might be stuck waiting for the response 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @OliverRodrigues 

    We are trying to avoid Azure Functions at this time. At a certain point I need to create up to 2000 records. The user needs to wait until they have been created as those records are needed in the next step. I was able to retrieve a working token with the MSAL.JS library.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 61

#2
Valantis Profile Picture

Valantis 46

#2
11manish Profile Picture

11manish 46

Last 30 days Overall leaderboard