Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 15, 2025

When the AZD_DEBUG environment variable is set, the AzureDeveloperCliCredential hangs indefinitely because the Azure Developer CLI prompts for user input:

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

This causes the credential to timeout as it waits for interactive input that never comes in automated scenarios.

The fix adds the --no-prompt flag to all azd auth token commands 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:

  • Modified GetFileNameAndArguments method to include --no-prompt flag
  • Added test to verify the flag is included in command arguments

Fixes #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.

Copilot AI changed the title [WIP] [Identity] Disable interactive prompts in AzureDeveloperCliCredential token commands Fix AzureDeveloperCliCredential hanging when AZD_DEBUG is set Aug 15, 2025
Copilot AI requested a review from christothes August 15, 2025 15:28
Copilot finished work on behalf of christothes August 15, 2025 15:28
Copilot AI requested a review from christothes August 15, 2025 16:05
Copilot finished work on behalf of christothes August 15, 2025 16:05
@christothes christothes marked this pull request as ready for review August 15, 2025 19:54
@Copilot Copilot AI review requested due to automatic review settings August 15, 2025 19:54
@christothes christothes requested review from a team and JonathanCrd as code owners August 15, 2025 19:54
Copy link
Contributor

Copilot AI left a 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-prompt flag to all azd auth token commands 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.

@christothes christothes enabled auto-merge (squash) August 19, 2025 14:54
@christothes
Copy link
Member

/check-enforcer override

@christothes christothes merged commit 84da2dd into main Aug 19, 2025
27 checks passed
@christothes christothes deleted the copilot/fix-52005 branch August 19, 2025 16:41
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

4 participants