Skip to content

Commit b4d3589

Browse files
keyvault purging code implemented
1 parent f7b5f5a commit b4d3589

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,25 @@ jobs:
263263
fi
264264
done
265265
266+
# --- Purge Key Vaults ---
267+
echo "Starting purge for Key Vaults..."
268+
IFS=' ' read -r -a VAULTS <<< "${{ env.KEYVAULT_NAME }}"
269+
270+
for VAULT in "${VAULTS[@]}"; do
271+
echo "Checking location for Key Vault: $VAULT"
272+
273+
# Fetch Key Vault location
274+
VAULT_LOCATION=$(az keyvault list-deleted --query "[?name=='$VAULT'].properties.location" -o tsv 2>/dev/null || echo "")
275+
276+
if [ -n "$VAULT_LOCATION" ]; then
277+
echo "Purging Key Vault $VAULT in $VAULT_LOCATION"
278+
az keyvault purge --name "$VAULT" --location "$VAULT_LOCATION"
279+
else
280+
echo "Could not determine location for Key Vault: $VAULT. Skipping purge."
281+
fi
282+
done
283+
284+
266285
- name: Send Notification on Failure
267286
if: failure()
268287
run: |

0 commit comments

Comments
 (0)