-
Notifications
You must be signed in to change notification settings - Fork 382
Migrate All lab helper methods to Key Vault/Region test migration. #5606
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
Draft
RyAuld
wants to merge
9
commits into
main
Choose a base branch
from
MigrateOtherAPIRequests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace direct msidlab.com API call with Key Vault data retrieval - Use MergeKVLabDataAsync pattern consistent with other migrated methods - Maintains same functionality while reducing external API dependencies
- Migrate GetArlingtonUserAsync to use MergeKVLabDataAsync with Key Vault secrets - Migrate GetArlingtonADFSUserAsync to use MergeKVLabDataAsync with Key Vault secrets - Replace direct msidlab.com API calls with pre-cached Key Vault data retrieval - Maintains same functionality while reducing external API dependencies - Uses consistent pattern with other migrated methods (B2C, default users) - Arlington ADFS migration verified working in tests - Arlington standard method has Key Vault data quality issue to be resolved separately
- Added GetCIAMUserAsync() method in LabUserHelper using Key Vault secrets - Updated all 4 CIAM integration tests to use new method instead of direct API calls - Verified all tests pass with Key Vault cached data - Improves reliability by removing dependency on msidlab.com API calls
- Remove GetLabUserDataAsync (only used by obsolete GetAdfsUserAsync) - Remove GetAdfsUserAsync (no external callers, replaced by GetDefaultAdfsUserAsync) - Remove GetHybridSpaAccontAsync (no external callers, test now uses GetDefaultUserWithMultiTenantAppAsync) - Remove s_userCache field and System.Collections.Concurrent import (no longer needed) - Update TODO comments to remove references to deleted methods - All active functionality preserved, ~45 lines of obsolete code removed
…enant - Migrate PublicLegacyCloudConfidentialAppSettings from legacy MSIDLAB4 to ID4SLAB1 tenant - Update Client ID to 54a2d933-8bf8-483b-a8f8-0a31924f3c1f (MSAL-APP-AzureADMultipleOrgs) - Update Tenant ID to 10c419d4-4a50-45b2-aa4e-919fb84df24f (ID4SLAB1) - Change secret from MSIDLAB4-IDLABS-APP-AzureADMyOrg-CC to MSAL-APP-AzureADMultipleOrgs - Switch Key Vault instance from MSIDLab to MsalTeam - Update regional endpoint from centralus to eastus2 for ID4SLAB1 tenant location - Update Region constant from centralus to eastus2
…microsoft-authentication-library-for-dotnet into MigrateOtherAPIRequests
- Updated RegionDiscoveryProviderTests to use TestConstants.Region instead of hardcoded 'centralus' - Fixed ClientCredentialsTests.WithRegion to use dynamic regional host configuration - Updated ClientCredentialWithRegionTests, MtlsPopTests, and MsalExceptionTests to use TestConstants.Region - Ensures all regional tests are consistent with ID4SLAB1 tenant's eastus2 configuration - Resolves test failures caused by region expectation mismatches
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrate Test Infrastructure from msidlab.com API to Key Vault + IMDS V2 Improvements
Overview
This PR contains two major improvements:
Key Changes
🔑 Key Vault Migration (Test Infrastructure Modernization)
Migrated Methods:
GetB2CLocalAccountAsync()now uses Key Vault secrets (B2C-User-IDLab-JSON,B2C-App-IDLABSAPPB2C-JSON) instead of direct API callsGetArlingtonUserAsync()andGetArlingtonADFSUserAsync()migrated to use Arlington Key Vault (ARL-User-IDLab-JSON,ARL-App-IDLABSAPP-JSON)GetCIAMUserAsync()now retrieves data from Key Vault (MSAL-User-CIAM-JSON,MSAL-App-CIAM-JSON) in MSIDLABCIAM6 tenantMSAL-APP-AzureADMultipleOrgsconfiguration in ID4SLAB1 tenant with eastus2 regionBenefits:
Implementation Pattern:
All migrations follow the established
MergeKVLabDataAsync()pattern:🔄 IMDS V2 Source Detection & Retry Policy Improvements
Enhanced Managed Identity Source Detection:
ImdsProbeRetryPolicy(renamed fromCsrMetadataProbeRetryPolicy) with better exponential backoffKey Improvements:
🏗️ Regional Configuration Updates
Updated Regional Test Configuration:
54a2d933-8bf8-483b-a8f8-0a31924f3c1f(MSAL-APP-AzureADMultipleOrgs)10c419d4-4a50-45b2-aa4e-919fb84df24f)centralus.login.microsoft.comtoeastus2.login.microsoft.comMsalTeamKey Vault withMSAL-APP-AzureADMultipleOrgssecret🧹 Code Cleanup & Maintenance
Removed Legacy Code:
LabUserHelper.csEnhanced Test Reliability:
Files Changed
Core Infrastructure
tests/Microsoft.Identity.Test.LabInfrastructure/LabUserHelper.cs- Key Vault migration implementationtests/Microsoft.Identity.Test.Integration.netcore/Infrastructure/ConfidentialAppSettings.cs- Regional configuration updatestests/Microsoft.Identity.Test.Common/TestConstants.cs- Regional endpoint updatesIMDS V2 Enhancements
src/client/Microsoft.Identity.Client/ManagedIdentity/V2/ImdsV2ManagedIdentitySource.cs- Enhanced probe logicsrc/client/Microsoft.Identity.Client/Http/Retry/ImdsProbeRetryPolicy.cs- Improved retry policies (renamed)src/client/Microsoft.Identity.Client/ManagedIdentity/ManagedIdentityClient.cs- Better source detectionsrc/client/Microsoft.Identity.Client/ManagedIdentity/V2/ImdsVersion.cs- New enumeration for version handlingTest Updates
tests/Microsoft.Identity.Test.Integration.netcore/HeadlessTests/*- Updated to use new Key Vault patternstests/Microsoft.Identity.Test.Unit/ManagedIdentityTests/*- Enhanced IMDS V2 test coveragetests/Microsoft.Identity.Test.Common/Core/Mocks/MockHelpers.cs- Improved mock supportTesting
Migration Impact
No Breaking Changes:
Improved Reliability:
Related Work
This PR consolidates multiple infrastructure improvements:
The migration establishes a robust foundation for future test infrastructure enhancements while maintaining backward compatibility and improving overall system reliability.