Connecting to Azure Web App API from SpFx is throwing 403.76 error
Amal Hashim
0
Reputation points
I have deployed a simple Web API project with weatherforecast controller in it.
- There is no Authorization code in the API.
- Deployed the API to Azure Web App. Tested the endpoint https://xxxx.azurewebsites.net/weatherforecast and it worked fine.
- Created a spfx webpart and connected to the API - worked fine
- Enabled Authentication in App Service
- Added API permission - user_impersonation, User.Read
- Granted Admin Consent
- Updated spfx to use AadHttpClient
- Added webApi permission request in package-solution
- Deployed sppkg
- Approved in SharePoint Admin center -> API permission
When the webpart is added to a page - it tries to connect to the API and it results in 403 error.
I can see the Bearer token in the request and use JWT decoder - it all looks good
Checked API logs and found 403.76 error code.
Any idea on how to resolve this?