-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix AzureDeveloperCliCredential hanging when AZD_DEBUG is set #52013
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
Co-authored-by: christothes <[email protected]>
AzureDeveloperCliCredential token commands
sdk/identity/Azure.Identity/src/Credentials/AzureDeveloperCliCredential.cs
Show resolved
Hide resolved
Co-authored-by: christothes <[email protected]>
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 fixes a hanging issue in AzureDeveloperCliCredential when the AZD_DEBUG environment variable is set. The Azure Developer CLI prompts for interactive input in debug mode, causing the credential to timeout in automated scenarios.
- Adds the
--no-promptflag to allazd auth tokencommands to disable interactive prompts - Includes a test to verify the flag is properly added to command arguments
- Updates the changelog to document this bug fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sdk/identity/Azure.Identity/src/Credentials/AzureDeveloperCliCredential.cs |
Modified command construction to include --no-prompt flag in both tenant-specific and general auth token commands |
sdk/identity/Azure.Identity/tests/AzureDeveloperCliCredentialTests.cs |
Added test case to verify the --no-prompt flag is included in command arguments |
sdk/identity/Azure.Identity/CHANGELOG.md |
Added changelog entry documenting the bug fix |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
/check-enforcer override |
When the
AZD_DEBUGenvironment variable is set, theAzureDeveloperCliCredentialhangs indefinitely because the Azure Developer CLI prompts for user input:This causes the credential to timeout as it waits for interactive input that never comes in automated scenarios.
The fix adds the
--no-promptflag to allazd auth tokencommands to disable interactive prompts:Before:
azd auth token --output json {scopeArgs}azd auth token --output json {scopeArgs} --tenant-id {tenantId}After:
azd auth token --output json --no-prompt {scopeArgs}azd auth token --output json --no-prompt {scopeArgs} --tenant-id {tenantId}This ensures the credential works reliably in all environments, regardless of debug settings.
Changes:
GetFileNameAndArgumentsmethod to include--no-promptflagFixes #52005.
💡 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.