From 962643b0d032df16c04da7ebbc35145449d33ef9 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Fri, 3 May 2024 13:15:15 +0200 Subject: [PATCH 1/2] fix(get-fileshare-signed-url) ensure the script is re-entrant to allow concurent calls Signed-off-by: Damien Duportal --- 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..79b5dbad 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 different `az` configuration dir 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 From 2fd7c63a3fcc54a5ddfe133617ee11f41fab3746 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Fri, 3 May 2024 14:42:35 +0200 Subject: [PATCH 2/2] Update resources/get-fileshare-signed-url.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hervé Le Meur <91831478+lemeurherve@users.noreply.github.com> --- resources/get-fileshare-signed-url.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/get-fileshare-signed-url.sh b/resources/get-fileshare-signed-url.sh index 79b5dbad..feba58c0 100755 --- a/resources/get-fileshare-signed-url.sh +++ b/resources/get-fileshare-signed-url.sh @@ -29,7 +29,7 @@ set +x : "${STORAGE_FILESHARE?}" "${STORAGE_NAME?}" "${STORAGE_DURATION_IN_MINUTE?}" "${STORAGE_PERMISSIONS?}" -# Ensure the script is re-entrant by using different `az` configuration dir for each call +# 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