Consuming messages from an Azure Service Bus
Now that we have written the context to the Azure Service Bus, we need to consume this message. This recipe will focus on writing a console application that continuously listens to incoming messages, pops them off the Azure Service Bus queue, and reads the content of the Dynamics365 RemoteExecutionContext
included in the message.
Getting ready
Starting with the required assemblies, you'll need the Microsoft.CrmSdk.CoreAssemblies
as well as WindowsAzure.ServiceBus
NuGet packages.
You can find the first one by searching for Dynamics Core Assemblies
in your NuGet manager and the second one by searching for Azure Service Bus
:
In order to connect to your Azure Service Bus queue, you will need the previously created Service Bus connection string (the RootManageSharedAccessKey connection string, not the queue shared access policy connection string) as well as its queue name.
How to do it...
- Create a new console application in Visual Studio with a namespace...