Azure Function App to Read SharePoint Site Collection Content
I'm obviously missing a step somewhere and haven't a clue as to where. Any recommendations would be appreciated.
I have a SharePoint Online Site Collection on which I am a Site Collection Admin
I have an Azure App Service SPA app that requires me to login (same credentials used for this and SharePoint)
I have an Azure AppReg for the above App Service that is set to User.Read for MS Graph and user_delegate for the API below
I have an Azure Function App with C# code that uses AuthenticationManager and GetContextAsync to get ahold of the SharePoint site collection
I have an Azure AppReg for the above Function App that is set to User.Read for MS Graph and AllSites.Read delegated
I can login to the SharePoint site collection without issue
I can login to the Azure App Service SPA app without issue
The Azure Function App fails with the error "You do not have permission to view this directory or page." Which I obviously do.
We've confirmed AuthenticationManager is using the clientID and tenantID of the Function App's AppReg and the URL is the correct one for SharePoint.
Any thoughts will be gratefully accepted.