Developing solutions with Azure Service Bus SDK

There is a rich database of many different examples for working with Azure Service Bus, available on GitHub (you can find a link in the Further reading section), so we will cover only the basic ones in this chapter. Here you can find the most simple way to send a message to a queue:

using System.Text;using System.Threading.Tasks;using Microsoft.Azure.ServiceBus;namespace HandsOnAzure.ServiceBus{    internal class Program    {        private static void Main()        {            MainAsync().GetAwaiter().GetResult();        }        private static async Task MainAsync()        {            var client = new QueueClient("<connection-string>", "<queue-name>");            var message = "This is my message!"; await client.SendAsync(new Message(Encoding.UTF8.GetBytes(message))); ...

Get Hands-On Azure for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.