gpt4 book ai didi

c# - Microsoft.ServiceBus.NamespaceManager - 托管服务标识 (MSI)

转载 作者:行者123 更新时间:2023-12-03 01:05:14 28 4
gpt4 key购买 nike

有人设法使用 NamespaceManager 实现托管服务身份吗?

我使用了以下 QueueClient 示例,但似乎找不到 NamespaceManager 的任何内容。

MessagingFactorySettings messagingFactorySettings = new MessagingFactorySettings
{
TokenProvider = TokenProvider.CreateManagedServiceIdentityTokenProvider(ServiceAudience.ServiceBusAudience),
TransportType = TransportType.Amqp
};

messagingFactorySettings.AmqpTransportSettings.EnableLinkRedirect = false;

MessagingFactory messagingFactory = MessagingFactory.Create("sb:/namespace",
messagingFactorySettings);

QueueClient queueClient = messagingFactory.CreateQueueClient("testqueue");
queueClient.Send(new BrokeredMessage(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())));

最佳答案

Has anyone managed to implement Managed Service Identity with NamespaceManager?

不幸的是,根据Managed Service Identity (preview) ,我们无法在托管服务标识中使用 .NET Framework 客户端 NamespaceManager 对象。

management operations that change the namespace topology are initially supported only though Azure Resource Manager and not through the native Service Bus REST management interface.

you cannot use the .NET Framework client NamespaceManager object within a managed service identity.

如果您想操作servicebus namcespace,我建议您可以使用Azure fluent SDK Microsoft.Azure.Management.FluentMicrosoft.Azure.Management.ResourceManager.Fluent要做到这一点。详细的demo代码可以引用这个SO thread .

关于c# - Microsoft.ServiceBus.NamespaceManager - 托管服务标识 (MSI),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50287349/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com