The Evolution of CRM/Power Platform SDK
2023-09-29
All articles from this blog can ONLY be redistributed on an Attribution-NonCommercial-NoDerivs basis. Please credit the source, thank you.
Twitter:@kelvinshen
Blog:Kelvin Shen's Blog
Modernizing Dataverse Connections with Microsoft.PowerPlatform.Dataverse.Client
The way we interact with Dataverse (formerly known as Common Data Service and Dynamics CRM) has evolved over time. Here’s a look at the journey and how the Microsoft.PowerPlatform.Dataverse.Client
library streamlines development:
- The Past: We started with the
Microsoft.CrmSdk.Tooling.CoreAssemblies
Nuget package and then progressed to using the Dataverse Web API withHttpClient
. - The Present: The
Microsoft.PowerPlatform.Dataverse.Client
Nuget package significantly simplifies Dataverse interactions, replacing older approaches.
Getting Started
The ServiceClient
class is your gateway to Dataverse operations:
using Microsoft.PowerPlatform.Dataverse.Client; // Install the NuGet package
var _connectionString = $"AuthType=ClientSecret;Url={orgUrl};ClientId={clientId};ClientSecret={clientSecret};";
using var serviceClient = new ServiceClient(_connectionString);
Key Points:
- Authentication: The library supports both ‘ClientSecret’ and ‘OAuth’ authentication. See official docs for other options.
- Connection String: Replace placeholders (between the curly brackets in the code example above) with your Dataverse environment’s URL, client ID, and secret.