Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for identity-based connection #30

Open
asos-iqan opened this issue Nov 21, 2024 · 3 comments
Open

Support for identity-based connection #30

asos-iqan opened this issue Nov 21, 2024 · 3 comments
Labels
question Further information is requested

Comments

@asos-iqan
Copy link

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?

@Saglodha
Copy link
Contributor

Hi @asos-iqan, Service Bus emulator isn't compatible with Azure Identity based connection. So far, we only support connection string usage with Service Bus emulator.

Would you mind elaborating more on the use case- Is the intent here to keep same code for local testing and prod testing? Or do you have a use case of using Azure Identity to do local testing?

@Saglodha Saglodha added the question Further information is requested label Nov 26, 2024
@asos-iqan
Copy link
Author

Hi @Saglodha - thanks for the response.
Yes, that is correct. We would like to test function as-is and not have specific changes in production code just to make it work with emulator.

@Saglodha
Copy link
Contributor

Thanks for clarifying @asos-iqan. We'll look deeper into this request and share update on this issue in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants