From 0d4b15dfafaea5ffc418017fc995774411e458ee Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Fri, 3 May 2024 14:42:51 +0200 Subject: [PATCH] fix(get-fileshare-signed-url) ensure the script is re-entrant to allow concurent calls (#854) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(get-fileshare-signed-url) ensure the script is re-entrant to allow concurent calls Signed-off-by: Damien Duportal * Update resources/get-fileshare-signed-url.sh Co-authored-by: Hervé Le Meur <91831478+lemeurherve@users.noreply.github.com> --------- Signed-off-by: Damien Duportal Co-authored-by: Hervé Le Meur <91831478+lemeurherve@users.noreply.github.com> --- resources/get-fileshare-signed-url.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/get-fileshare-signed-url.sh b/resources/get-fileshare-signed-url.sh index d3ca03c0..feba58c0 100755 --- a/resources/get-fileshare-signed-url.sh +++ b/resources/get-fileshare-signed-url.sh @@ -29,6 +29,11 @@ set +x : "${STORAGE_FILESHARE?}" "${STORAGE_NAME?}" "${STORAGE_DURATION_IN_MINUTE?}" "${STORAGE_PERMISSIONS?}" +# Ensure the script is re-entrant by using unique temporary `az` configuration directory for each call +# Ref. https://learn.microsoft.com/en-us/cli/azure/use-azure-cli-successfully?tabs=bash%2Cbash2#concurrent-execution +AZURE_CONFIG_DIR="$(mktemp -d)" +export AZURE_CONFIG_DIR + accountKeyArg=() shouldLogout="true" # If a storage account key env var exists, use it instead of a service principal to generate a file share SAS token