Skip to content

Fix: storage account 403 error when creating new tre env#4406

Merged
RonShakutai merged 38 commits into
mainfrom
fix-sa-bootstrap-err
Mar 11, 2025
Merged

Fix: storage account 403 error when creating new tre env#4406
RonShakutai merged 38 commits into
mainfrom
fix-sa-bootstrap-err

Conversation

@RonShakutai

@RonShakutai RonShakutai commented Feb 26, 2025

Copy link
Copy Markdown
Collaborator

Resolves #4405

What is being addressed

  • Ensuring role propagation before execution: The script now properly waits for both Storage Account Contributor and Storage Blob Data Contributor roles to be assigned before attempting storage operations.
  • Refactoring role assignment check: Instead of checking a single role, the script now verifies both roles are assigned before proceeding, reducing failures due to role propagation delays.

Testing:

…ntributor" and "Storage Account Contributor" roles
@github-actions

github-actions Bot commented Feb 26, 2025

Copy link
Copy Markdown

Unit Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit c1e5441.

♻️ This comment has been updated with latest results.

@RonShakutai RonShakutai changed the title Refactor role assignment check to validate both "Storage Blob Data Co… Fix: storage account 403 error when creating new tre env. Feb 26, 2025
@RonShakutai RonShakutai changed the title Fix: storage account 403 error when creating new tre env. Fix: storage account 403 error when creating new tre env Feb 26, 2025
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13545863577 (with refid ecb751e8)

(in response to this comment from @ShakutaiGit)

Comment thread .github/actions/devcontainer_run_command/action.yml
Comment thread devops/terraform/bootstrap.sh Outdated
@RonShakutai RonShakutai removed the request for review from ashis-kar91 March 10, 2025 12:58
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13769103068 (with refid ecb751e8)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13783417156 (with refid ecb751e8)

(in response to this comment from @ShakutaiGit)

@RonShakutai RonShakutai requested review from ashis-kar91 and removed request for ashis-kar91 March 11, 2025 09:13

@marrobi marrobi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks tidy now.

@RonShakutai RonShakutai enabled auto-merge (squash) March 11, 2025 09:45
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13783417156 (with refid ecb751e8)

(in response to this comment from @ShakutaiGit)

tests passed

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-force-approve

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

✅ Marking tests as complete (for commit a60f169)

(in response to this comment from @ShakutaiGit)

Comment thread devops/terraform/bootstrap.sh Outdated
Comment thread devops/terraform/bootstrap.sh Outdated
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-force-approve

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

✅ Marking tests as complete (for commit c1e5441)

(in response to this comment from @ShakutaiGit)

@RonShakutai RonShakutai merged commit c2925cd into main Mar 11, 2025
@RonShakutai RonShakutai deleted the fix-sa-bootstrap-err branch March 11, 2025 10:38
marrobi pushed a commit to marrobi/AzureTRE that referenced this pull request May 20, 2025
)

* Refactor role assignment check to validate both "Storage Blob Data Contributor" and "Storage Account Contributor" roles

* Remove unused script source from bootstrap.sh

* Refactor role assignment check to use local variables for clarity

* Update CHANGELOG and add role assignment for Storage Account Contributor in bootstrap.sh

* Refactor role assignment check to use counts for validation and streamline script execution

* Refactor role assignment check to use non-empty value validation and enhance storage container creation with retry logic

* CR changes

* Refactor role assignment check to verify access via storage container list

* Implement retry logic for role assignment checks in bootstrap script

* Refactor check_terraform_role_assignments function to simplify error handling and remove unnecessary output

* Enhance error message in check_terraform_role_assignments function to indicate retry mechanism on unexpected output

* Remove unnecessary echo statement from retry_with_backoff function in bootstrap script

* Add validation for required environment variables in bootstrap script

* Refactor bootstrap script to streamline Terraform initialization and backend configuration

* Add shellcheck disable comments for unbound variable warnings in bootstrap script

* Update terraform_wrapper invocation and add blank line for readability in bootstrap script

* Bump version to 0.12.7 in version.txt

* Refactor bootstrap script to move backend configuration inline and remove redundant function

* Remove redundant function call for writing bootstrap Terraform backend

* Remove TODO comments from Terraform command output in bootstrap script

* Bump version to 0.12.8 in version.txt

* Bump version to 0.12.7 in version.txt

* Refactor bootstrap script to inline backend configuration and improve error handling

* fix: update condition for Azure and ACR login to check for 'make bootstrap'

* fix: resolve CI issue with Azure login steps for branches containing 'bootstrap'

* refactor: move Terraform backend configuration to a dedicated section in bootstrap.sh

* fix: update role assignment to use Storage Blob Data Contributor in bootstrap.sh

* fix: refine role assignment query in bootstrap.sh to check only for Storage Blob Data Contributor

* fix: update role check in bootstrap.sh to return status instead of echoing

* fix: update comment for granting Storage Blob Data Contributor role in bootstrap.sh

* fix: update comment for granting Storage Blob Data Contributor permissions in bootstrap.sh
martinpeck pushed a commit that referenced this pull request May 20, 2025
* Refactor role assignment check to validate both "Storage Blob Data Contributor" and "Storage Account Contributor" roles

* Remove unused script source from bootstrap.sh

* Refactor role assignment check to use local variables for clarity

* Update CHANGELOG and add role assignment for Storage Account Contributor in bootstrap.sh

* Refactor role assignment check to use counts for validation and streamline script execution

* Refactor role assignment check to use non-empty value validation and enhance storage container creation with retry logic

* CR changes

* Refactor role assignment check to verify access via storage container list

* Implement retry logic for role assignment checks in bootstrap script

* Refactor check_terraform_role_assignments function to simplify error handling and remove unnecessary output

* Enhance error message in check_terraform_role_assignments function to indicate retry mechanism on unexpected output

* Remove unnecessary echo statement from retry_with_backoff function in bootstrap script

* Add validation for required environment variables in bootstrap script

* Refactor bootstrap script to streamline Terraform initialization and backend configuration

* Add shellcheck disable comments for unbound variable warnings in bootstrap script

* Update terraform_wrapper invocation and add blank line for readability in bootstrap script

* Bump version to 0.12.7 in version.txt

* Refactor bootstrap script to move backend configuration inline and remove redundant function

* Remove redundant function call for writing bootstrap Terraform backend

* Remove TODO comments from Terraform command output in bootstrap script

* Bump version to 0.12.8 in version.txt

* Bump version to 0.12.7 in version.txt

* Refactor bootstrap script to inline backend configuration and improve error handling

* fix: update condition for Azure and ACR login to check for 'make bootstrap'

* fix: resolve CI issue with Azure login steps for branches containing 'bootstrap'

* refactor: move Terraform backend configuration to a dedicated section in bootstrap.sh

* fix: update role assignment to use Storage Blob Data Contributor in bootstrap.sh

* fix: refine role assignment query in bootstrap.sh to check only for Storage Blob Data Contributor

* fix: update role check in bootstrap.sh to return status instead of echoing

* fix: update comment for granting Storage Blob Data Contributor role in bootstrap.sh

* fix: update comment for granting Storage Blob Data Contributor permissions in bootstrap.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bootstrap script fails due to AuthorizationPermissionMismatch (403) on Storage Account

5 participants