Content-Length: 311457 | pFad | http://github.com/Azure/azure-sdk-for-net/pull/50501

EA Refactor managed identity as FIC implementation in extensions lib by scottaddie · Pull Request #50501 · Azure/azure-sdk-for-net · GitHub
Skip to content

Refactor managed identity as FIC implementation in extensions lib #50501

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

Merged
merged 2 commits into from
Jun 10, 2025

Conversation

scottaddie
Copy link
Member

@scottaddie scottaddie commented Jun 9, 2025

Summary of changes

@Copilot Copilot AI review requested due to automatic review settings June 9, 2025 21:45
@scottaddie scottaddie requested a review from jsquire as a code owner June 9, 2025 21:45
@github-actions github-actions bot added the Extensions ASP.NET Core extensions label Jun 9, 2025
Copy link
Contributor

@Copilot 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

Refactors the managed identity federated identity credential implementation to use the new ManagedIdentityId.From helpers, updates configuration keys and exception messaging in the client factory, and corrects the changelog’s documentation link.

  • Simplify ManagedFederatedIdentityCredential by consolidating constructors and using ManagedIdentityId.
  • Update ClientFactory to use ManagedIdentityId.From* methods and adjust the error message parameter names.
  • Fix the changelog link to point directly at the revised docs section.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ManagedFederatedIdentityCredential.cs Removed overloads and switch, now uses single constructor with ManagedIdentityId.
sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientFactory.cs Updated exception text and switched calls to ManagedIdentityId.FromUserAssigned*.
sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md Updated feature link to the correct anchors in the Microsoft docs.
Comments suppressed due to low confidence (2)

sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientFactory.cs:200

  • The objectId branch still passes the raw objectId string instead of using ManagedIdentityId.FromUserAssignedObjectId. Update this to use ManagedIdentityId.FromUserAssignedObjectId(objectId) for consistency with the other branches.
return new ManagedFederatedIdentityCredential(tenantId, clientId, objectId, azureCloud, additionallyAllowedTenantsList);

sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ManagedFederatedIdentityCredential.cs:68

  • Consider adding unit tests to verify that the simplified constructor correctly handles each ManagedIdentityId variant (client ID, resource ID, object ID) and yields the expected ManagedIdentityCredential.
_managedIdentityCredential = new ManagedIdentityCredential(managedIdentityId);

@scottaddie scottaddie requested a review from jsquire June 9, 2025 23:41
@scottaddie scottaddie enabled auto-merge (squash) June 9, 2025 23:43
@jsquire jsquire disabled auto-merge June 9, 2025 23:57
@jsquire jsquire merged commit db06b68 into main Jun 10, 2025
18 checks passed
@jsquire jsquire deleted the scottaddie/mi-as-fic branch June 10, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extensions ASP.NET Core extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Azure/azure-sdk-for-net/pull/50501

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy