Skip to content

Conversation

@jsquire
Copy link
Member

@jsquire jsquire commented Oct 21, 2025

Summary

The focus of these changes is to improve the error messaging when configuration provided for one of the managed identity credentials is incorrect.

The focus of these changes is to improve the error
messaging when configuration provided for one of
the managed identity credentials is incorrect.
@jsquire jsquire added this to the 2025-11 milestone Oct 21, 2025
@jsquire jsquire requested a review from scottaddie October 21, 2025 23:33
@jsquire jsquire self-assigned this Oct 21, 2025
@jsquire jsquire added the Client This issue is related to a non-management package label Oct 21, 2025
@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 23:33
@jsquire jsquire added the Extensions ASP.NET Core extensions label Oct 21, 2025
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 improves error messaging for managed identity credential configuration issues. The changes clarify what configuration values must be provided and correct inconsistencies in the error messages.

Key Changes:

  • Updated error messages to remove references to environment variables (configuration only)
  • Fixed inconsistent identifier names in error messages to match actual configuration keys
  • Corrected the order of valid identifiers based on whether federated identity is being used

Comment on lines +416 to +417
? "'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId'"
: "'clientId', 'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId'";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic was correct before. If federated, clientId is required. The underlying ClientAssertionCredential will need it.

Suggested change
? "'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId'"
: "'clientId', 'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId'";
? "'clientId', 'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId'"
: "'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId'";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're missing L426. The message ends up being:

Managed Identity (non-fed)
I need a 'clientId', 'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId' to use.

Federated Managed Identity

I need a clientId AND "'managedIdentityClientId', 'managedIdentityResourceId', or 'managedIdentityObjectId' to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client This issue is related to a non-management package Extensions ASP.NET Core extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants