Skip to content
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

terraform plan identity is missing permission for subsequent runs #241

Closed
kewalaka opened this issue Oct 27, 2024 · 3 comments
Closed

terraform plan identity is missing permission for subsequent runs #241

kewalaka opened this issue Oct 27, 2024 · 3 comments
Assignees
Labels
Type: Bug 🪲 Something isn't working

Comments

@kewalaka
Copy link

With telemetry enabled, when running the pipeline after the first time, the plan identity is missing the permission "Microsoft.Resources/deployments/exportTemplate/action":

Original Error: autorest/azure: Service returned an error. Status=403 Code="AuthorizationFailed" Message="The client <REDACTED> does not have authorization to perform action 'Microsoft.Resources/deployments/exportTemplate/action' over scope '/subscriptions/<REDACTED>' or the scope is invalid. If access was recently granted, please refresh your credentials."
│ 
│   with module.management_es[0].module.management_groups.azurerm_subscription_template_deployment.telemetry_core[0],
│   on .terraform/modules/management_es.management_groups/resources.telemetry.tf line 9, in resource "azurerm_subscription_template_deployment" "telemetry_core":
│    9: resource "azurerm_subscription_template_deployment" "telemetry_core" {

(for my ref) The Azure Devops version is here - also need to update the GH & local instances

https://github.com/Azure/accelerator-bootstrap-modules/blob/612930a217eb4a4e719ad387fe484812c0d509d0/alz/azuredevops/variables.hidden.tf#L229-L241

@jaredfholgate
Copy link
Member

This issue is related to the existing issue here: #223

Also you have somehow raised this issue against the wrong repo. Will move it when am back in the office.

@kewalaka
Copy link
Author

kewalaka commented Oct 28, 2024

Ah I think I used "raise an issue" directly from the source code which bypassed the redirection in the templates. Interesting.

I only had one sub for testing purposes, which gets linked under the platform management MG, a bit different to the scenario in the linked issue?

For me the initial deployment was fine - it was subsequent runs that ran into the above permission issue.

@jaredfholgate jaredfholgate transferred this issue from Azure/accelerator-bootstrap-modules Oct 31, 2024
@jaredfholgate jaredfholgate added Needs: Triage 🔍 Needs triaging by the team Type: Bug 🪲 Something isn't working labels Oct 31, 2024
@jaredfholgate jaredfholgate self-assigned this Oct 31, 2024
@jaredfholgate jaredfholgate added Needs: Attention 👋 Needs attention from the maintainers and removed Needs: Triage 🔍 Needs triaging by the team labels Oct 31, 2024
@jaredfholgate jaredfholgate removed the Needs: Attention 👋 Needs attention from the maintainers label Oct 31, 2024
@jaredfholgate
Copy link
Member

Released in v4.1.1 (hopefully fixes the issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants