Azure / azure-service-bus-emulator-installer

This repository acts as a central hub for handling issues, collecting feedback, and facilitating discussions related to the Azure Service Bus Emulator.
https://learn.microsoft.com/en-us/azure/service-bus-messaging/overview-emulator
MIT License
100 stars 2 forks source link

Support for identity-based connection #30

Open asos-iqan opened 13 hours ago

asos-iqan commented 13 hours ago

Hi,

The app fails to send or receive messages from servicebus emulator when ServiceBusClient was created using identity-based connection.

Steps to reproduce:

// running service bus emulator using docker compose before executing this code

using Azure.Identity;
using Azure.Messaging.ServiceBus;

var client = new ServiceBusClient("localhost", new DefaultAzureCredential());
var sender = client.CreateSender("topic");
await sender.SendMessageAsync(new ServiceBusMessage("Hello, World!"));

Exception:

No connection could be made because the target machine actively refused it. ErrorCode: ConnectionRefused (ServiceCommunicationProblem). For troubleshooting information, see https://aka.ms/azsdk/net/servicebus/exceptions/troubleshoot.
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.SendBatchInternalAsync(AmqpMessage batchMessage, TimeSpan timeout, CancellationToken cancellationToken)
   at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<SendAsync>b__32_0>d.MoveNext()
--- End of stack trace from previous location ---

Does emulator support identity-based connections? If yes, is there any guidance on what would be the value for service bus fully qualified namespace? (localhost, sbemulatorns, something else...) If no, are there any plans to support this in future?