0
votes

I am trying to connect to my Azure Service Bus from my Worker Role using AMQP. However, I get a time-out exception. When I use a network sniffer I see that it is trying to communicate to the Azure Service Bus using port 5671. But it's not sending an ACK message, it just times-out. I try this from Visual Studio 2015 with the Azure Emulator.

When I try exactly the same, from the same computer and network interface, but then from a normal command prompt application (so no Azure Worker Role and/or Emulator), it works. My application is able to send an ACK package to Azure and receives a Server Hello from Azure.

Is the Azure Emulator or the Worker Role blocking some ports by default? Why is it working from my command prompt application but not from my Azure Worker Role? I use the same connectionstring and the following code:

TopicClient client = TopicClient.CreateFromConnectionString(_connectionstring, _queueName);
client.Send(new BrokeredMessage(msg));
2

2 Answers

1
votes

I finally found the issue. In the solution which uses the Azure Emulator, I included the following package:

<package id="WindowsAzure.ServiceBus" version="2.5.1.0" targetFramework="net451" />

In my console application I used the following package:

<package id="WindowsAzure.ServiceBus" version="3.0.9" targetFramework="net46" />

So changing my Azure solution to version 3.0.9 solved the problem. Seems like Microsoft introduced a breaking change in version 3.x.

0
votes

In order of likelihood, I'd guess the issue is that:

  • _connectionstring has different values in VS vs. your Console application; perhaps due to the configuration files used at runtime and/or however you are loading the connection string. I'd recommend re-trying your test with hard-coded values in CreateFromConnectionString() to rule that out.
  • There is a firewall blocking the port (Windows Firewall, corporate network, etc.)
  • There is an antivirus interfering with the traffic