-
Notifications
You must be signed in to change notification settings - Fork 3
[Bug Fix] Purge soft-deleted Azure OpenAI resources after azd down in CI/CD
#310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot the new terraform output is currently described with "The name of the Azure OpenAI resource (for purging soft-deleted resources)", update to just say "The name of the Azure OpenAI resource". |
azd down in CI/CD
Updated the output description to "The name of the Azure OpenAI resource" in commit f862ef9. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot add an explainer to troubleshooting.md that explains the symptoms of the purge issue and links to the relevant note in the README on how to manually purge. |
Added troubleshooting section to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses Azure OpenAI resource name conflicts in CI/CD by implementing automated purging of soft-deleted resources after azd down operations. The solution ensures that repeated deployments with consistent resource naming work reliably without manual intervention.
Key changes implemented:
- Added Terraform output for OpenAI resource name to enable purge commands
- Integrated automated purge steps in GitHub Actions workflows after infrastructure destruction
- Created comprehensive documentation including decision log and troubleshooting guidance
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
infra/outputs.tf |
Added openai_resource_name output to expose resource name for purge operations |
.github/workflows/azure-dev.yml |
Added purge step after "Destroy Infrastructure" with proper error handling |
.github/workflows/azure-dev-down.yml |
Added purge step after "Azd down" with graceful failure handling |
decision-log/006-azure-openai-soft-delete-purge.md |
Comprehensive ADR documenting context, implementation, and rationale |
docs/troubleshooting.md |
Added troubleshooting section for soft-delete resource name conflicts |
README.md |
Added note about Azure OpenAI soft-delete behavior and manual purge instructions |
9244e68 to
6b44a6f
Compare
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
Co-authored-by: ianjensenisme <[email protected]>
6b44a6f to
f714f43
Compare
Azure OpenAI Soft-Delete Purge Fix
This PR addresses issue #309 by implementing a solution to purge soft-deleted Azure OpenAI resources after
azd downin CI/CD workflows.✅ Completed Plan:
ianjensenisme/309-AzureOpenAI-Purge🎯 Problem Solved
Azure OpenAI resources remain in a "soft-deleted" state for 48 hours after deletion, preventing name reuse during CI/CD testing. This caused subsequent PR deployments to fail when trying to create resources with the same names.
🔧 Solution Approach
Since Azure Developer CLI does not support postdown/predestroy hooks, the solution adds Azure CLI commands directly to GitHub Actions workflows to purge soft-deleted Cognitive Services (OpenAI) resources after running
azd down.📝 Changes Made
1. Terraform Output (
infra/outputs.tf)2. GitHub Actions Workflows
Added "Purge Soft-Deleted Azure OpenAI Resources" step in:
.github/workflows/azure-dev.yml(after "Destroy Infrastructure").github/workflows/azure-dev-down.yml(after "Azd down")The purge step:
azd env get-valuesoutputaz cognitiveservices account purge --location <region> --resource-group <rg> --name <name>3. Decision Log (
decision-log/006-azure-openai-soft-delete-purge.md)Comprehensive documentation covering:
4. Troubleshooting Guide (
docs/troubleshooting.md)Added troubleshooting section explaining:
ResourceNameAlreadyExistserror)✅ Validation & Testing
📊 Files Modified
infra/outputs.tf(+5 lines).github/workflows/azure-dev.yml(+24 lines).github/workflows/azure-dev-down.yml(+22 lines)decision-log/006-azure-openai-soft-delete-purge.md(+105 lines)docs/troubleshooting.md(+15 lines)Total: 5 files, 171 lines added
🎉 Impact
Fixes #309
Original prompt
Fixes #309
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.