Initially we had an anonymous Azure Function using System Assigned Managed Identity, that managed identity was added to Azure DevOps API and was able to call the API from the function. But later I wanted to call this function from SPFx app, so I added Microsoft identity provider in function's authentication for secure calls. After adding that authentication, I get a TF401444 error while calling the api and asking to login to Azure DevOps.
I think the app registration needs to have user_impersonation for Azure DevOps added in API permissions section of app registration.
Would you believe there are additional changes to this?
var token = new DefaultAzureCredentials().GetTokenAsync(....
var token = new DefaultAzureCredentials().GetTokenAsync(....)
That's the C# code I used to get token. I think that error above is due to authentication issue with Azure DevOps.
I checked that token and I see the oid from the token is the same as the one in the error asking for azure devops authentication after the tenant id.
How do I resolve that error?
I read this article and trying to understand which would be my scenario.
https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/authentication-guidance?view=azure-devops
I know the old one before adding the authentication would be in the managed identity section. Is there a new one to get Entra token?