Add debug flag support to azd commands in deployment workflows#358
Merged
ianjensenisme merged 6 commits intomainfrom Apr 20, 2026
Merged
Add debug flag support to azd commands in deployment workflows#358ianjensenisme merged 6 commits intomainfrom
ianjensenisme merged 6 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub's native debug logging support to Azure Developer CLI (azd) commands in deployment workflows, enabling verbose troubleshooting output for infrastructure operations without requiring workflow file modifications. The implementation uses a simple inline bash conditional to detect GitHub's debug environment variables and append the --debug flag to azd commands.
Changes:
- Added inline debug flag detection to
azd provisionandazd downcommands in azure-dev.yml - Added inline debug flag detection to
azd provision --previewandazd downcommands in azure-dev-down.yml - Minor whitespace cleanup (removed trailing spaces)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/azure-dev.yml | Added DEBUG_FLAG conditional logic for azd provision and azd down commands to support debug mode when GitHub debug logging is enabled |
| .github/workflows/azure-dev-down.yml | Added DEBUG_FLAG conditional logic for azd provision --preview and azd down commands to support debug mode when GitHub debug logging is enabled |
devorekristen
previously approved these changes
Jan 16, 2026
ianjensenisme
previously approved these changes
Apr 10, 2026
Contributor
ianjensenisme
left a comment
There was a problem hiding this comment.
I've never been happier to say this on a review: LGTM!
devorekristen
approved these changes
Apr 16, 2026
ianjensenisme
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds GitHub's native debug logging support to Azure Developer CLI (azd) commands in the deployment workflows, enabling verbose output for troubleshooting infrastructure provisioning and teardown operations.
Changes Made
azure-dev.yml (CI-Deploy workflow)
Added inline debug flag detection using DEBUG_FLAG variable pattern for azd provision command
Added inline debug flag detection using DEBUG_FLAG variable pattern for azd down command
Simplified implementation with no external dependencies
azure-dev-down.yml (CI Destroy Resources workflow)
Added inline debug flag detection using DEBUG_FLAG variable pattern for azd provision --preview command
Added inline debug flag detection using DEBUG_FLAG variable pattern for azd down command
Simplified implementation with no external dependencies
When debug logging is enabled, the --debug flag is passed to azd commands, providing:
Detailed infrastructure provisioning steps
Terraform/Bicep plan and apply output
Resource creation/deletion logs
Hook execution details
Error stack traces with full context
How to enable debug mode
To see verbose output from azd commands:
Click "Re-run jobs" on a workflow run
Check "Enable debug logging"
Click "Re-run jobs"
GitHub automatically sets the environment variables ACTIONS_STEP_DEBUG, ACTIONS_RUNNER_DEBUG, and RUNNER_DEBUG, which the workflow detects to add the --debug flag to azd commands.
Technical approach
DEBUG_FLAG variable pattern:
Detect if debug logging is enabled and set DEBUG_FLAG accordingly
DEBUG_FLAG=""
if [ "$ACTIONS_STEP_DEBUG" = "true" ] || [ "$ACTIONS_RUNNER_DEBUG" = "true" ] || [ "$RUNNER_DEBUG" = "1" ]; then
DEBUG_FLAG="--debug"
fi
azd provision --no-prompt $DEBUG_FLAG
azd down --no-prompt --force --purge $DEBUG_FLAG
This approach uses a simple variable to conditionally append the --debug flag, eliminating command duplication in if/else branches.
Benefits
✅ Simple implementation: Inline logic with no external scripts
✅ No duplication: Single azd command invocation with conditional DEBUG_FLAG
✅ Easy to understand: All logic visible directly in workflow files
✅ Consistent behavior: Same pattern across all azd command invocations
✅ Maintainable: Straightforward conditional logic
Modified Files
.github/workflows/azure-dev.yml - Added DEBUG_FLAG pattern for azd provision and azd down
.github/workflows/azure-dev-down.yml - Added DEBUG_FLAG pattern for azd provision and azd down
Related Issue(s)
Links to related issues will be added by the system
Original prompt
Fixes [Bug] Linter Workflow Outputs No Error Details #254