Copy data from Dynamics AX using Azure Data Factory or Synapse Analytics

APPLIES TO: Azure Data Factory Azure Synapse Analytics

Tip

Try out Data Factory in Microsoft Fabric, an all-in-one analytics solution for enterprises. Microsoft Fabric covers everything from data movement to data science, real-time analytics, business intelligence, and reporting. Learn how to start a new trial for free!

This article outlines how to use Copy Activity in Azure Data Factory and Synapse Analytics pipelines to copy data from Dynamics AX source. The article builds on Copy Activity, which presents a general overview of Copy Activity.

Supported capabilities

This Dynamics AX connector is supported for the following capabilities:

Supported capabilities IR
Copy activity (source/-) ① ②
Lookup activity ① ②

① Azure integration runtime ② Self-hosted integration runtime

For a list of data stores that supports as sources and sinks, see Supported data stores.

Specifically, this Dynamics AX connector supports copying data from Dynamics AX using OData protocol with Service Principal authentication.

Tip

You can also use this connector to copy data from Dynamics 365 Finance and Operations. Refer to Dynamics 365's OData support and Authentication method.

Get started

To perform the Copy activity with a pipeline, you can use one of the following tools or SDKs:

Create a linked service to Dynamics AX using UI

Use the following steps to create a linked service to Dynamics AX in the Azure portal UI.

  1. Browse to the Manage tab in your Azure Data Factory or Synapse workspace and select Linked Services, then click New:

  2. Search for Dynamics and select the Dynamics AX connector.

    Select the Dynamics AX connector.

  3. Configure the service details, test the connection, and create the new linked service.

    Configure a linked service to Dynamics AX.

Connector configuration details

The following sections provide details about properties you can use to define Data Factory entities that are specific to Dynamics AX connector.

Prerequisites

To use service principal authentication, follow these steps:

  1. Register an application with the Microsoft Identity platform. To learn how, see Quickstart: Register an application with the Microsoft identity platform. Make note of these values, which you use to define the linked service:

    • Application ID
    • Application key
    • Tenant ID
  2. Go to Dynamics AX, and grant this service principal proper permission to access your Dynamics AX.

Linked service properties

The following properties are supported for Dynamics AX linked service:

Property Description Required
type The type property must be set to DynamicsAX. Yes
url The Dynamics AX (or Dynamics 365 Finance and Operations) instance OData endpoint. Yes
servicePrincipalId Specify the application's client ID. Yes
servicePrincipalKey Specify the application's key. Mark this field as a SecureString to store it securely, or reference a secret stored in Azure Key Vault. Yes
tenant Specify the tenant information (domain name or tenant ID) under which your application resides. Retrieve it by hovering the mouse in the top-right corner of the Azure portal. Yes
aadResourceId Specify the AAD resource you are requesting for authorization. For example, if your Dynamics URL is https://sampledynamics.sandbox.operations.dynamics.com/data/, the corresponding AAD resource is usually https://sampledynamics.sandbox.operations.dynamics.com. Yes
connectVia The Integration Runtime to use to connect to the data store. You can choose Azure Integration Runtime or a self-hosted Integration Runtime (if your data store is located in a private network). If not specified, the default Azure Integration Runtime is used. No

Example

{
    "name": "DynamicsAXLinkedService",
    "properties": {
        "type": "DynamicsAX",
        "typeProperties": {
            "url": "<Dynamics AX instance OData endpoint>",
            "servicePrincipalId": "<service principal id>",
            "servicePrincipalKey": {
                "type": "SecureString",
                "value": "<service principal key>"
            },
            "tenant": "<tenant info, e.g. microsoft.onmicrosoft.com>",
            "aadResourceId": "<AAD resource, e.g. https://sampledynamics.sandbox.operations.dynamics.com>"
        }
    },
    "connectVia": {
        "referenceName": "<name of Integration Runtime>",
        "type": "IntegrationRuntimeReference"
    }
}

Dataset properties

This section provides a list of properties that the Dynamics AX dataset supports.

For a full list of sections and properties that are available for defining datasets, see Datasets and linked services.

To copy data from Dynamics AX, set the type property of the dataset to DynamicsAXResource. The following properties are supported:

Property Description Required
type The type property of the dataset must be set to DynamicsAXResource. Yes
path The path to the Dynamics AX OData entity. Yes

Example

{
    "name": "DynamicsAXResourceDataset",
    "properties": {
        "type": "DynamicsAXResource",
        "typeProperties": {
            "path": "<entity path e.g. dd04tentitySet>"
        },
        "schema": [],
        "linkedServiceName": {
            "referenceName": "<Dynamics AX linked service name>",
            "type": "LinkedServiceReference"
        }
    }
}

Copy Activity properties

This section provides a list of properties that the Dynamics AX source supports.

For a full list of sections and properties that are available for defining activities, see Pipelines.

Dynamics AX as source

To copy data from Dynamics AX, set the source type in Copy Activity to DynamicsAXSource. The following properties are supported in the Copy Activity source section:

Property Description Required
type The type property of the Copy Activity source must be set to DynamicsAXSource. Yes
query OData query options for filtering data. Example: "?$select=Name,Description&$top=5".

Note: The connector copies data from the combined URL: [URL specified in linked service]/[path specified in dataset][query specified in copy activity source]. For more information, see OData URL components.
No
httpRequestTimeout The timeout (the TimeSpan value) for the HTTP request to get a response. This value is the timeout to get a response, not the timeout to read response data. If not specified, the default value is 00:05:00 (5 minutes). No

Example

"activities":[
    {
        "name": "CopyFromDynamicsAX",
        "type": "Copy",
        "inputs": [
            {
                "referenceName": "<Dynamics AX input dataset name>",
                "type": "DatasetReference"
            }
        ],
        "outputs": [
            {
                "referenceName": "<output dataset name>",
                "type": "DatasetReference"
            }
        ],
        "typeProperties": {
            "source": {
                "type": "DynamicsAXSource",
                "query": "$top=10"
            },
            "sink": {
                "type": "<sink type>"
            }
        }
    }
]

Lookup activity properties

To learn details about the properties, check Lookup activity.

For a list of data stores that Copy Activity supports as sources and sinks, see Supported data stores and formats.