From 35cd559369e7ea02829b255f618586bc442ca928 Mon Sep 17 00:00:00 2001 From: Yuval Yaron <43217306+yuvalyaron@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:38:28 +0200 Subject: [PATCH] Move AZ AD Environment Variables to check_dependencies (#4131) set azure ad environment variables in check_dependencies rather than in load_and_validate_env --- .github/actions/devcontainer_run_command/action.yml | 3 --- devops/scripts/check_dependencies.sh | 5 +++++ devops/scripts/load_and_validate_env.sh | 5 ----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 25fbe43975..55157e1716 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -186,9 +186,6 @@ runs: -e TF_INPUT="0" \ -e TF_IN_AUTOMATION="1" \ -e USE_ENV_VARS_NOT_FILES="true" \ - -e ARM_STORAGE_USE_AZUREAD="true" \ - -e ARM_USE_AZUREAD="true" \ - -e ARM_USE_OIDC="true" \ -e BUNDLE_TYPE="${{ inputs.BUNDLE_TYPE }}" \ -e WORKSPACE_SERVICE_NAME="${{ inputs.WORKSPACE_SERVICE_NAME }}" \ -e ARM_ENVIRONMENT="${{ env.ARM_ENVIRONMENT }}" \ diff --git a/devops/scripts/check_dependencies.sh b/devops/scripts/check_dependencies.sh index dfdb68a28c..40f622f866 100755 --- a/devops/scripts/check_dependencies.sh +++ b/devops/scripts/check_dependencies.sh @@ -72,6 +72,11 @@ export SUB_ID TENANT_ID=$(az account show --query tenantId -o tsv) export TENANT_ID +# Configure AzureRM provider and backend to use Azure AD to connect to storage accounts +export ARM_STORAGE_USE_AZUREAD=true +export ARM_USE_AZUREAD=true +export ARM_USE_OIDC=true + if [ -z "$SUB_NAME" ]; then echo -e "\n\e[31m»»» ⚠️ You are not logged in to Azure!" exit 1 diff --git a/devops/scripts/load_and_validate_env.sh b/devops/scripts/load_and_validate_env.sh index d82617c7d7..c4d771ab91 100755 --- a/devops/scripts/load_and_validate_env.sh +++ b/devops/scripts/load_and_validate_env.sh @@ -83,11 +83,6 @@ else TRE_URL=$(construct_tre_url "${TRE_ID}" "${LOCATION}" "${AZURE_ENVIRONMENT}") export TRE_URL - - # Configure AzureRM provider and backend to use Azure AD to connect to storage accounts - export ARM_STORAGE_USE_AZUREAD=true - export ARM_USE_AZUREAD=true - export ARM_USE_OIDC=true fi # if local debugging is configured, then set vars required by ~/.porter/config.yaml