This project is read-only.

This project is moved to GitHub

All the latest changes will be in GitHub only.

"Use LINQPad to run LINQ query against Microsoft Dynamics CRM Web API Endpoint"

Version 1.1+ support Web API RTM!!

Project Description

This is LINQPad driver which enables you to connect to your Microsoft Dynamics CRM organization and run LINQ queries against Web API endpoint.
How to use this
Please see the blog for detail. CRM in the Field
This driver supports Dynamics CRM On-Premise, IFD and Online. Each has slightly different usage.
If you are using On-Premise without Claim authentication, you can simply use Windows Authentication. So no additional work is required.
If you are using IFD, then you need to manually register application first.
1. Log in to AD FS server (require Windows Server 2012 R2 AD FS)
2. Open PowerShell.
3, Run the following command to register application. You can change GUID as you need but you need to use "http://localhost/linqpad" as RedirectUri.
> Add-AdfsClient -ClientId 5ee98d47-38d1-4db5-b5c2-9a60f88c0076 -Name "CRM For LINQPad" -RedirectUri http://localhost/linqpad
4. Now you can add connection to LINQPad. Pass the ClientId before Login to CRM, and make use to select IFD for authentication.
5. You will be prompted when driver download metadata, and when you do query in new window.
For Online, the driver will automatically register your application. However, if you do not have admin privilege, you can register the application in different Azure AD and get Client Id. In that case, use following information to register.

- Register as Native Application.
- Give Dynamics CRM Online permission.
- Use "http://localhost/linqpad" as RedirectUri
Online with Consent
If you don't have enough privilege to register application to the Azure AD, you can register application in your own Azure AD and use the client id and redirect url for consent scenario.

The privilege the application needs are:
- Dynamics CRM Online : Access CRM Online as organization users
- Windows Azure Active Directory : Sign in and read user profile

Make sure to mark the application availableToOtherTenants to true.
1. Download application manifest from "Manage Manifest" menu.
2. Open downloaded manifest with any editor.
3. Mark "true" for availableToOtherTenants.
4. Import the manifest back to the application.
Please let us know what's working, what isn't, as well as suggestions for new capabilities by submitting a new issue
In addition to providing feedback on this project site, we'd love to hear directly from you! See what we're up to via our MSDN blog, CRM in the Field or follow us on Twitter: @pfedynamics
Additional Information
This solution uses Context generated from Web API endpoint metadata file displays corresponding OData query.
This driver does followings for you.

1. Let you Login to CRM by using common login window.
2. Register your application to Azure AD on your behalf. If CRM signed-in user does not have enough privilege, you will be prompted to signin as Azure AD Admin.
3. Download metadata file for you.
4. Generate context by using the metadata file and OData Client T4 Template.

Please note that Web API is only supported on CRM Online and it's currently preview.

Last edited Apr 16, 2016 at 1:32 PM by kenakamu, version 11