
Microsoft 365 Query
CertifiedQuery Dataverse entities via OData
Microsoft 365 Query
Query Dataverse entities via OData
Executes an OData GET request against a Dataverse entity set.
Supports $filter, $select, and $top query parameters.
When fetchType is FETCH or STORE, follows @odata.nextLink pagination to retrieve all pages.
When fetchType is FETCH_ONE, returns only the first record from the first page.
Requires the Dataverse application permission Dynamics CRM user on the service principal.
type: io.kestra.plugin.microsoft365.dynamics365.dataverse.QueryExamples
Query active accounts from Dataverse
id: dataverse_query_accounts
namespace: company.team
tasks:
- id: query
type: io.kestra.plugin.microsoft365.dynamics365.dataverse.Query
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
orgUrl: "https://myorg.api.crm.dynamics.com"
entitySetName: "accounts"
filter: "statecode eq 0"
select: "accountid,name,emailaddress1"
top: 50
fetchType: FETCH
Store all contacts to internal storage
id: dataverse_store_contacts
namespace: company.team
tasks:
- id: store
type: io.kestra.plugin.microsoft365.dynamics365.dataverse.Query
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
orgUrl: "https://myorg.api.crm.dynamics.com"
entitySetName: "contacts"
select: "contactid,fullname,emailaddress1"
fetchType: STORE
Properties
clientId *Requiredstring
Client ID
Client ID of the Azure service principal. If you don't have a service principal, refer to create a service principal with Azure CLI.
entitySetName *Requiredstring
Entity set name
OData entity set name, e.g. accounts, contacts, leads.
orgUrl *Requiredstring
Dataverse Organization URL
Base URL of the Dataverse organization, e.g. https://myorg.api.crm.dynamics.com.
All OData API calls are made relative to {orgUrl}/api/data/v9.2/.
tenantId *Requiredstring
Tenant ID
Azure AD (Entra ID) tenant GUID used for authentication.
clientSecret string
Client Secret
Service principal client secret. Use this for Client Secret authentication. Provide clientId, tenantId, and clientSecret. Either clientSecret OR pemCertificate must be provided, not both.
fetchType string
FETCHSTOREFETCHFETCH_ONENONEFetch type
FETCH_ONE — returns only the first record from the first page. FETCH — returns all records (following pagination) as a list in the task output. STORE — writes all records (following pagination) to Kestra internal storage as an Ion file.
filter string
OData $filter expression
Optional OData filter, e.g. statecode eq 0.
pemCertificate string
PEM Certificate
Alternative authentication method using certificate-based authentication. Use this for Client Certificate authentication. Provide clientId, tenantId, and pemCertificate. Either clientSecret OR pemCertificate must be provided, not both.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
select string
OData $select fields
Comma-separated list of fields to return, e.g. accountid,name.
top integerstring
100Maximum records per page ($top)
Maximum number of records to return per OData page.
When fetchType is STORE or FETCH, all pages are followed regardless of this value.
When fetchType is FETCH_ONE, this is ignored and only the first record is returned.
Defaults to 100.
Outputs
records array
Records
List of entity records returned; populated when fetchType is FETCH or FETCH_ONE.
size integer
Total number of records
Count of records returned (or stored) by the query.
uri string
uriURI of stored records file
URI of the Ion file containing all records; populated when fetchType is STORE.
Metrics
count counter
recordsTotal number of records returned by the query