Skip to content

[Identity] Add --no-prompt flag to AzureDeveloperCliCredential to prevent hanging with AZD_DEBUG #2914

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 15, 2025

When the AZD_DEBUG environment variable is set, the azd auth token subprocess hangs indefinitely waiting for user input:

$ AZD_DEBUG=1 azd auth token --output json --scope https://search.azure.com/.default
? Debugger Ready? (pid: 259503) (Y/n)

This causes AzureDeveloperCliCredential.get_token() to timeout when debugging is enabled.

This PR adds the --no-prompt flag to the azd auth token command to prevent interactive prompts and ensure the credential works reliably regardless of debug settings.

Changes:

  • Added --no-prompt to the azd command construction in get_token()
  • Updated test assertions to verify the flag is included in generated commands

Example command before:

azd auth token -o json --scope https://management.azure.com/.default

Example command after:

azd auth token -o json --no-prompt --scope https://management.azure.com/.default

All existing tests pass and the change is backward compatible.

Fixes #2910.


💡 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.

…ctive prompts

Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [Identity] Disable interactive prompts in AzureDeveloperCliCredential token commands [Identity] Add --no-prompt flag to AzureDeveloperCliCredential to prevent hanging with AZD_DEBUG Aug 15, 2025
@Copilot Copilot AI requested a review from heaths August 15, 2025 21:32
Copilot finished work on behalf of heaths August 15, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Identity] Disable interactive prompts in AzureDeveloperCliCredential token commands
2 participants