From 2c68c485a664b0d3fc25faa34e7228dd3f860719 Mon Sep 17 00:00:00 2001 From: Benjamin Chiverton Date: Tue, 2 Jul 2024 10:44:34 +0100 Subject: [PATCH] Delete hostname prior to cert destruction --- .../container_apps_bind_dns/scripts/destroy.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/terraform/instance/container_apps_bind_dns/scripts/destroy.sh b/terraform/instance/container_apps_bind_dns/scripts/destroy.sh index df31b37..1124cc3 100644 --- a/terraform/instance/container_apps_bind_dns/scripts/destroy.sh +++ b/terraform/instance/container_apps_bind_dns/scripts/destroy.sh @@ -17,15 +17,15 @@ CERTIFICATE_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" + # destroy the cert az containerapp env certificate delete \ -g $CONTAINER_APP_ENV_RESOURCE_GROUP \ -n $CONTAINER_APP_ENV_NAME \ --certificate $CERTIFICATE_ID --yes echo "destroyed the managed certificate" - -# 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"