I created a new WorkerRole using a template for QueueWorkerRole in VS 2013, and it creates code that looks like this:
var connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
if (!namespaceManager.QueueExists(QueueName))
{
namespaceManager.CreateQueue(QueueName);
}
_client = QueueClient.CreateFromConnectionString(connectionString, QueueName);
The problem I am facing is setting Microsoft.ServiceBus.ConnectionString correctly so that it works with my local development queues running in the emulator. By default, it sets this as follows:
<appSettings>
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]" />
</appSettings>
And I assume that this will work fine when I have a hosting service to connect, but I just test some things locally and cannot connect it.
"UseDevelopmentStorage = True", , "127.0.0.1:10001", , : http://www.connectionstrings.com/windows-azure/ (DefaultEndpointsProtocol = https; AccountName = devstoreaccount1;
AccountKey = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw ==;) .
" " Compute Emulator, , .
.