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

[BUG] Slow VisualStudioCredential performance when accessing Azure App Config in a multi-tenant setup #41433

Closed
clbarrett opened this issue Jan 21, 2024 · 3 comments
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@clbarrett
Copy link

clbarrett commented Jan 21, 2024

Library name and version

Azure.Identity 1.10.4
Microsoft.Azure.AppConfiguration.AspNetCore 7.0.0

Describe the bug

The situation is that I'm setting up a ChainedTokenCredential to use the Visual Studio Credentials followed by Azure CLI Credentials when running locally. Weirdly I'm seeing a connection time between 15-45 seconds when calling builder.Configuration.AddAzureAppConfiguration(...) using the Visual Studio Credential. But the connection is less than a second when using Azure CLI alone. Same behavior persists when I used only Visual Studio Credentials. Neither do I have the same issue connecting to an Azure Key Vault. Do note that this is in a multi-tenant scenario.

Expected behavior

Expect that the call to builder.Configuration.AddAzureAppConfiguration(...) completes in less than a second, just like when adding a Key Vault or using the Azure CLI Credentials.

Actual behavior

The builder.Configuration.AddAzureAppConfiguration(...) call takes anywhere from 15 to 45 seconds to complete.

Reproduction Steps

My user is on Tenant A while my App Config is on Tenant B. The Tenant ID in my code is the Tenant B TenantID.

`List credentials = new List();
VisualStudioCredentialOptions vscOptions = new VisualStudioCredentialOptions()
{
AdditionallyAllowedTenants = { "*" },
//Not a real Tenant ID
TenantId = "88909005-48a7-48b4-b99b-73b1295c6424",
};
credentials.Add(new VisualStudioCredential(vscOptions));
var AzureIdentity = new ChainedTokenCredential(credentials.ToArray());

config.AddAzureAppConfiguration(options =>
{
options.Connect("https://insertappconfignamehere.azconfig.io/", AzureIdentity)
.Select(KeyFilter.Any, LabelFilter.Null);
});`

For comparison swap VisualStudioCredential & Options with AzureCliCredential & Options.

Environment

Windows 11
Visual Studio 2022 64 bit - Version 17.8.3
C#
Asp.Net 6.0

@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 21, 2024
@jsquire jsquire self-assigned this Jan 21, 2024
@jsquire
Copy link
Member

jsquire commented Jan 21, 2024

//fyi: @christothes

@jsquire
Copy link
Member

jsquire commented Jan 21, 2024

Hi @clbarrett. Thanks for reaching out and we regret that you're experiencing difficulties. As you've noted that the slow performance seems isolated to use with the AppConfig extension, I've transferred this over to the team that maintains the extension as #513 to ensure that the folks best able to assist have visibility. We'll work with them as needed to provide information on the Identity credentials.

For now, I'm going to close this issue out. Should the AppConfig team's investigation indicate that this is a credential-related issue, we'll reactivate.

@clbarrett
Copy link
Author

Thanks for helping me get this to the right place.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Development

No branches or pull requests

2 participants