File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff 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 : |
You can’t perform that action at this time.
0 commit comments