Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // Create the queue if it does not exist already
  2. var connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
  3. var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
  4. if (!namespaceManager.QueueExists(QueueName))
  5. {
  6. namespaceManager.CreateQueue(QueueName);
  7. }
  8.  
  9. // Initialize the connection to Service Bus Queue
  10. _client = QueueClient.CreateFromConnectionString(connectionString, QueueName);
  11.  
  12. <appSettings>
  13. <!-- Service Bus specific app setings for messaging connections -->
  14. <add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]" />
  15. </appSettings>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement