C# DefaultAzureCredentials + Visual Studio

huangapple go评论68阅读模式
英文:

C# DefaultAzureCredentials + Visual Studio

问题

目前,我正在将我们的应用程序从使用客户端ID +密钥连接到Azure App Config和Azure Key Vaults转换为使用DefaultAzureCredentials。总体而言,我喜欢我所获得的额外安全性。并且我可以通过Azure AD组(开发人员)和托管标识(部署的应用程序)的组合来管理访问权限。

我遇到的一个大问题是使用交互式浏览器凭据会将应用程序的启动时间增加约10秒。而且开发人员必须在应用程序继续启动之前在浏览器中手动点击他们的帐户。是否有一种方法可以让DefaultAzureCredentials使用Visual Studio帐户,而无需转到浏览器?或者是否有其他提高启动速度的方法?

英文:

Right now I'm converting our apps from connecting to Azure App Configs and Azure Key Vaults using Client IDs + Secrets to using the DefaultAzureCredentials. Overall, I like the additional security that I'm gaining. And that I can govern access via a combination of Azure AD Groups (Developers) and Managed Identities (Deployed Apps).

One big issue I'm running into is using the Interactive Browser Credential adds about 10 seconds to the startup time of the app. Plus developers have to manually click on their account in the browser before the app even continues launching. Is there a way to have the DefaultAzureCredentials use the Visual Studio account instead of having to go to the browser? Or is there any other way to improve startup speed?

答案1

得分: 1

这不适用于您的“Visual Studio 帐户”。您需要使用您的“Azure Ad 帐户”登录。

您可以使用来自 Visual Studio 的 Azure 服务身份验证 或使用 Azure Cli az login 来执行此操作。

AzureDefaultCredentials 会尝试按特定顺序尝试不同的身份验证方法,您可以在这里找到详细信息。

英文:

This doesn't work with your Visual Studio Account. You need to log in with your Azure Ad Account.

You can do this with the Azure Service Authentication from Visual Studio or with the Azure Cli az login.

AzureDefaultCredentials try different authentication methods in a specific order which you can find here.

huangapple
  • 本文由 发表于 2023年7月4日 23:32:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76614093.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定