-
Notifications
You must be signed in to change notification settings - Fork 378
Update mi test mi for region lock sfi #5538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Replace old MI client ID (3b57c42c-3201-4295-ae27-d6baec5b7027) with new MI (45344e7d-c562-4be6-868f-18dac789c021) - Replace old MI object ID (9fc6a41b-e161-43ba-90ba-12f172141c23) with new MI (a38637b6-b365-4652-af1f-cf5d8cf829ad) - Update resource ID from MSAL_MSI_USERID to Msal_Integration_tests - Update location from East US 2 to East US - Update readme.md documentation with new MI details and Azure portal links - All tests passing with new managed identity configuration
- Remove separate LabVaultAccessUserAssignedClientID (4b7a4b0b-ecb2-409e-879a-1e21a15ddaf6) - Update AcquireMsiToken_ExchangeForEstsToken_Successfully test to use consolidated UAMI - Use single UserAssignedClientID (45344e7d-c562-4be6-868f-18dac789c021) for both MSI and Key Vault access - Add documentation comments explaining the consolidation Note: Token exchange test requires federated identity credential in RequestMSIDLAB app registration
- Update ManagedIdentityImdsTests.cs to use ID4SMSIHostedAgent_UAMI - Client ID: 8ef2ae5a-f349-4d36-bc0e-a567f2cc50f7 - Object ID: 0651a6fc-fbf5-4904-9e48-16f63ec1f2b1 - Resource ID: /subscriptions/6f52c299-a200-4fe1-8822-a3b61cf1f931/resourcegroups/DevOpsHostedAgents/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ID4SMSIHostedAgent_UAMI - Fixes pool access issues where E2E tests couldn't access the consolidated MI
- Change SAMI test to use explicit client ID instead of null - Resolves 'Multiple user assigned identities exist' error in IMDS - Maintains compatibility with main branch by keeping both UAMIs on pool - All 4 test cases now specify explicit identity parameters
[DataRow(null /*SAMI*/, null, DisplayName = "SAMI")] | ||
[DataRow("4b7a4b0b-ecb2-409e-879a-1e21a15ddaf6", "clientid", DisplayName = "UAMI-ClientId")] | ||
[DataRow("/subscriptions/c1686c51-b717-4fe0-9af3-24a20a41fb0c/resourcegroups/MSAL_MSI/providers/Microsoft.ManagedIdentity/userAssignedIdentities/LabVaultAccess_UAMI", | ||
[DataRow("8ef2ae5a-f349-4d36-bc0e-a567f2cc50f7", "clientid", DisplayName = "SAMI-as-UAMI")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to pass null here so we can test SAMI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into the issue below when using Null and having Multiple resources assigned. Is there a way to specify without breaking the null test?
Managed Identity E2E Test Pool Configuration Issue
Problem: The ID4SMSIHostedAgent pool had multiple User Assigned Managed Identities (UAMIs) configured:
Legacy cross-subscription LabVaultAccess_UAMI (4b7a4b0b-ecb2-409e-879a-1e21a15ddaf6)
New local ID4SMSIHostedAgent_UAMI (8ef2ae5a-f349-4d36-bc0e-a567f2cc50f7)
Error: When the E2E test attempted to use System Assigned Managed Identity (SAMI) with null client ID, the Azure IMDS service returned:
Status: BadRequest
"Multiple user assigned identities exist, please specify the clientId / resourceId of the identity in the token request"
Root Cause: Azure's Instance Metadata Service (IMDS) requires explicit identity specification when multiple UAMIs are assigned to a resource. The test's SAMI approach (using null/default) became ambiguous.
Solution: Modified the E2E test to explicitly specify the local UAMI's client ID (8ef2ae5a-f349-4d36-bc0e-a567f2cc50f7) instead of relying on default SAMI behavior.
Why This Approach:
Maintains backward compatibility for main branch builds that depend on the legacy UAMI
Avoids infrastructure changes that could impact other test pools or pipelines
Provides explicit identity specification, eliminating ambiguity
Ensures all test cases use the correct local UAMI that the pool has proper access to
Summary
Consolidates Key Vault User Assigned Managed Identity (UAMI) and updates Managed Identity test infrastructure for improved reliability and maintainability.
Changes Made
🔧 Infrastructure Updates
4b7a4b0b-ecb2-409e-879a-1e21a15ddaf6
)LabVaultAccess_UAMI
to SLVM build agent for MI E2E test supportMSID_LABS_PPE
subscription for build agent inMSID_DEVX_RED_SBX
📝 Code Changes
✅ Testing Results
🎯 Impact
Testing
Related Issues
Addresses MI E2E test failures in build pipelines by properly configuring required UAMI assignments.