Announcements
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
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
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.
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.
@GuidoPreiteSo is there any way I can retrieve a token for the Dataverse Web API from the browser without user interaction?Thanks
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
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.
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
@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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
rezarizvii 69
DP_Prabh 36
oliver.rodrigues 30 Most Valuable Professional