From 2c9163c5c2a92b808e15cec45ccba8678c586a34 Mon Sep 17 00:00:00 2001 From: Lazar Kanelov Date: Tue, 10 Nov 2026 15:40:02 +0200 Subject: [PATCH] Fix url-shortener python deploy scripts on current Azure CLI - scripts/deploy.sh: use --database-name for 'az postgres flexible-server db create'; Azure CLI 2.82 rejects --name. - bicep/deploy.sh: keep only the JSON deployment outputs; Azure CLI prints a Bicep notice on stdout that broke jq parsing. --- samples/url-shortener/python/bicep/deploy.sh | 3 +++ samples/url-shortener/python/scripts/deploy.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/url-shortener/python/bicep/deploy.sh b/samples/url-shortener/python/bicep/deploy.sh index a3ae3a6..ba2530c 100755 --- a/samples/url-shortener/python/bicep/deploy.sh +++ b/samples/url-shortener/python/bicep/deploy.sh @@ -76,6 +76,9 @@ else exit 1 fi +# Newer Azure CLI versions may print a Bicep notice on stdout; keep only the JSON outputs +DEPLOYMENT_OUTPUTS=$(echo "$DEPLOYMENT_OUTPUTS" | sed -n '/^{/,$p') + WEB_APP_NAME=$(echo "$DEPLOYMENT_OUTPUTS" | jq -r .webAppName.value) FUNCTION_APP_NAME=$(echo "$DEPLOYMENT_OUTPUTS" | jq -r .functionAppName.value) WEB_APP_HOSTNAME=$(echo "$DEPLOYMENT_OUTPUTS" | jq -r .webAppHostName.value) diff --git a/samples/url-shortener/python/scripts/deploy.sh b/samples/url-shortener/python/scripts/deploy.sh index 2655b31..bfd5a3b 100755 --- a/samples/url-shortener/python/scripts/deploy.sh +++ b/samples/url-shortener/python/scripts/deploy.sh @@ -301,7 +301,7 @@ echo "Creating [$POSTGRES_DB_NAME] database on the [$POSTGRES_SERVER_NAME] Postg az postgres flexible-server db create \ --server-name $POSTGRES_SERVER_NAME \ --resource-group $RESOURCE_GROUP_NAME \ - --name $POSTGRES_DB_NAME 1>/dev/null + --database-name $POSTGRES_DB_NAME 1>/dev/null if [[ $? == 0 ]]; then echo "[$POSTGRES_DB_NAME] database successfully created on the [$POSTGRES_SERVER_NAME] PostgreSQL flexible server"