How can I authenticate PnP PowerShell to SharePoint from an Azure Automation Runbook using Managed Identity?

0
0
Asked By MellowCedar42 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.