powerplatform-dataverse-client 0.9.0

Unofficial Rust sdk for the Microsoft Dataverse (Power Platform) Web API.
Documentation

powerplatform-dataverse-client

Unofficial Rust SDK for the Microsoft Dataverse (Power Platform) Web API.

The short-term goal is to provide Rust developers a simple yet robust SDK to building integrations with Dataverse.

The long-term goal is full feature parity with the Microsoft.PowerPlatform.Dataverse.Client.

powerplatform-dataverse-client is currently used as the Dataverse backend for Queryverse.

Features

Feature Supported
Client-credentials auth
Device code auth
Automatic token refresh
Token cache
FetchXML retrieval
FetchXML paging
FetchXML paging progress callback
FetchXML count helper
Entity definitions metadata
Entity attributes metadata
Entity relationships metadata
Create entity
Update entity by ID
Delete entity by ID
Batch operations (ExecuteMultiple-style)
Dataverse request-parameter headers
Retrieve entity by ID
Username / Password auth
Retry/backoff
Full feature parity with the XRM SDK

Quick Start

use powerplatform_dataverse_client::LogLevel;
use powerplatform_dataverse_client::dataverse::serviceclient::ServiceClient;

#[tokio::main]
async fn main() -> Result<(), String> {
    let client = ServiceClient::new(
        "AuthType=ClientSecret;Url=https://YOUR_ORG.crm.dynamics.com;ClientId=CLIENT_ID;ClientSecret=CLIENT_SECRET;TenantId=TENANT_ID;TokenCacheStorePath=C:\\MyTokenCache\\token-cache.txt",
        LogLevel::Information,
    )
    .await?;

    let fetchxml = r#"
        <fetch top="5">
          <entity name="account">
            <attribute name="accountid" />
            <attribute name="name" />
          </entity>
        </fetch>
    "#;

    let entities = client
        .retrieve_multiple_fetchxml_paging("accounts", fetchxml)
        .await?;

    println!("Records: {}", entities.len());
    Ok(())
}

Samples

cd samples/<sample-name>
cp secrets.example.json secrets.json
cargo run

hello-dataverse is the smallest sample.

v1-features contains one scenario per feature:

Documentation Index

Dataverse Service Client

ServiceClient is the main Dataverse Web API entry point for FetchXML, metadata, CRUD, and batch operations.

See doc/service-client.md.

Entity and Value Types

The crate exposes typed Dataverse row/value shapes such as Entity, EntityReference, Money, and Value.

See doc/entity-types.md.

Metadata Types

The crate exposes EntityDefinition, EntityAttribute, AttributeTypeName, and EntityRelationship for schema-driven workflows.

See doc/metadata-types.md and doc/metadata.md.

Logging

LogLevel controls the crate's own request/debug verbosity.

See doc/logging.md.

Authentication

Authentication centers on AuthConfig, device-code progress events, token refresh, and token cache handling.

See:

Request Parameters

RequestParameters maps supported Dataverse optional request headers onto create, update, and delete operations.

See doc/request-parameters.md.

Batch Operations

Batch operations use ExecuteMultipleRequest, ExecuteMultipleResponse, and the typed create/update/delete request wrappers.

See doc/batch.md.

Contributing

Issues and pull requests are welcome. Please include a brief description of the change and, when possible, add or update tests.

AI Disclosure

Portions of this project were developed with the assistance of AI tools; all changes are reviewed and tested by maintainers.

License

See LICENSE.