Nov 06 2018 09:55 PM
Hello,
I am trying to call a AAD secured Azure Function from SPFx web part and getting 401 unauthorized error. I have followed - https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/connect-to-api-secured-with-... and also added my app registration app uri to allowed token audience as mentioned in https://www.vrdmn.com/2018/02/sharepoint-framework-calling-aad.html
The SP app principals are approved from the API Management admin center.
Any direction would be a great help.
Regards,
Vishwa
Nov 06 2018 10:21 PM
The issue has been resolved :)
The function signature has been changed to HttpTrigger(AuthorizationLevel.Anonymous) from [HttpTrigger(AuthorizationLevel.Function)
Dec 02 2020 09:52 AM
Hey if you want to keep the level at a function to keep your endpoint more secure then instead of using https://yourapp?code=longstring
take the code out and use the