You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Scenario: Invalid status code "Forbidden" when using Key Vault inside a runbook
609
+
610
+
### Issue
611
+
612
+
When trying to access Key Vault through an Azure Automation runbook, you get the following error:
613
+
614
+
```error
615
+
Operation returned an invalid status code 'Forbidden'
616
+
```
617
+
618
+
### Cause
619
+
620
+
Possible causes for this issue:
621
+
622
+
* Not using a Run As account.
623
+
* Insufficient permissions.
624
+
625
+
### Resolution
626
+
627
+
#### Not using Run As account
628
+
629
+
Follow steps at [Step 5 - Add authentication to manage Azure resources](https://docs.microsoft.com/azure/automation/automation-first-runbook-textual-powershell#add-authentication-to-manage-azure-resources) to ensure that you are using a Run As account to access Key Vault.
630
+
631
+
#### Insufficient permissions
632
+
633
+
Follow steps at [Add permissions to Key Vault](https://docs.microsoft.com/azure/automation/manage-runas-account#add-permissions-to-key-vault) to ensure that your Run As account has sufficient permissions to access Key Vault.
634
+
608
635
## <aname="other"></a>My problem isn't listed above
609
636
610
637
The sections below list other common errors and provide supporting documentation to help you resolve your issue.
0 commit comments