Skip to content

Commit

Permalink
Refactor role assignment check to use local variables for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ShakutaiGit committed Feb 26, 2025
1 parent bdb0886 commit c421afb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions devops/terraform/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ az role assignment create --assignee "$USER_OBJECT_ID" \

# Function to check if the role assignment exists
check_role_assignments() {
local sbdc=$(az role assignment list \
local sbdc
sbdc=$(az role assignment list \
--assignee "$USER_OBJECT_ID" \
--role "Storage Blob Data Contributor" \
--scope "/subscriptions/$ARM_SUBSCRIPTION_ID/resourceGroups/$TF_VAR_mgmt_resource_group_name/providers/Microsoft.Storage/storageAccounts/$TF_VAR_mgmt_storage_account_name" \
--query "[].id" --output tsv)

local sac=$(az role assignment list \
local sac
sac=$(az role assignment list \
--assignee "$USER_OBJECT_ID" \
--role "Storage Account Contributor" \
--scope "/subscriptions/$ARM_SUBSCRIPTION_ID/resourceGroups/$TF_VAR_mgmt_resource_group_name/providers/Microsoft.Storage/storageAccounts/$TF_VAR_mgmt_storage_account_name" \
Expand Down

0 comments on commit c421afb

Please sign in to comment.