•   Posted in: 
  • CRM

Do you know what the selected option below is:

Untitled

Until I starting playing with Azure and discovered that CRM has built in functionality to send messages to the Azure Service Bus (i.e. this) I didn’t even give it a moments thought. This option in the CRM plugin registration tool is the entry point to getting your solution talking to Azure and opening up some new and exciting opportunities.

In this post, I will quickly run through how to register a new service endpoint, which is a little bit more complex then just clicking the highlighted option. This will include how to create the service bus in Azure. In a later post I will discuss what you can do with this once it is up and running.

First up, you need to create the service bus in Azure. If you don’t already have an Azure subscription jump on to azure.microsoft.com and sign up for a free trial. For this example we will use a Queue, but there are several other options that you can use as well, each provides different capabilities. I won’t screen shot every step, but this is a simple case (as of the time of this post – Azure may change all of this in the future) of clicking on the following:

  1. + NEW
  2. APP SERVICES
  3. SERVICE BUS
  4. QUEUE
  5. CUSTOM CREATE
  6. Specify Queue Name, Region and either use existing or create a new namespace
  7. Configure the queue with the options you want.
  8. Make sure Enable Partitioning is unticked, otherwise you won’t be able to use it with CRM
  9. Click the tick icon down the button to accept

Azure will then go away and in a minute or two finish creating and activating your service bus.

Next up, we need to get the connection information to plug into CRM and get it talking to your new service bus. To get this information you need to select the service bus (note: there is a difference between selecting the service bus and going into it and seeing the queues, you need to click on a column other than the Namespace Name to select it) and click CONNECTION INFORMATION at the bottom of your screen. All you need from this screen is the default key and they provide a copy button beside it if you are too lazy to select and copy it yourself.

Now we can get back to that initial image. Connect the plugin registration tool to your CRM organisation and hit Register New Service End Point:

image

In this screen fill in:

  1. Name: the name you want to call this connection
  2. Description: an optional description of what this is for
  3. Solution Namespace: the name of the service bus namespace you created or used in Azure above
  4. Path: the name of the queue you created above
  5. Contract: Queue (for this example at least)
  6. Claim: None
  7. Federated Mode: Unticked

Then click Save & Configure ACS and you should see this screen:

image

Fill in:

  1. Management Key: The default key you copied from the connection information screen in Azure earlier 
  2. Certificate File: In CRM browse to Customizations, Developer Resources (or just click the link in the dialog shown above), download the certificate and browse to where you downloaded it
  3. Issuer Name: You will find this in the same place as the certificate. Should be something along the lines of crm.dynamics.com or crm5.dynamics.com depending on your region.

Then click Configure ACS and if everything goes well, close the dialog, save and verify, save again and you are done. You should now have a brand new service endpoint configured in CRM. This will not do anything yet, but in my next post I will show you some things you can try. The CRM SDK is also a great source of sample code to carry on from this.