Skip to content

Commit 1ec3751

Browse files
authored
fix azd hang issue (#46598)
1 parent a05011e commit 1ec3751

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
### Breaking Changes
1111

1212
### Bugs Fixed
13+
- Fixed `AzureDeveloperCliCredential` hanging when `AZD_DEBUG` environment variable is set by adding `--no-prompt` flag to the `azd auth token` command.
1314

1415
### Other Changes
1516

sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public Mono<AccessToken> authenticateWithAzureCli(TokenRequestContext request) {
337337
* @return a Publisher that emits an AccessToken
338338
*/
339339
public Mono<AccessToken> authenticateWithAzureDeveloperCli(TokenRequestContext request) {
340-
StringBuilder azdCommand = new StringBuilder("azd auth token --output json --scope ");
340+
StringBuilder azdCommand = new StringBuilder("azd auth token --output json --no-prompt --scope ");
341341
List<String> scopes = request.getScopes();
342342

343343
// It's really unlikely that the request comes with no scope, but we want to

sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentitySyncClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public AccessToken authenticateWithAzureCli(TokenRequestContext request) {
401401
*/
402402
public AccessToken authenticateWithAzureDeveloperCli(TokenRequestContext request) {
403403

404-
StringBuilder azdCommand = new StringBuilder("azd auth token --output json --scope ");
404+
StringBuilder azdCommand = new StringBuilder("azd auth token --output json --no-prompt --scope ");
405405

406406
List<String> scopes = request.getScopes();
407407

0 commit comments

Comments
 (0)