I am trying to setup a prototype using AF SB Queues. I am getting an error message “Could not connect to net.tcp://mjurekdemo.servicebus.windows.net:9354/” – this is expected – firewall issue.
So I want to force QueueClient to use HTTP protocol but despite using “ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;” it still tries to connect using TCP and I am getting the same error.I am sure HTTP connectivity works fine (e.g. I can create a Queue programmatically).
Thanks for any hint,
Let's say you are creating service URL with following code -
Uri address = ServiceBusEnvironment.CreateServiceUri("sb", "sampleservicebus", "myservice");
Then you code of setting connectivity mode should be added before previous code -
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;
When we try to connect service bus using TCP then, it always needs to open some port in firewall. If you are not opening any port in firewall then I don't think it is accepting connections over TCP.
I will be interested to know how you made sure that, connections is happening over TCP only?
Hoep this helps.
Mark As Answer if it helps you | My Blog