Skip to content

Commit 5eb8592

Browse files
update refresh command to not put all the json
1 parent b2782f4 commit 5eb8592

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

infra/scripts/post_deployment.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,19 @@ echo "============================================================"
245245
echo "Refreshing Content Understanding Cognitive Services account..."
246246
echo "============================================================"
247247

248-
CU_ACCOUNT_NAME=$(azd env get-value CONTENT_UNDERSTANDING_ACCOUNT_NAME)
248+
CU_ACCOUNT_NAME=$(azd env get-value CONTENT_UNDERSTANDING_ACCOUNT_NAME 2>/dev/null || echo "")
249249

250-
az cognitiveservices account update \
251-
-g "$RESOURCE_GROUP" \
252-
-n "$CU_ACCOUNT_NAME" \
253-
--tags refresh=true
254-
255-
if [ $? -eq 0 ]; then
256-
echo " ✅ Successfully refreshed Cognitive Services account '$CU_ACCOUNT_NAME'."
250+
if [ -z "$CU_ACCOUNT_NAME" ]; then
251+
echo " ⚠️ CONTENT_UNDERSTANDING_ACCOUNT_NAME not found in azd env. Skipping refresh."
257252
else
258-
echo " ❌ Failed to refresh Cognitive Services account '$CU_ACCOUNT_NAME'."
253+
echo " Refreshing account: $CU_ACCOUNT_NAME in resource group: $RESOURCE_GROUP"
254+
if az cognitiveservices account update \
255+
-g "$RESOURCE_GROUP" \
256+
-n "$CU_ACCOUNT_NAME" \
257+
--tags refresh=true \
258+
--output none; then
259+
echo " ✅ Successfully refreshed Cognitive Services account '$CU_ACCOUNT_NAME'."
260+
else
261+
echo " ❌ Failed to refresh Cognitive Services account '$CU_ACCOUNT_NAME'."
262+
fi
259263
fi

0 commit comments

Comments
 (0)