Skip to content

Clean up Azure CI resources after workflow completion - #54835

Merged
vmuzikar merged 1 commit into
keycloak:mainfrom
Pepo48:issue-54833
Nov 13, 2026
Merged

vmuzikar merged 1 commit into
keycloak:mainfrom
Pepo48:issue-54833

Conversation

@Pepo48

@Pepo48 Pepo48 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Closes #54833

Closes keycloak#54833

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
@Pepo48
Pepo48 requested a review from a team as a code owner November 6, 2026 22:27
Copilot AI lite review requested due to automatic review settings November 6, 2026 22:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The safety-critical Azure cleanup depends on unverified GitHub workflow_run timing, rerun-attempt permissions, and asynchronous deletion behavior that require live CI/Azure validation.

No open issues 🎉

What changed in this PR

Adds a fallback Azure cleanup workflow to remove CI resource groups after workflow completion, including cancellation or runner loss scenarios.

Changes:

  • Adds a workflow_run workflow to locate, delete, and verify Azure resource-group cleanup.
  • Tags resource groups with repository, run, and attempt metadata.
  • Prevents resource-group recreation during provisioning.
  • Gates in-job cleanup on successful Azure authentication.
File Description
.github/​workflows/​ci.yml Adds the Azure login step ID and adjusts existing cleanup conditions.
.github/​workflows/​azure-delete.yml Adds post-workflow resource-group discovery, deletion, and verification.
.github/​scripts/​azure/​sql/​azure_create_sql.sh Adds CI metadata tags when creating Azure resource groups.
.github/​scripts/​ansible/​azure_vm_manager.sh Preserves an existing resource group instead of recreating it.

Review effort: Lite

@vmuzikar vmuzikar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@vmuzikar
vmuzikar merged commit bf62487 into keycloak:main Nov 13, 2026
98 checks passed
ItsRoy69 pushed a commit to ItsRoy69/keycloak that referenced this pull request Nov 14, 2026
Closes keycloak#54833

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AzureDB IT leaves Azure resources behind when cleanup is skipped

3 participants