Microsoft Power Platform Dataverse ServiceClient

repository·master·Indexed 43 days ago

https://github.com/microsoft/powerplatform-dataverseserviceclient

A modern revision of the legacy CrmServiceClient providing connectivity to Dataverse across .NET Full Framework (4.6.2, 4.7.2, 4.8) and .NET Core (3.0, 3.1, 5.0, 6.0). Optimized for Asp.net Core, Azure Functions, and Linux-based environments, it supports multiple authentication patterns including Client Secret, Client Cert, and UID/PW. Provided via the Microsoft.PowerPlatform.Dataverse.Client and Microsoft.PowerPlatform.Dataverse.Client.Dynamics NuGet packages.

Tokens
1.1K
Snippets
1
Records
6
Agent score
6%

What's inside Dataverse ServiceClient

  1. Use the renamed Microsoft.PowerPlatform.Dataverse.Client

    master

    The project has been renamed from Microsoft.PowerPlatform.DataverseServiceClient to Microsoft.PowerPlatform.Dataverse.Client. When consuming this library, ensure you are using the updated NuGet package names and namespaces.

    Core NuGet packages:

    • Microsoft.PowerPlatform.Dataverse.Client
    • Microsoft.PowerPlatform.Dataverse.Client.Dynamics

    Note: Microsoft.Dynamics.Sdk.Messages is deprecated.

  2. Supported authentication types for Dataverse ServiceClient

    master

    The ServiceClient supports various authentication patterns depending on your target runtime. This library is a revision and update of Microsoft.Xrm.Tooling.Connector.CrmServiceClient.

    .NET Full Framework (4.6.2, 4.7.2, 4.8)

    Supports all CrmServiceClient authentication types:

    • Client\Secret
    • Client\Cert
    • UID\PW Noninteractive
    • UID\PW interactive

    .NET Core (3.0, 3.1, 5.0, 6.0)

    Supports the following authentication types:

    • Client\Secret
    • Client\Cert
    • UID\PW interactive
  3. Important limitations and compatibility notes

    master

    When using the Dataverse ServiceClient, be aware of the following constraints:

    • Plugin Development: Plugin development using this Client is NOT supported at this time.
    • Build Environment: The project currently requires VS 2022 and .NET 6 to build from source (due to internal NuGet dependencies).
    • Runtime Support: Supports .NET Full Framework (4.6.2, 4.7.2, 4.8) and .NET Core (3.0, 3.1, 5.0, 6.0).
    • Target Scenarios: The library is optimized for use in Asp.net Core, Azure Functions, and Linux-based environments.
  4. Use Get-PowerPlatformConnection to establish a CRM connection

    master

    The Get-PowerPlatformConnection PowerShell cmdlet is used to establish a connection to Dataverse (CRM). It supports two distinct parameter sets for authentication: using a connection string or using Federated Identity Credentials (FIC) parameters.

    Parameter Sets

    1. ConnectionStringOnly

    Use this set if you have a complete connection string. When this parameter is provided, all other connection elements are ignored.

    • ConnectionString (Mandatory, Position 1)

    2. FIC (Federated Identity Credentials)

    Use this set to provide individual identity components. All parameters in this set are mandatory.

    • TenantId (Mandatory, Position 1): The Tenant Id of the FIC.
    • ClientId (Mandatory, Position 2): The Client Id of the FIC.
    • ServiceConnectionId (Mandatory, Position 3): The Service Connection Id of the FIC.
    • OrganizationUrl (Mandatory, Position 4): The URL of the Dataverse organization.
    • AccessTokenEnvKeyName (Optional, Position 4): The name of the environment variable containing the Access Token.
    # Example using a Connection String
    Get-PowerPlatformConnection -ConnectionString "Auth=OAuth;Url=https://org.crm.dynamics.com;Token=..."
    
    # Example using FIC parameters
    Get-PowerPlatformConnection \
        -TenantId "00000000-0000-0000-0000-000000000000" \
        -ClientId "11111111-1111-1111-1111-111111111111" \
        -ServiceConnectionId "22222222-2222-2222-2222-222222222222" \
        -OrganizationUrl "https://org.crm.dynamics.com"