Skip to content

Commit

Permalink
chore: fix deploy script (#5842)
Browse files Browse the repository at this point in the history
  • Loading branch information
timmy-wright authored Feb 14, 2025
1 parent e028b0e commit 6a486fc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions vhdbuilder/packer/convert-sig-to-classic-storage-account-blob.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/bash
set -e
# avoid using set -x in this pipeline as you'll end up logging a sensitive access token down below.

source ./parts/linux/cloud-init/artifacts/cse_benchmark_functions.sh

Expand Down Expand Up @@ -100,7 +102,18 @@ capture_benchmark "${SCRIPT_NAME}_convert_image_version_to_disk"

echo "Granting access to $disk_resource_id for 1 hour"
# shellcheck disable=SC2102
sas=$(az disk grant-access --ids $disk_resource_id --duration-in-seconds 3600 --query [accessSAS] -o tsv)
sas=$(az disk grant-access --ids $disk_resource_id --duration-in-seconds 3600 --query [accessSas] -o tsv)
if [[ "$sas" == "None" ]]; then
echo "sas token empty. Trying alternative query string"
# shellcheck disable=SC2102
sas=$(az disk grant-access --ids $disk_resource_id --duration-in-seconds 3600 --query [accessSAS] -o tsv)
fi

if [[ "$sas" == "None" ]]; then
echo "sas token empty after trying both queries. Can't continue"
exit 1
fi

capture_benchmark "${SCRIPT_NAME}_grant_access_to_disk"

echo "Uploading $disk_resource_id to ${CLASSIC_BLOB}/${CAPTURED_SIG_VERSION}.vhd"
Expand Down

0 comments on commit 6a486fc

Please sign in to comment.