Before integrating SharePoint with Azure Data Factory to move data into Azure Blob Storage, it is important to ensure that the SharePoint list is properly set up and contains the required data.
SharePoint Online is a web-based collaboration platform from Microsoft that integrates with Microsoft 365. It allows organizations to store, organize, share, and access information from any device. One of SharePoint’s most used features is the SharePoint List, a structured way to store tabular data like an Excel spreadsheet or a database table.
In Azure Data Factory, the SharePoint List connector enables integration with SharePoint lists. It is supported in both the Copy activity and the Lookup activity and works with both Azure Integration Runtime and Self-hosted Integration Runtime.
SharePoint List Online connector uses service principal authentication and retrieves data via OData protocol.
Before building the pipeline, service principal authentication must be set up.
2. In the registered app, there are two options for configuring authentication under Certificates & secrets:
Step 1: Open PowerShell as Administrator
Step 2: Run the following code
# Generate a self-signed cert
$cert = New-SelfSignedCertificate `
-Subject “CN=ADF-SharePointConnector” `
-CertStoreLocation “cert:CurrentUserMy” `
-KeyExportPolicy Exportable `
-KeySpec Signature `
-NotAfter (Get-Date).AddYears(1)
# Secure password to protect the PFX file
$password = ConvertTo-SecureString -String “<Password>” -Force -AsPlainText
# Export to PFX file
Export-PfxCertificate `
-Cert $cert `
-FilePath “C:UsersYourUsernameDocumentsadf-sharepoint.pfx” `
-Password $password
Note: Provide the password and the filepath.
Step 3: Convert .pfx File to Base64 (PowerShell) because .pfx file is not supported in Azure data factory so there you need to pass base 64 text file.
To convert run the below code:
[Convert]::ToBase64String([IO.File]::ReadAllBytes(“C:UsersYourUsernameDocumentsadf- sharepoint.pfx “)) | Set-Content -Path ” C:UsersYourUsernameDocumentsadf-sharepoint-base64.txt”
Step 4: Azure AD App Registration excepts the certificate upload to be the public key only, typically in one of these formats: .cer, .pem, or .crt not a .pfx file, which contains both the private and public keys plus the password.
You have to extract the public key certificate from your .pfx file and save it as a .cer file, then upload that file.
To achieve this run the below code:
$pfx = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$pfx.Import(“C:Users YourUsername Documentsadf-sharepoint.pfx”, “<PFX password>” [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
$pfx.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | Set- Content -Encoding Byte -Path “C:Users YourUsername Documentsadf- sharepoint.cer”
Note: Replace the correct password and file path.
Step 5: Configure API Permissions
Note: This application permission requires admin consent before it can be used within the tenant.
3. Build the pipeline in ADF
Step 1: Set up the Source (SharePoint List)
Create a Source Linked Service to SharePoint. In Azure Data Factory, go to:
Manage > Linked services > New
Dataset: Create the Source Dataset to SharePoint. Go to Author > Datasets > New Dataset
Step 2: Set up the Sink (Azure Blob Storage)
Step 3: Create the Copy Activity
In the ADF pipeline:
Conclusion
Integrating SharePoint Online with Azure Data Factory enables automated and secure data movement into Azure Blob Storage. By setting up a SharePoint list, configuring service principal authentication using a certificate, and leveraging the SharePoint Online List connector in ADF, data can be efficiently extracted and loaded into Blob Storage. Using Microsoft Graph API enhances access to SharePoint content, making it suitable for modern data workflows. This end-to-end solution simplifies data integration across Microsoft 365 and Azure, supporting scalable and automated analytics pipelines.
Chandana R L