Azure Runbook using managed identity 401 unauthorized #4769
Unanswered
nicolaibaralmueller
asked this question in
Q&A
Replies: 1 comment
-
Hi @nicolaibaralmueller , which line are you getting the error in? Is it the one with Get-AzAccessToken? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using Azure Automation account with managed identity. The MI has the following API permissions:

Logging in with my global admin account using the MI works fine.
Connect-PnPOnline -Url $url -Interactive -ClientId $clientId -ReturnConnection
However, when executing the runbook I receive a 401 unauthorized after login.
Giving the MI Sharepoint Administrator role also results in (401) Unauthorized.
I am very confused what is missing???
Beta Was this translation helpful? Give feedback.
All reactions