Skip to content

Conversation

@gladjohn
Copy link
Contributor

@gladjohn gladjohn commented Oct 29, 2025

Fixes - fallback to IMDS in Preview

We already fallback to IMDS in PROD. But when the MSI v2 endpoints exist, we do not fallback.

Changes proposed in this request

  • if preview use MSI v2
  • fallback to IMDS in PROD

Testing
unit, integration and e2e

Performance impact
none

Documentation

  • All relevant documentation is updated.

@gladjohn gladjohn requested a review from a team as a code owner October 29, 2025 23:40
@gladjohn gladjohn changed the title fallback to IMDS in PROD Fallback to IMDS in Preview Oct 29, 2025
@gladjohn gladjohn changed the title Fallback to IMDS in Preview Bearer Requests should Fallback to IMDS in Preview Oct 29, 2025
@gladjohn gladjohn merged commit 2d65ccd into main Oct 30, 2025
11 checks passed
@gladjohn gladjohn deleted the gladjohn/msiv2_source_check_fix branch October 30, 2025 23:16
@bgavrilMS bgavrilMS added this to the 4.79.0 milestone Nov 10, 2025
Comment on lines +1468 to +1470
[DataTestMethod]
[DataRow(UserAssignedIdentityId.None, null)]
[DataRow(UserAssignedIdentityId.ClientId, TestConstants.ClientId)]
Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent with all other test, can you also add cases for ResourceId and ObjectId?

using (new EnvVariableContext())
using (var httpManager = new MockHttpManager())
{
ManagedIdentityClient.ResetSourceForTest();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we have something that runs before each test? Shouldn't this be put there?

Copy link
Contributor

@Robbie-Microsoft Robbie-Microsoft left a comment

Choose a reason for hiding this comment

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

Is this functionality temporary? If so, can you add comments in the code stating that this will be reversed when this hits GA?

if ((source == ManagedIdentitySource.DefaultToImds) && isMtlsPopRequested)
// If the source is determined to be ImdsV1 and mTLS PoP was requested,
// throw an exception since ImdsV1 does not support mTLS PoP
if (source == ManagedIdentitySource.DefaultToImds && isMtlsPopRequested)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be elif? You want both if statements to run?

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.

6 participants