When using .UseAzureServiceBus(..) or .UseAzureServiceBusAsOneWayClient(..) with an ITokenProvider, the connection string is parsed internally, and parts of it used for sending and receiving in regards to Azure Service Bus.
When the transport is set up without specifying an ITokenProvider, the original connection string makes it all the way to the Service Bus SDK client and it works as expected, but when it is parsed and parts of it used to create the client manually, the transport type option is stripped away, meaning the default transport type of AMQP is always used. So, this problem only appears when used in conjunction with ITokenProvider.
Example of a connection string;
Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=Root..;SharedAccessKey=XYoXQ...;TransportType=AmqpWebSockets
When using
.UseAzureServiceBus(..)
or.UseAzureServiceBusAsOneWayClient(..)
with anITokenProvider
, the connection string is parsed internally, and parts of it used for sending and receiving in regards to Azure Service Bus.When the transport is set up without specifying an
ITokenProvider
, the original connection string makes it all the way to the Service Bus SDK client and it works as expected, but when it is parsed and parts of it used to create the client manually, the transport type option is stripped away, meaning the default transport type ofAMQP
is always used. So, this problem only appears when used in conjunction withITokenProvider
.Example of a connection string;
Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=Root..;SharedAccessKey=XYoXQ...;TransportType=AmqpWebSockets