Skip to content

Commit b2782f4

Browse files
Add cognitive services account refresh step to post-deployment script
1 parent 774da96 commit b2782f4

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

infra/main.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,5 +1890,8 @@ output CONTAINER_REGISTRY_NAME string = avmContainerRegistry.outputs.name
18901890
@description('The login server of the Azure Container Registry.')
18911891
output CONTAINER_REGISTRY_LOGIN_SERVER string = avmContainerRegistry.outputs.loginServer
18921892

1893+
@description('The name of the Content Understanding AI Services account.')
1894+
output CONTENT_UNDERSTANDING_ACCOUNT_NAME string = avmAiServices_cu.outputs.name
1895+
18931896
@description('The resource group the resources were deployed into.')
18941897
output AZURE_RESOURCE_GROUP string = resourceGroup().name

infra/scripts/post_deployment.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,22 @@ else
238238
echo " Schemas registered: ${#REGISTERED_IDS[@]}"
239239
echo "============================================================"
240240
fi
241+
242+
# --- Refresh Content Understanding Cognitive Services account ---
243+
echo ""
244+
echo "============================================================"
245+
echo "Refreshing Content Understanding Cognitive Services account..."
246+
echo "============================================================"
247+
248+
CU_ACCOUNT_NAME=$(azd env get-value CONTENT_UNDERSTANDING_ACCOUNT_NAME)
249+
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'."
257+
else
258+
echo " ❌ Failed to refresh Cognitive Services account '$CU_ACCOUNT_NAME'."
259+
fi

0 commit comments

Comments
 (0)