Copy data from Dynamics AX by using Azure Data Factory (Preview)

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

Supported capabilities

You can copy data from Dynamics AX to any supported sink data store. For a list of data stores that Copy Activity supports as sources and sinks, see Supported data stores and formats.

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

You can use one of the following tools or SDKs to use the copy activity with a pipeline. Select a link for step-by-step instructions:

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 entity in Azure Active Directory (Azure AD) by following Register your application with an Azure AD tenant. Make note of the following 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 in Data Factory, 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>"
        },
        "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

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>"
            }
        }
    }
]

Next steps

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