[英]Using a managed identity with Azure Service Bus
I want to use a managed identity to connect to Azure Service Bus.我想使用托管标识连接到 Azure 服务总线。 In the docs they mention the DefaultAzureCredentialBuilder.
在文档中,他们提到了 DefaultAzureCredentialBuilder。 I don't really get how this would use my managed identity to authenticate to the Service Bus.
我真的不明白这将如何使用我的托管身份对服务总线进行身份验证。
Does anyone know this?有人知道吗?
DefaultAzureCredential
is a chained credential; DefaultAzureCredential
是一个链式凭证; internally it considers multiple authorization sources, including managed identities.在内部,它考虑了多个授权源,包括托管身份。 More information can be found in the Azure.Identity overview .
可以在Azure.Identity 概述中找到更多信息。
Service Bus can use any of the Azure.Identity credentials for authorization.服务总线可以使用任何Azure.Identity 凭据进行授权。
DefaultAzureCredentialBuilder
is demonstrated only because it allows for success in a variety of scenarios.演示
DefaultAzureCredentialBuilder
只是因为它允许在各种场景中取得成功。
If you'd prefer to restrict authorization to only a managed identity, you can do so by using ManagedIdentityCredentialBuilder
rather than the default credential.如果您希望将授权仅限于托管标识,则可以使用
ManagedIdentityCredentialBuilder
而不是默认凭据来实现。 An example of creating the can be found here .可以在此处找到创建的示例。 It can then be passed to Service Bus in the same manner as the default credential.
然后可以将其以与默认凭据相同的方式传递给服务总线。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.