Import sharepoint files with metadata in Azure blob storage

GIQUIAUD, Fabien 0 Reputation points
2025-11-18T16:50:04.22+00:00

Hello,

I would like to know if it’s possible to upload documents stored in a SharePoint document library to Azure Blob Storage along with their associated metadata, especially the original SharePoint file URL.

Context: I’ve created an Agent in Copilot Studio and shared it internally through Microsoft Teams. Its KB is connected to that SharePoint site, and the goal is to allow employees to search for documents, get summaries, ask questions, etc. The solution works, but Copilot takes a long time to read all documents and generate answers.

To improve performance, I’m implementing a RAG approach using Azure AI Search. I’ve set up most components, but when I upload the files to Blob Storage, I’m unable to include the original metadata — particularly the file URL, which is essential. The Agent’s responses must reference the url so users can verify the information.

Is there a recommended way to:

Upload SharePoint files to Azure Blob Storage and preserve or attach their SharePoint metadata (especially the original file URL)

Thanks in advance for your help.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2025-11-18T16:50:31.99+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To upload documents from SharePoint to Azure Blob Storage while preserving their associated metadata, including the original SharePoint file URL, you can follow these steps:

    1. Retrieve Metadata from SharePoint: Since you mentioned that you can retrieve metadata using Logic Apps and Power Automate, continue using these tools to gather the necessary metadata, including the original SharePoint file URL.
    2. Upload Files to Azure Blob Storage: When you upload the files to Azure Blob Storage, you can use the Azure Blob Storage SDK or REST API. While uploading the files, you can set metadata for the blobs. This allows you to attach the original SharePoint file URL as metadata during the upload process.
      • If you're using the Azure SDK, you can set metadata by specifying it in the upload method. For example, in C#:
             var blobClient = new BlobClient(connectionString, containerName, blobName);
             var metadata = new Dictionary<string, string> { { "SharePointFileUrl", sharePointFileUrl } };
             await blobClient.UploadAsync(fileStream, new BlobHttpHeaders { ContentType = contentType }, metadata);
        
    3. Using Azure Logic Apps or Power Automate: If you prefer to continue using Logic Apps or Power Automate, you can utilize the Azure Blob Storage connector, which allows you to set metadata when creating a blob. Make sure to include the metadata key-value pairs in the appropriate action.
    4. Verify Metadata: After uploading, you can verify that the metadata has been set correctly by retrieving the blob properties and checking the metadata section.

    By following these steps, you should be able to upload your SharePoint files to Azure Blob Storage while preserving the original file URL as metadata, enabling your Agent to reference it in responses effectively.


    References:

    0 comments No comments

Your answer

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