Skip to main content

Crate drasi_source_dataverse

Crate drasi_source_dataverse 

Source
Expand description

Dataverse Source Plugin for Drasi

This plugin monitors Microsoft Dataverse tables for changes using OData change tracking, which is the Web API equivalent of the platform’s RetrieveEntityChangesRequest. It supports:

  • Polling-based change detection using delta links (equivalent to DataVersion/DataToken)
  • Adaptive backoff matching the platform’s SyncWorker pattern
  • Per-entity workers each tracking their own delta token
  • OAuth2 authentication via Azure AD / Microsoft Entra ID client credentials

§Architecture Alignment with Platform Source

This Rust/Web API implementation mirrors the platform’s C# Dataverse source:

Platform (C#)Drasi-Core (Rust)
RetrieveEntityChangesRequestOData Prefer: odata.track-changes
DataVersion / DataTokenDelta token in @odata.deltaLink
NewOrUpdatedItemRecord without $deletedEntity context
RemovedOrDeletedItemRecord with $deletedEntity in context
SyncWorker (per-entity)Per-entity tokio::spawn task
{entity}-deltatoken state keySame state key format
ServiceClientreqwest HTTP client
Adaptive backoff (500ms → scaled max)Same adaptive backoff pattern

§Configuration

FieldTypeDefaultDescription
environment_urlStringrequiredDataverse environment URL
tenant_idStringrequiredAzure AD tenant ID
client_idStringrequiredAzure AD application ID
client_secretStringrequiredAzure AD client secret
entitiesVec<String>requiredEntity logical names to monitor
entity_set_overridesHashMap<String, String>{}Override entity set name mapping
entity_columnsHashMap<String, Vec…>{}Per-entity column selection
min_interval_msu64500Minimum adaptive interval
max_interval_secondsu6430Per-entity max interval (sqrt-scaled by entity count)
api_versionString"v9.2"Web API version

§Usage

use drasi_source_dataverse::DataverseSource;

let source = DataverseSource::builder("dv-source")
    .with_environment_url("https://myorg.crm.dynamics.com")
    .with_tenant_id("00000000-0000-0000-0000-000000000001")
    .with_client_id("00000000-0000-0000-0000-000000000002")
    .with_client_secret("my-client-secret")
    .with_entities(vec!["account".to_string(), "contact".to_string()])
    .build()?;

Re-exports§

pub use config::DataverseSourceConfig;

Modules§

client
Dataverse HTTP client for the OData Web API.
config
Dataverse Source configuration.
descriptor
Plugin descriptor for the Dataverse source.
types
OData response types for Dataverse change tracking.

Structs§

DataverseSource
Dataverse source plugin for polling-based change detection.
DataverseSourceBuilder
Builder for DataverseSource instances.