Skip to content

Update auth lib to latest#29505

Draft
isra-fel wants to merge 4 commits intoAzure:mainfrom
isra-fel:azure-identity-1.21.0
Draft

Update auth lib to latest#29505
isra-fel wants to merge 4 commits intoAzure:mainfrom
isra-fel:azure-identity-1.21.0

Conversation

@isra-fel
Copy link
Copy Markdown
Member

@isra-fel isra-fel commented May 5, 2026

  • Update dependencies and suppress warnings for obsolete credential types
  • todo
  • Update package references and clean up unused dependencies across multiple projects
  • continue addressing the namespace conflicts

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings May 5, 2026 16:40
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@@ -22,10 +22,12 @@ namespace Microsoft.Azure.PowerShell.Authenticators.Factories
{
public class AzureCredentialFactory
{
#pragma warning disable CS0618 // ManagedIdentityCredential(string) is obsolete; suppressed pending migration to ManagedIdentityId API
public virtual TokenCredential CreateManagedIdentityCredential(string clientId)
{
return new ManagedIdentityCredential(clientId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To avoid more testing down the road, switch to the replacement overload for user-assigned managed identity with client ID. Then you can remove the warning suppression for this method.

Suggested change
return new ManagedIdentityCredential(clientId);
return new ManagedIdentityCredential(ManagedIdentityId.FromUserAssignedClientId(clientId));

@@ -56,8 +56,10 @@ public async Task UserAssignedMSI()

var mockAzureCredentialFactory = new Mock<AzureCredentialFactory>();
//id must be equal to accountId
#pragma warning disable CS0618 // ManagedIdentityCredential(string) is obsolete; suppressed pending migration
mockAzureCredentialFactory.Setup(f => f.CreateManagedIdentityCredential(It.Is<string>(id => id == accountId)))
.Returns(new ManagedIdentityCredential(accountId));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See my other comment about using the replacement overload

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.

3 participants