Wednesday, 9 July 2014

Run Social Care Application CRM 2013 Tutorial – Part 1 (Setup)

Microsoft has launched the Microsoft Dynamics CRM Sample Social Care Application together with some new entities that they are purposely created for the Social Live and Connection, during the launching of the Microsoft Dynamics CRM Springwave ‘14 Updates. As we know that the entities, such as Social Profile entity is only accessible by using CRM API, it is different from the standard entity.

To download the sample Application, you can go to this link:

Well, actually to run this new Sample Application is not easy, I tried several times to get it works and I found this is not easy, even in the my former company, for the demo, I was developing from scratch to my former manager to demo to ensure the prospects that CRM is a social-able apps that can connect to any social media, that is I thought it was easier, but, well, I want to try this tool since it is free and of course a nice tool..

Okay, get back to the topic, these are step by step to run the Social Care Application.

Let’s get started.

1. For the starting step, you should and you should really read the ‘Readme’ document under the Social Care folder upon you download the App.


2. Please notice the Prerequisites section first.

Just remember this is not stated in the Prerequisite, that this is only for Microsoft Dynamics CRM with Springwave update, either CRM Online or CRM OnPremise with SP1 installed.

3. You should have Visual Studio 2012/2013 installed to run this Apps.

4. Then, you should connect to the SQL Server Database

5. Just follow the instructions first.

6. You will open the Visual Studio Solution


7. Read again the Prerequisites, to build the Project, you should have all of the required assembly references, including TweetSharp, Hammock, and Microsoft.WindowsAzure.ActiveDirectory.Authentication

Social Care3

So, you should install the Nuget Package

Nuget Package

Social Care4

Go to Tool –> Package –> Manager Console, and type the following commands:

· PM> Install-Package TweetSharp
· PM> Install-Package Hammock
· PM> Install-Package Microsoft.WindowsAzure.ActiveDirectory.Authentication

Register your CRM app in Windows Azure for CRM Online!

8. If you are using the CRM Online version, you should use the OAuth authentication, and again, take a note to this line:

· If you’re using OAuth authentication, perform the necessary configuration steps as per Register a CRM app with Active Directory

Yes, you should register a CRM app with AD through Windows Azure. You can register with free of charge for trial.

*Additional info:
In order to register your app, you might be requested to input the redirectURI.
You can refer to this link:

You should debug your app to get this redirectURI:

            string redirectUrl = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString();

Previously, we could register using:

But, now the method has been changed according to this link:

Otherwise, if you are using CRM OnPremise version, so you do not need this. So just watch out about this prerequisite, you might be able to run the Social Care Apps and get the social feeds that you want to, but, you cannot pass the information to CRM.

All about Twitter Development

9. Well, to help you more understand about the next prerequisite:


“Twitter application registration. You must register an application in Twitter so that OAuth against Twitter can be used from the sample app.”

I write the detailed steps,
- You should go to Twitter Dev and App Registration (you should have the Twitter ID, of course!)

or the shortcut:

- Then, if you have no existing App, then you can create a New App, otherwise you can use your existing one.


- Get your Keys and make sure your Access Level:




- Copy paste to Notepad first, you will be really need them.

CRM Queue Setup

10. Just follow this instruction: 

“On your Microsoft Dynamics CRM server, create a queue with “social to case settings” configured and activate the queue.”

- Go to Microsoft Dynamics CRM server
- Go to Settings –> Service Management –> Queue
- Create a New Queue with Social to Case Settings


- Set the Social to Case Settings



- And do not forget to Activate the Rule.


Database Setup

11. Just follow these instructions:

1. In Visual Studio, navigate to View > Server Explorer.
2. Right-click Data Connections, click Add Connection, select Microsoft SQL Server (SqlClient) as the data source, and then click Continue.
3. Specify the server name, enter Twitter as the database name, and then click OK.
4. To create the necessary tables, run the Models\Twitter.edmx.sql file provided with the sample from SQL Management Studio. This will update your Twitter database.
5. Update the following connection strings in Web.config accordingly.
<add name="TwitterEntities1" connectionString="…" providerName="System.Data.EntityClient" />

Twitter Connection Setup

12. Just follow the instructions, by editing the Web.config:

1. The sample application needs the consumer and secret keys to communicate with Twitter. You can obtain the keys by registering your app on Twitter. More information: Twitter Apps
2. Once you have the keys, update the Web.config file with the keys under the application settings section. The settings are “ConsumerKey” and “ConsumerSecret”.

You did the Twitter registration in Step 9.

Microsoft Dynamics CRM Setup

13. Just follow the instructions, just edit the Web.config, set the value based on your environment.

1. Open the Web.config file and change the app settings as indicated here.
· Fill in the value for the “CrmServerUrl” setting to point to your server (don’t add the trailing slash mark ‘/’).
· Set the value for “DeploymentType” to Online, IFD or OnPremise as per your Microsoft Dynamics CRM installation.
· For an IFD:
o Specify a value for “OAuthUrl”
o Specify a value for “ClientID”
· For an Online deployment:
o Specify a value for “ClientID”
· For an on-premises deployment:
o Specify a value for “UserName”
o Specify a value for “Password”
o Specify a value for “Domain”
2. (Optional) Configure the watch list feature. The watch list button in the app UI searches for recent messages from Twitter for the specified search term. The “WatchlistKeyword” setting controls the search term.

Build the Sample

14. Build the Solution as usual, if you have any error during the building run, then you should check the assemblies and Web.config.

15. Then, you can Run the Sample.

16. You also can customize the Code based on what do you want.

17. I will be back by writing the next part post about Running the Sample Social Case Application in Microsoft Dynamics CRM 2013

Well, a lot of setting and configuration steps to make it works. Nice tool but it was not easy job to get it worked.

Continue to Part 2?
Click here --> Redirect me to Part 2

Hope it helps!
Thank you.


  1. So with This post it confirms that,to,demonstrate the social capabilities, Just produce a simpler application by Learning the sdk.

    too complex for me. Bad design

  2. Hm..Yes. this is too complex since if you use CRM Online, you also have to register to Azure as well.
    Too many setup you have to do.

  3. Any chance you can expand on Step 8? I cannot get the authentication to CRM working. I assume I have not setup my web app correctly in Azure. Could you explain the relationship between any of the azure settings and the web.config in more detail?

  4. How did you get a redirect URI? I am stuck on that piece at the moment. I suspect I am getting the same errors as the previous person.

    1. same problem here. MSDN article doesn't help as well. Further clarification would be highly appreciated.

    2. Hi, for the redirect URL after sign in the twitter, if you got the error.
      It does not related to CRM, you should add the configuration, see this link:

      I hope this helps you.
      That case also made me stuck at the very first time I was frustated as well. But, I realize that the error is because of cannot sign in to Twitter.

      Yes, it does not stated in the MSDN Article difficult to setup it.
      You should register to Azure to make it worked for CRM Online.

      Thank you.

    3. Dear Aileen,

      I'm also struggling with the setup process.
      I followed the instructions in your guide until step 8.
      Then I tried to do exactly as described in the link you provided:

      As we use CRM online, I tried to register the application with MS Azure:
      I opened the tenant that runs CRM in the Active Directory Menu and added a new application my organization is develeping, named it SCSA and selected Web-App.
      Then the walkthrough says you should "continue providing the requested information and complete the app registration process".

      The problem is: I don't know where to find this requested information. Azure prompts me to enter a Login-URL and APP-ID-URI. Unfortunately neither the official walkthrough nor your guide says where I'm supposed to find these information.

      Could you please explain a bit more detailed what information has to be entered there?

      The following steps in your guide should not be a problem (setting up the queue in CRM/SQL database or twitter app secrets/keys).

      Thank you very much for your help, it's really appreciated!

    4. Hi,

      For the redirect URL.
      Can you check this link:

      And let me know if it works or not.
      You need to debug your application first.

    5. This comment has been removed by the author.

    6. I am unable to debug to get the URI because I cannot add the required namespace. To add that namespace, I would need to create a Windows Store App. Am I doing something wrong?

  5. This post helped me, I cannot find the same tutorial I need anywhere, thank you your sharing.

  6. Very complete story, very useful. The best tutorial ever. I though it was so difficult before I read this, now I can run the app. Thank you.

  7. There is certainly a great deal to know about this
    topic. I really like all of the points you've made.

    Stop by my blog post garage door opener remote replacement

  8. Very energetic article, I loved that bit. Will there be
    a part 2?

    Also visit my weblog - raynor garage door opener remotes

  9. Aw, this was a really nice post. Spending some time and
    actual effort to make a really good article… but what can I
    say… I put things off a lot and don't seem to get anything done.

    Also visit my web-site ... Saleh Stevens

  10. When someone writes an post he/she keeps the thought of a
    user in his/her mind that how a user can know it.
    So that's why this piece of writing is perfect. Thanks!

    My blog; local garage door repair Oakland

  11. Appreciate this post. Will try it out.

    Feel free to visit my weblog ... garage door repair

  12. Aileen, i'm using on-premises so i can't perform this step.
    "Go to Settings –> Service Management –> Queue"
    as it is not released on-premises yet.
    so can you please guide me for an alternative ?

  13. Very complete story, very useful. The best tutorial ever. A customer relationship management application makes it possible to assemble the customer data and various business reports.

  14. Wow! Great post! The content is very rich, and I really like it. It help me very much to solve some problems. It is very helpful for all the people on the web. Thanks a lot. Ecommerce Product Photography || Ecommerce Product Photoshoot || Products Catalogue

  15. Wow! Great post! The content is very rich, and I really like it. It help me very much to solve some problems. It is very helpful for all the people on the web. Thanks a lot. Ecommerce Product Photography || Ecommerce Product Photoshoot || Products Catalogue

  16. Love it! Thank you so much for sharing this one really well defined all peaceful info,well really like it,Keep it up Love it- CRM Application Development

  17. Very good article ( as always ) I'm really glad that You are sharing your knowledge about CRM, It is such a great job and Thank You for your work and dedication.
    Microsoft Dynamics CRM Online Training

  18. hi, nice information is given in this blog. Thanks for sharing this type of information, it is so useful for me. nice work keep it up

    OPAL CRM Software Company

  19. We are one of the best IT company that offers offshore custom CRM Software Development Services to clients across India, USA, UK, and HongKong.

  20. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.
    CRM Software in India
    CRM Software in Chennai

  21. Really a great post. Appreciate the effort in educating us. CRM Software Development Company

  22. Nice post,

    We provide industrial IoT platform to enterprises for building custom IoT applications. We develop, deploy and maintain industrial IoT platform that allows you to build custom industrial IoT applications for your organization. Our IoT platform is available only for manufacturing companies and government companies engaged in building smart cities.

  23. This comment has been removed by the author.


My Name is..