Azure / Azure/azure-cli

RBACAccessDenied with az deployment sub create

Open
#23,648 6 comments 0 reactions 0 assignees View on GitHub
act-identity-squad ARM Auto-Assign Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Related command**
az deployment sub create

**Describe the bug**
I'm testing a bicep deployment locally with command `az deployment sub create --location westeurope --template-file main.bicep`
The bicep file is intended to create a budget resource

I got this error
`{"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"Unauthorized","message":"{\r\n \"error\": {\r\n \"code\": \"RBACAccessDenied\",\r\n \"message\": \"The client does not have authorization to perform action. Request ID: b022aa4a-29f0-45c2-844a-bd15ef154150\"\r\n }\r\n}"}]}}`

`az account show` shows that I'm connected with the right user & subscription. My user has an **Owner** access to this subscription and I've also added the **Cost Contributor** role manually and it still doesn't work.

I've checked this page https://docs.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/common-deployment-errors but it doesn't have RBACAccessDenied error code.

**To Reproduce**
I'm following this file: https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/quick-create-budget-bicep?tabs=CLI#no-filter
And run the az deployment sub create as mentioned

**Expected behavior**
The budget resource is created

**Environment summary**
cli version: 2.37.0
shell: cmd & powershell in VS code

**Additional context**
- With my user account, can create the budget via Azure Portal
- I can also run the az deployment sub what-if successfully with the same bicep file

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.