Skip to content
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

Added support to Microsoft.Extensions.Azure for configuring managedIdentityObjectId #46909

Merged
merged 6 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Features Added

- Added support for constructing a `DefaultAzureCredential` or `ManagedIdentityCredential` from config by setting the `managedIdentityObjectId` key.
- Added support for constructing a `ManagedIdentityCredential` from config by setting the `managedIdentityObjectId` key.
christothes marked this conversation as resolved.
Show resolved Hide resolved

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ public void CreatesDefaultAzureCredential(
IConfiguration configuration = new ConfigurationBuilder().AddInMemoryCollection(configEntries).Build();

// if both clientId and resourceId set, we expect an ArgumentException
// We also expect an exception if objectId is set for DefaultAzureCredential, as it is only supported for ManagedIdentityCredential
if ((clientId && resourceId) || objectId)
christothes marked this conversation as resolved.
Show resolved Hide resolved
{
Assert.Throws<ArgumentException>(() => ClientFactory.CreateCredential(configuration));
Expand Down Expand Up @@ -342,8 +343,6 @@ public void CreatesDefaultAzureCredential(
Assert.AreEqual("tenantId", pwshCredential.TenantId);
}

// TODO: Since these can't build with project reference, we have to comment them out for now.
// When we resolve https://github.com/Azure/azure-sdk-for-net/issues/45806, we can add them back.
string managedIdentityId;
int idType;
ReflectIdAndType(miCredential, out managedIdentityId, out idType);
Expand Down
Loading