Skip to content

Commit 195b245

Browse files
Merge pull request microsoft#208 from microsoft/psl-bug-20136
fix: set the environment variables to update/refresh the container app
2 parents 9fa550e + e079160 commit 195b245

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

infra/scripts/docker-build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ function Build-And-Push-Image {
3939

4040
if($CONTAINER_APP_NAME)
4141
{
42+
$timestamp = Get-Date -Format "yyyyMMddHHmmss"
4243
Write-Host "Updating the Container app registry server & image"
4344
az containerapp registry set --name $CONTAINER_APP_NAME --resource-group $AZURE_RESOURCE_GROUP --server "$ACR_NAME.azurecr.io" --identity $CONTAINER_APP_USER_IDENTITY_ID --only-show-errors
44-
az containerapp update --name $CONTAINER_APP_NAME --resource-group $AZURE_RESOURCE_GROUP --image $IMAGE_URI --only-show-errors
45+
az containerapp update --name $CONTAINER_APP_NAME --resource-group $AZURE_RESOURCE_GROUP --image $IMAGE_URI --set-env-vars REFRESH_TIMESTAMP=$timestamp --only-show-errors
4546
Write-Host "Updated the registry for Container: $CONTAINER_APP_NAME"
4647
}
4748
}

infra/scripts/docker-build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ build_and_push_image() {
100100
--name "$CONTAINER_APP" \
101101
--resource-group "$AZURE_RESOURCE_GROUP" \
102102
--image "$IMAGE_URI" \
103+
--set-env-vars REFRESH_TIMESTAMP=$(date +%Y%m%d%H%M%S) \
103104
--only-show-errors
104105

105106
echo "Updated registry for container app: $CONTAINER_APP"

0 commit comments

Comments
 (0)