有没有人设法使用 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())));