You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Identity] Add --no-prompt flag to AzureDeveloperCliCredential to prevent hanging with AZD_DEBUG (#2914)
When the `AZD_DEBUG` environment variable is set, the `azd auth token`
subprocess hangs indefinitely waiting for user input:
```shell
$ 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.
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 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](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: heaths <[email protected]>
0 commit comments