-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure Management Group creation with Service Principal returns 403 #6091
Comments
The problem also appears if you use a user principal, not only with a service principal. |
I'm experiencing the same issue with v2.3.0. Is there any update on this? thx |
same experience here with v2.4.0. |
same here on v2.6.0 |
Hi guys, Problem is still occuring in the version 2.7.0:
1.44:
Hoping to get some traction on this issue. Cheers, |
Hi all, I am currently working on a fix for this issue. The AzureRM provider first runs a GET on the management group you requested to create, to ensure it doesn't exist. The problem occurs when you run a If you are trying to just run a GET on a management group resource, make sure that the User you're authenticating with has proper access. Proper access would be the |
I was debugging the error, when I find this issue. Before I get this error, I was using version 2.1.0. Now, I'm using the version 2.6.0 I suppose that the regression is due to this pull-request: #6276, released in 2.4.0 @wsf11 , I confirm your analyze. In my case, I have proper access but the management group is new and it fails with Looking forward for the fix, Thanks |
@boillodmanuel Did you get a 403 or 404 error? |
@wsf11 , It's a 403 error as you can see:
But, I did a mistake. I tested again and the bug was already there in version 2.1.0. But wasn't here in version 1.3.1 (to the regression is not due to #6276). Sorry |
Actually in my PR #6276 , I introduced a new bug here. I am planning fix the bug I introduced along with #6757 , but as for this 403 issue, I actually have no clue.... |
I have fixed the bug introduced in PR #6276 in my PR mentioned above. As well as the 403 issue |
@mdob88 Waiting review... |
well done @wsf11! Works for me |
Fixed via #6668 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform version: 0.12.20
Azurerm version: 2.0.0
Affected Resource(s)
azurerm_management_group
We use a Service Principal to connect to out Azure environment. This SP has Owner role at Root Management Group. If we login to Azure CLI with this SP, we can manage Management Groups without a problem.
When we try to run from terraform, we get a 403 error:
Terraform Configuration Files
Debug Output
Provided in Gist
Expected Behavior
Management Group is created
Actual Behavior
Terraform apply fails with error 403 forbidden
Steps to Reproduce
export ARM_SUBSCRIPTION_ID="xxxxxx"
export ARM_CLIENT_ID="xxxxxx"
export ARM_CLIENT_SECRET="xxxxx"
export ARM_TENANT_ID="xxxxx"
terraform init
terraform apply
The text was updated successfully, but these errors were encountered: