In this blog we go through a step by step tutorial to setup a CRM-Azure Service Bus one way listener contract using ACS.
Prerequisite
- A CRM Online instance
- Microsoft Azure account
- Microsoft Azure SDK
- Visual Studio 2013/2015
- CRM2016 SDK V8.0.1 or less ( We will be using the plugin registration tool and sample code from the SDK. The plugin registration tool does not have ACS options from SDK v8.1 onwards)
Setting up a Service Bus Namespace
The first thing you need for the integration is a Service Bus namespace. If you already have an ACS namespace, you can skip this step.In the past you could login to the Azure portal and create an ACS namespace. But now, Azure portal does not allow the creation of ACS namespaces from the portal. It only creates a SAS namespace by default. We need to use PowerShell to create an ACS namespace.
- Open “Windows PowerShell ISE”
- Type Add-AzureAccount. It will open the login dialog. Enter the username and password for your Azure account and press login.If everything goes smoothly, the PowerShell output will look like the following screenshot.
- Type the following command below to create a Service Bus namespace. Replace ‘MSCRMShopBus’ with the namespace you want and press enter
New-AzureSBNamespace -Name "MSCRMShopBus" -Location "Australia East" -CreateACSNamespace $true -NamespaceType Messaging. Replace the parameters values as required. - The output screen will look like the following screenshot. It will create a namespaces for both ACS and SAS.
- This step is optional. Login to your Azure account and check the connection information of the Service Bus namespace. It will look like the following screen.
Get the Certificate file and Issuer name for CRM
For CRM OnlineTo get the security certificate and the issuer name for CRM go to Settings>>Customizations>>Developer Resources. Download the certificate file and also notice the issuer name of the certificate.
For CRM On Premise
For CRM on premise, follow the following article for step by step instructions.
https://msdn.microsoft.com/en-us/library/gg328249.aspx
Setting up the CRM Service Endpoint
Here are the steps- Start the plugin registration tool. It is available in the \SDK\Tools location of the SDK. I am using SDK v8.0.1.
- Click on Register>>Register New Service Endpoint
- It will open the the following page. Enter the Values as required and press “ Save & Configure ACS”.
Solution Name is the Service Bus namespace we created in the beginning of this blog.
Path is the path of your listener project. For example, when you run the listener project for a one-way listener for this blog, the service endpoint URL will look like https://mscrmshopbus.servicebus.windows.net/RemoteService
Contract is the type of contract we are using for the service endpoint. For the difference types of contracts check the last blog.
Setting up a listener application
- For this blog, I am using the Azure sample code that comes with the CRM SDK. Open the “OnewayListener” project from the location \SDK\SampleCode\CS\Azure\OneWayListener.
- Resolve the missing references. The 2 highlighted DLLs are available in the Azure SDK.
- Run the sample code. It will prompt for the following information.
Service Namespace is the Service Bus namespace.
Issuer name is the “Default Issuer” on the Service Bus connection information as shown in the step 5 of “Setting up a service bus namespace”. It is not the issuer name in CRM Online.
Issuer Secret is the “Default Key” on the Service Bus connection information. - If everything is working properly it will display the service address as shown in the screenshot of step 3.
Testing the integration
- The listener application should be up and running.
- Login to CRM and create a new account. If everything is working properly, it will display the data context in the listener application.
- To check the status of the jobs you can go to the “System Jobs” view.
- If the listener application is not available, the status of the job will change to “Waiting for Retry”. It will keep trying to post the message and ultimately change to “failed” if it is not successful after X number of tries. The screenshot below display the details of the job with the status “waiting for retry”.
Want to remark on some general things, The web site style is perfect, the articles is really great : D.Good job, cheers
ReplyDeleteThank you for posting the valuable information.
ReplyDeleteMicrosoft Azure Online Training
ReplyDeleteLiked the blog.
We also provide the servise forIntegrate WhatsApp with Tally
I just want to say that all the information you have given here is awesome...great and nice blog thanks sharing..Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things.
ReplyDeleteWhatsapp Chat Integration
Amazing Article Written
ReplyDeletethanks for sharing dynamic information
Logo Design
Graphic Design
Thrones of Brand
Social Media Design
Hello,
ReplyDeleteGreat Write up...
This is very informative and helpful Article.
Thanks a ton..
For more Information about our company visit: https://www.mirackle.com
It is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot
ReplyDeleteSalesforce Training in Chennai
Salesforce Online Training in Chennai
Salesforce Training in Bangalore
Salesforce Training in Hyderabad
Salesforce training in ameerpet
Salesforce Training in Pune
Salesforce Online Training
Salesforce Training