File tree Expand file tree Collapse file tree
.azuredevops/templates/steps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ parameters:
77steps :
88 - task : AzureCLI@2
99 name : deploy_images
10- displayName : Restart Function Apps
10+ displayName : Restart App Services
1111 inputs :
1212 azureSubscription : ${{ parameters.serviceConnection }}
1313 addSpnToEnvironment : true
1919 declare -a pids
2020
2121 wait_for_completion() {
22- # acr tasks are backgrounded for parallelism
2322 local -n arr=$1
2423 for pid in "${arr[@]}"; do
2524 wait ${pid}
@@ -39,5 +38,18 @@ steps:
3938
4039 pids+=($!)
4140 done
41+
42+ webApps=$(az webapp list --resource-group $(FUNCTION_RESOURCE_GROUP) --query "[].name" -o tsv)
43+ for webApp in $webApps; do
44+
45+ imageName="${PROJECT_NAME}-$(echo $webApp | sed "s/^$(ENVIRONMENT_SHORT)-uks-//")"
46+
47+ # Push the new image to the function app and perform manual restart. Pair the commands to run in parallel:
48+ echo "##[debug] $webApp updating and restarting with image ${SRC_REGISTRY}.azurecr.io/${imageName}:${ADD_IMAGE_TAG}" && \
49+ az webapp restart --name $webApp --resource-group $(FUNCTION_RESOURCE_GROUP) &
50+
51+ pids+=($!)
52+ done
53+
4254 wait_for_completion pids
43- echo "##[debug] All function apps restarted"
55+ echo "##[debug] All App Services restarted"
You can’t perform that action at this time.
0 commit comments