Skip to content

Commit 5e2408e

Browse files
feat: Remove re-authentication and retry logic from infrastructure provisioning
1 parent 1c1e6a5 commit 5e2408e

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

.github/workflows/azure-dev.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,3 @@ jobs:
9595
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
9696
fabricWorkspaceMode: 'none'
9797
timeout-minutes: 60
98-
- name: Re-authenticate and Retry if Failed
99-
if: steps.provision-main.outcome == 'failure'
100-
run: |
101-
echo "::warning::First provision attempt failed. Re-authenticating and retrying..."
102-
103-
# Get fresh OIDC token and re-authenticate
104-
az logout
105-
az login --service-principal \
106-
--username ${{ vars.AZURE_CLIENT_ID }} \
107-
--tenant ${{ vars.AZURE_TENANT_ID }} \
108-
--allow-no-subscriptions \
109-
--federated-token $(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r .value)
110-
111-
az account set --subscription ${{ vars.AZURE_SUBSCRIPTION_ID }}
112-
113-
# Wait for resource group deletion to complete if in progress
114-
echo "Checking resource group status..."
115-
for i in {1..30}; do
116-
RG_STATE=$(az group show --name "$RESOURCE_GROUP" --query "properties.provisioningState" -o tsv 2>/dev/null || echo "NotFound")
117-
118-
if [ "$RG_STATE" = "NotFound" ]; then
119-
echo "Resource group fully deleted. Recreating..."
120-
az group create --name "$RESOURCE_GROUP" --location ${{ vars.AZURE_LOCATION }}
121-
break
122-
elif [ "$RG_STATE" = "Succeeded" ]; then
123-
echo "Resource group ready"
124-
break
125-
else
126-
echo "Resource group in state: $RG_STATE. Waiting 10s... (attempt $i/30)"
127-
sleep 10
128-
fi
129-
done
130-
131-
# Retry provision (will skip completed resources)
132-
azd provision --no-prompt
133-
env:
134-
fabricWorkspaceMode: 'none'
135-
timeout-minutes: 60

0 commit comments

Comments
 (0)