Skip to content

Commit b365ea2

Browse files
feat: Add resource group deletion check and retry logic during provisioning
1 parent 586e2bd commit b365ea2

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/azure-dev.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,24 @@ jobs:
109109
110110
az account set --subscription ${{ vars.AZURE_SUBSCRIPTION_ID }}
111111
112+
# Wait for resource group deletion to complete if in progress
113+
echo "Checking resource group status..."
114+
for i in {1..30}; do
115+
RG_STATE=$(az group show --name "$RESOURCE_GROUP" --query "properties.provisioningState" -o tsv 2>/dev/null || echo "NotFound")
116+
117+
if [ "$RG_STATE" = "NotFound" ]; then
118+
echo "Resource group fully deleted. Recreating..."
119+
az group create --name "$RESOURCE_GROUP" --location ${{ vars.AZURE_LOCATION }}
120+
break
121+
elif [ "$RG_STATE" = "Succeeded" ]; then
122+
echo "Resource group ready"
123+
break
124+
else
125+
echo "Resource group in state: $RG_STATE. Waiting 10s... (attempt $i/30)"
126+
sleep 10
127+
fi
128+
done
129+
112130
# Retry provision (will skip completed resources)
113131
azd provision --no-prompt
114132
timeout-minutes: 60

0 commit comments

Comments
 (0)