Events
31 Mar, 23 - 2 Apr, 23
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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!
Azure Data Factory and Synapse Analytics pipelines integrate with Microsoft Graph data connect, allowing you to bring the rich organizational data in your Microsoft 365 (Office 365) tenant into Azure in a scalable way and build analytics applications and extract insights based on these valuable data assets. Integration with Privileged Access Management provides secured access control for the valuable curated data in Microsoft 365 (Office 365). Refer to this link for an overview of Microsoft Graph data connect.
This article outlines how to use the Copy Activity to copy data and Data Flow to transform data from Microsoft 365 (Office 365). For an introduction to copy data, read the copy activity overview. For an introduction to transforming data, read mapping data flow overview.
Note
Microsoft 365 Data Flow connector is currently in preview. To participate, use this sign-up form: Microsoft 365 + Analytics Preview.
This Microsoft 365 (Office 365) connector is supported for the following capabilities:
Supported capabilities | IR |
---|---|
Copy activity (source/-) | ① |
Mapping data flow (source/-) | ① |
① Azure integration runtime ② Self-hosted integration runtime
ADF Microsoft 365 (Office 365) connector and Microsoft Graph Data Connect enables at scale ingestion of different types of datasets from Exchange Email enabled mailboxes, including address book contacts, calendar events, email messages, user information, mailbox settings, and so on. Refer here to see the complete list of datasets available.
For now, within a single copy activity and data flow, you can only ingest data from Microsoft 365 (Office 365) into Azure Blob Storage, Azure Data Lake Storage Gen1, and Azure Data Lake Storage Gen2 in JSON format (type setOfObjects). When you copy to Azure Blob Storage, the output is a blob containing JSON text. If you want to load Microsoft 365 (Office 365) into other types of data stores or in other formats, you can chain the first copy activity or data flow with a subsequent activity to further load data into any of the supported ADF destination stores (refer to "supported as a sink" column in the "Supported data stores and formats" table).
Important
Note
Please use Azure integration runtime in both source and sink linked services. The self-hosted integration runtime and the managed virtual network integration runtime aren't supported.
To copy and transform data from Microsoft 365 (Office 365) into Azure, you need to complete the following prerequisite steps:
If this is the first time you're requesting data for this context (a combination of which data table is being access, which destination account is the data being loaded into, and which user identity is making the data access request), you'll see the copy activity status as "In Progress", and only when you click into "Details" link under Actions will you see the status as "RequestingConsent". A member of the data access approver group needs to approve the request in the Privileged Access Management before the data extraction can proceed.
Refer here on how the approver can approve the data access request.
Tip
For a walkthrough of using Microsoft 365 (Office 365) connector, see Load data from Microsoft 365 (Office 365) article.
You can create a pipeline with the copy activity and data flow by using one of the following tools or SDKs. Select a link to go to a tutorial with step-by-step instructions to create a pipeline with a copy activity.
Use the following steps to create a linked service to Microsoft 365 (Office 365) in the Azure portal UI.
Browse to the Manage tab in your Azure Data Factory or Synapse workspace and select Linked Services, then click New:
Search for Microsoft 365 (Office 365) and select the Microsoft 365 (Office 365) connector.
Configure the service details, test the connection, and create the new linked service.
The following sections provide details about properties that are used to define Data Factory entities specific to Microsoft 365 (Office 365) connector.
The following properties are supported for Microsoft 365 (Office 365) linked service:
Property | Description | Required |
---|---|---|
type | The type property must be set to: Office365 | Yes |
office365TenantId | Azure tenant ID to which the Microsoft 365 (Office 365) account belongs. | Yes |
servicePrincipalTenantId | Specify the tenant information under which your Microsoft Entra web application resides. | 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. | Yes |
connectVia | The Integration Runtime to be used to connect to the data store. If not specified, it uses the default Azure Integration Runtime. | No |
Note
The difference between office365TenantId and servicePrincipalTenantId and the corresponding value to provide:
Example:
{
"name": "Office365LinkedService",
"properties": {
"type": "Office365",
"typeProperties": {
"office365TenantId": "<Microsoft 365 (Office 365) tenant id>",
"servicePrincipalTenantId": "<AAD app service principal tenant id>",
"servicePrincipalId": "<AAD app service principal id>",
"servicePrincipalKey": {
"type": "SecureString",
"value": "<AAD app service principal key>"
}
}
}
}
For a full list of sections and properties available for defining datasets, see the datasets article. This section provides a list of properties supported by Microsoft 365 (Office 365) dataset.
To copy data from Microsoft 365 (Office 365), the following properties are supported:
Property | Description | Required |
---|---|---|
type | The type property of the dataset must be set to: Office365Table | Yes |
tableName | Name of the dataset to extract from Microsoft 365 (Office 365). Refer here for the list of Microsoft 365 (Office 365) datasets available for extraction. | Yes |
If you were setting dateFilterColumn
, startTime
, endTime
, and userScopeFilterUri
in dataset, it's still supported as-is, while you're suggested to use the new model in activity source going forward.
Example
{
"name": "DS_May2019_O365_Message",
"properties": {
"type": "Office365Table",
"linkedServiceName": {
"referenceName": "<Microsoft 365 (Office 365) linked service name>",
"type": "LinkedServiceReference"
},
"schema": [],
"typeProperties": {
"tableName": "BasicDataSet_v0.Event_v1"
}
}
}
For a full list of sections and properties available for defining activities, see the Pipelines article. This section provides a list of properties supported by Microsoft 365 (Office 365) source.
To copy data from Microsoft 365 (Office 365), 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: Office365Source | Yes |
allowedGroups | Group selection predicate. Use this property to select up to 10 user groups for whom the data will be retrieved. If no groups are specified, then data will be returned for the entire organization. | No |
userScopeFilterUri | When allowedGroups property isn't specified, you can use a predicate expression that is applied on the entire tenant to filter the specific rows to extract from Microsoft 365 (Office 365). The predicate format should match the query format of Microsoft Graph APIs, e.g. https://graph.microsoft.com/v1.0/users?$filter=Department eq 'Finance' . |
No |
dateFilterColumn | Name of the DateTime filter column. Use this property to limit the time range for which Microsoft 365 (Office 365) data is extracted. | Yes if dataset has one or more DateTime columns. Refer here for list of datasets that require this DateTime filter. |
startTime | Start DateTime value to filter on. | Yes if dateFilterColumn is specified |
endTime | End DateTime value to filter on. | Yes if dateFilterColumn is specified |
outputColumns | Array of the columns to copy to sink. | No |
Example:
"activities": [
{
"name": "CopyFromO365ToBlob",
"type": "Copy",
"inputs": [
{
"referenceName": "<Microsoft 365 (Office 365) input dataset name>",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "<output dataset name>",
"type": "DatasetReference"
}
],
"typeProperties": {
"source": {
"type": "Office365Source",
"dateFilterColumn": "CreatedDateTime",
"startTime": "2019-04-28T16:00:00.000Z",
"endTime": "2019-05-05T16:00:00.000Z",
"userScopeFilterUri": "https://graph.microsoft.com/v1.0/users?$filter=Department eq 'Finance'",
"outputColumns": [
{
"name": "Id"
},
{
"name": "CreatedDateTime"
},
{
"name": "LastModifiedDateTime"
},
{
"name": "ChangeKey"
},
{
"name": "Categories"
},
{
"name": "OriginalStartTimeZone"
},
{
"name": "OriginalEndTimeZone"
},
{
"name": "ResponseStatus"
},
{
"name": "iCalUId"
},
{
"name": "ReminderMinutesBeforeStart"
},
{
"name": "IsReminderOn"
},
{
"name": "HasAttachments"
},
{
"name": "Subject"
},
{
"name": "Body"
},
{
"name": "Importance"
},
{
"name": "Sensitivity"
},
{
"name": "Start"
},
{
"name": "End"
},
{
"name": "Location"
},
{
"name": "IsAllDay"
},
{
"name": "IsCancelled"
},
{
"name": "IsOrganizer"
},
{
"name": "Recurrence"
},
{
"name": "ResponseRequested"
},
{
"name": "ShowAs"
},
{
"name": "Type"
},
{
"name": "Attendees"
},
{
"name": "Organizer"
},
{
"name": "WebLink"
},
{
"name": "Attachments"
},
{
"name": "BodyPreview"
},
{
"name": "Locations"
},
{
"name": "OnlineMeetingUrl"
},
{
"name": "OriginalStart"
},
{
"name": "SeriesMasterId"
}
]
},
"sink": {
"type": "BlobSink"
}
}
}
]
For a list of data stores supported as sources and sinks by the copy activity, see supported data stores.
Events
31 Mar, 23 - 2 Apr, 23
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Use Microsoft 365 services with model-driven apps and Microsoft Dataverse - Training
Learn how to use Microsoft 365 services with Power Apps model-driven apps and Dynamics 365 customer engagement apps.
Certification
Microsoft 365 Certified: Fundamentals - Certifications
Demonstrate understanding of Microsoft 365, to deliver industry-leading productivity apps along with intelligent cloud services, and world-class security.
Documentation
Load data from Microsoft 365 (Office 365) by using Azure Data Factory - Azure Data Factory
Use Azure Data Factory to copy data from Microsoft 365 (Office 365)