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) |
|---|---|
RetrieveEntityChangesRequest | OData Prefer: odata.track-changes |
DataVersion / DataToken | Delta token in @odata.deltaLink |
NewOrUpdatedItem | Record without $deletedEntity context |
RemovedOrDeletedItem | Record with $deletedEntity in context |
SyncWorker (per-entity) | Per-entity tokio::spawn task |
{entity}-deltatoken state key | Same state key format |
ServiceClient | reqwest HTTP client |
| Adaptive backoff (500ms → scaled max) | Same adaptive backoff pattern |
§Configuration
| Field | Type | Default | Description |
|---|---|---|---|
environment_url | String | required | Dataverse environment URL |
tenant_id | String | required | Azure AD tenant ID |
client_id | String | required | Azure AD application ID |
client_secret | String | required | Azure AD client secret |
entities | Vec<String> | required | Entity logical names to monitor |
entity_set_overrides | HashMap<String, String> | {} | Override entity set name mapping |
entity_columns | HashMap<String, Vec…> | {} | Per-entity column selection |
min_interval_ms | u64 | 500 | Minimum adaptive interval |
max_interval_seconds | u64 | 30 | Per-entity max interval (sqrt-scaled by entity count) |
api_version | String | "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§
- Dataverse
Source - Dataverse source plugin for polling-based change detection.
- Dataverse
Source Builder - Builder for
DataverseSourceinstances.