Background

I’m preparing a talk for the upcoming Office 365 Saturday
event, hosted by the Danish SharePoint User Group
where I will be showcasing the interaction between MS CRM and SP online. As
Microsoft Partners we have the possibility to create Demos for these kind of
events where we get both CRM and SP instances but there is no Azure AD. The
usually next step would be to create a new subscription and use a personal
credit card (not billed but still needs to be added). The credit card thing is
always a big issue for me as if I forget to change the password for some of the
admin users I might get billed a shit load of money for somebody Bitcoin
crunching on my behalf.

I made a few Google searches and I came across kb3133137, see References for
more info, where I discovered a magick GUID (ClientID) that can be used for
all kind of custom applications in order to access MS CRM OData interface. I made
a simple prototype in C# and here are the results:

Note: You will need to generate the OData client with the OData v4 Client
Code Generator, see References for more info, and you will only need to
add one NuGet package: Microsoft.IdentityModel.Clients.ActiveDirectory to your
project

Pretty nifty right? As I have blogged about using the F# OData TypeProvider
with MS CRM in the past, I was never able to get data out from the online
instance though, I decided to update my initial script and now it works
perfectly with the magick GUID :)

F# Script

You will need to retrieve Microsoft.IdentityModel.Clients.ActiveDirectory from
NuGet:

Conclusion

It’s actually really usefull that we are now able to create non-human
interactive applications that can also gain the power of the OData interface
instead of using the heavy and tradicional WSDL/SOAP interface. See this
stackoverflow answer: Simple explanation about SOAP and REST
using Martin Lawrence/Big Mama as data to point out the benefits: