I'm trying to authenticate to SharePoint from an Azure Automation Runbook with PnP PowerShell and a managed identity, but every approach I've tried returns 401 Unauthorized. We created our own PnP PowerShell app registration rather than using the older shared application. I added different permissions, configured a federated credential on the app registration that maps to the Automation Account's managed identity, and tried using Add-PnPEntraIDServicePrincipalAppRole to grant the identity access. However, the command reports "Service principal not found," and using the application ID results in "Resource not found." The existing runbook was built with PnP PowerShell to process employee data and publish it to our main SharePoint portal, so switching technologies may not be practical. Is there a straightforward, reliable way to set up managed-identity authentication for this scenario?
0 Answers
There is no answer to this question yet. If you know the answer or can offer some help, please use the form below.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures