From e9752cf7ad17a713b36b08e62f5bf2bd702a6f9a Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:52:17 -0400 Subject: [PATCH] ci,fix: Eagerly cache access tokens --- .github/workflows/automated-cleanup-resources.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/automated-cleanup-resources.yml b/.github/workflows/automated-cleanup-resources.yml index 0b16036ec91..dc309cbdc00 100644 --- a/.github/workflows/automated-cleanup-resources.yml +++ b/.github/workflows/automated-cleanup-resources.yml @@ -44,6 +44,15 @@ jobs: bash setup.sh working-directory: cli continue-on-error: true + - name: Eagerly cache access tokens for required scopes + run: | + # Workaround for azure-cli's lack of support for ID token refresh + # Taken from: https://github.com/Azure/login/issues/372#issuecomment-2056289617 + + # Management + az account get-access-token --scope https://management.azure.com/.default --output none + # ML + az account get-access-token --scope https://ml.azure.com/.default --output none - name: Perform Cleanup run: | source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";