Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void ValidateDefaultAzureCredentialAZURE_TOKEN_CREDENTIALS_Honored_WithBr
Assert.IsTrue(chain.Any(cred => cred is VisualStudioCredential));
Assert.IsTrue(chain.Any(cred => cred is AzureDeveloperCliCredential));
Assert.IsTrue(chain.Any(cred => cred.GetType() == typeof(VisualStudioCodeCredential)));
Assert.IsFalse(chain.Any(cred => cred.GetType() == typeof(InteractiveBrowserCredential)));
Assert.IsTrue(chain.Any(cred => cred.GetType() == typeof(InteractiveBrowserCredential)));
}
else if (credSelection == Constants.ProdCredentials)
{
Expand Down
1 change: 1 addition & 0 deletions sdk/identity/Azure.Identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

- Fixed `AzureDeveloperCliCredential` hanging when the `AZD_DEBUG` environment variable is set by adding the `--no-prompt` flag to prevent interactive prompts ([#52005](https://github.com/Azure/azure-sdk-for-net/issues/52005)).
- `BrokerCredential` is now included in the chain when `AZURE_TOKEN_CREDENTIALS` is set to `dev` and the `Azure.Identity.Broker` package is installed.

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,21 @@ public TokenCredential[] CreateCredentialChain()
{
if (_useDevCredentials)
{
return
[
var devCredentials = new List<TokenCredential>
{
CreateVisualStudioCredential(),
CreateVisualStudioCodeCredential(),
CreateAzureCliCredential(),
CreateAzurePowerShellCredential(),
CreateAzureDeveloperCliCredential()
];
};

if (TryCreateDevelopmentBrokerOptions(out InteractiveBrowserCredentialOptions brokerOptions))
{
devCredentials.Add(CreateBrokerCredential(brokerOptions));
}

return devCredentials.ToArray();
}
else if (_useProdCredentials)
{
Expand Down Expand Up @@ -98,6 +105,10 @@ public TokenCredential[] CreateCredentialChain()
{
chain.Add(CreateManagedIdentityCredential());
}
if (!Options.ExcludeBrokerCredential && TryCreateDevelopmentBrokerOptions(out InteractiveBrowserCredentialOptions brokerOptions))
{
chain.Add(CreateBrokerCredential(brokerOptions));
}
}

if (!_useProdCredentials)
Expand Down