Skip to content

Commit

Permalink
Update destroy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
benchiverton committed Jul 2, 2024
1 parent 42ef6ac commit 702bc6f
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions terraform/instance/container_apps_bind_dns/scripts/destroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,7 @@ CERTIFICATE_ID=$(
--managed-certificates-only \
--query "[?properties.subjectName=='$CUSTOM_DOMAIN'].id" \
--output tsv
)

# remove the custom domain from the container app
az containerapp hostname delete --hostname $CUSTOM_DOMAIN \
-g $CONTAINER_APP_RESOURCE_GROUP \
-n $CONTAINER_APP_NAME
echo "removed the custom domain from the container app"

# wait for the custom domain to be removed
tries=0
until [ "$tries" -ge 12 ]; do
[[ -z $(
az containerapp hostname list \
-n $CONTAINER_APP_NAME \
-g $CONTAINER_APP_RESOURCE_GROUP \
--query "[?name=='$CUSTOM_DOMAIN'].name" \
--output tsv
) ]] && break
tries=$((tries + 1))

sleep 10
done
if [ "$tries" -ge 12 ]; then
die "waited for 2 minutes, checked the containerapp 12 times and it still has the custom domain. check azure portal..."
fi
)

# destroy the cert
az containerapp env certificate delete \
Expand Down

0 comments on commit 702bc6f

Please sign in to comment.