I am facing issue when trying to extract email attachments using Azure Data Fctory

Pushpak Jindal 0 Reputation points
2024-11-22T16:50:11.4933333+00:00

Hi, I am trying to extract the email attachments from a particular email account in my tenant using Azure Data Factory. Steps followed:

  1. Created an App (AP1)
  2. Created a secret nad saved the key
  3. Provided the following API permissions to the app
    1. Mail.Read (Application)
    2. Mail.ReadBasic.All (Application)
    3. User.Read (Delegated)
  4. Created a Blob Storage Account (BS1)
  5. Created an Office 365 Linked Service (LL1) using the following
    1. App Client ID as Service Principal ID
    2. Secret Key as Service Principal key
  6. Created another blob storage linked list (LL2) using the following:
    1. authentication Type: Service Principal
    2. App Client ID as Service Principal ID
    3. Secret Key as Service Principal key
  7. Created an office 365 dataset in Azure data factory using the following:
    1. Using linked service LL1
    2. Table: BasicDataSet_v0.Inbox_v1
  8. Created another blob storage dataset in Azure data factory using the following:
    1. Using Linked Service LL2
    2. Blob storage account BS1
  9. Assigned the following roles to the AP1 service principal:
    1. Storage Account Contributor
    2. Storage Blob Data Contributor
  10. Create a pipeline with a copy activity:
    1. Source: office 365 dataset
    2. Sink: blob storage dataset

I am getting the following error:

ErrorCode=UserErrorOffice365DataLoaderError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Office365 data loading failed to execute. office365LoadErrorType: PermanentError. Provided application does not match the one in the token.,Source=Microsoft.DataTransfer.ClientLibrary,'

I have double checked everything. I have already created App client secrets multiple times and changed them everywhere.

Any help would be appreciated. Thanks

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,019 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 22,065 Reputation points
    2024-11-22T23:28:05.67+00:00

    Ensure that the Application ID used in the Office 365 Linked Service (LL1) matches exactly with the one in the token. Next make sure the token hasn't expired and is valid for the operations you're trying to perform.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.