From c421afb69270139a97ca5295ac2b2f2401e9ec43 Mon Sep 17 00:00:00 2001 From: Ron Shakutai Date: Wed, 26 Feb 2025 13:30:44 +0000 Subject: [PATCH] Refactor role assignment check to use local variables for clarity --- devops/terraform/bootstrap.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devops/terraform/bootstrap.sh b/devops/terraform/bootstrap.sh index 377ebcd9f..f413f562c 100755 --- a/devops/terraform/bootstrap.sh +++ b/devops/terraform/bootstrap.sh @@ -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" \