Azure Automation Account for Powershell Runbook - Insufficient Privileges to Run Operation

Greg Thomas 121 Reputation points
2025-03-25T20:15:59.7966667+00:00

I have an Azure Automation Account that is running some simple powershell code via a runbook.

I have granted rights to the subscription for this account.

When I call any of these commands I get an insufficient privileges error

Connect-AzAccount -Identity

Write-Host "Setting Subscription Context"
Set-AzContext -SubscriptionId $StoredSubscriptionId

I have granted subscription level permissions for Owner, Contributor and Reader to the subscription on the Automation Account (running as a managed identity).

What permissions am I missing for these commands to work?

Thank you - Greg.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,349 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.