copy files from sharepoint to azure blob storage

Migrate SharePoint to Azure Blob: Step-by-Step Guide

By Ashley Wilson
AD

Moving data from SharePoint to Azure Blob Storage might seem like a daunting task, but it becomes straightforward once you understand the process. Both platforms offer robust data management solutions, and integrating them can bring about significant benefits like enhanced data security, better scalability, and cost-efficiency. This article will guide you through the step-by-step process of copying files from SharePoint to Azure Blob Storage.

Before we dive into the process, ensure you have the necessary permissions in both SharePoint and Azure. You'll also need the Azure Storage Explorer or Azure SDK to perform the copy operation. Let's get started with our first main topic, preparing your environment.

Preparing Your Environment

Before you begin, you need to set up your Azure account and create a storage account if you haven't already. A storage account provides a unique namespace where you store and access your data. Here's how you can create one:

AD
Copy Files From SharePoint To An Azure Blob Storage Using Microsoft Flow
Copy Files From SharePoint To An Azure Blob Storage Using Microsoft Flow
Manage and find data with Blob Index for Azure Storage—now in preview
Manage and find data with Blob Index for Azure Storage—now in preview
Folder vs. Library in SharePoint
Folder vs. Library in SharePoint

1. Sign in to the Azure portal (https://portal.azure.com/).

2. Click on 'Create a resource', search for 'Storage account', and then click 'Create'.

Copy Data From Blob Storage To Cosmos DB Using Azure Data Factory
Copy Data From Blob Storage To Cosmos DB Using Azure Data Factory
Everything You Need to Know About Blob Storage in Azure
Everything You Need to Know About Blob Storage in Azure
How to Move Azure Storage Blobs Between Containers in Azure Portal
How to Move Azure Storage Blobs Between Containers in Azure Portal

Installing Azure Storage Explorer

Now, let's install Azure Storage Explorer, a free stand-alone application, for managing your Azure storage data. You can download it from the official Microsoft website.

After installation, sign in with your Azure credentials. This will allow you to access your storage accounts and other resources.

AD

Setting Up SharePoint

You don't need to set up SharePoint as such, but ensure you have the necessary permissions to access and manage your files.

How to create your own Deep Learning Project in Azure | Towards Data Science
How to create your own Deep Learning Project in Azure | Towards Data Science
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
a table that has different types of file caterogies on it, including the names and
a table that has different types of file caterogies on it, including the names and
a diagram showing the different types of real time data flowchaps and how to use them
a diagram showing the different types of real time data flowchaps and how to use them
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
Digital Project Management Log for Teams
Digital Project Management Log for Teams

Now that our environment is set up, let's move on to the next main topic, connecting to your SharePoint site using Azure Storage Explorer.

Connecting to Your SharePoint Site

Azure Storage Explorer supports connecting to SharePoint Online sites. Here's how you can do it:

AD

1. In Azure Storage Explorer, click on 'Connect to SharePoint...' in the side menu.

How to Organize Digital Files for Easy Access
How to Organize Digital Files for Easy Access
The popular @ctrl/tinycolor package, downloaded over 2 million times per week, has been compromised along with over 40 other NPM packages in a sophisticated supply chain attack called 'Shai-Hulud.'
The popular @ctrl/tinycolor package, downloaded over 2 million times per week, has been compromised along with over 40 other NPM packages in a sophisticated supply chain attack called 'Shai-Hulud.'
Azure Blob Storage on IoT Edge now supports both Windows and Linux in Public preview | Microsoft Community Hub
Azure Blob Storage on IoT Edge now supports both Windows and Linux in Public preview | Microsoft Community Hub
Publishing ASP.NET Web Site To Azure From Visual Studio 2015
Publishing ASP.NET Web Site To Azure From Visual Studio 2015
StationMate™ StepUp File Desktop Organizer (5-Compartment, 25 Projects)
StationMate™ StepUp File Desktop Organizer (5-Compartment, 25 Projects)
15 Small Office Organization Ideas
15 Small Office Organization Ideas
Office Files Organization Ideas to get organized at work
Office Files Organization Ideas to get organized at work
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
a stack of plastic containers with labels on them
a stack of plastic containers with labels on them
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How To Use Cloud Computing Solutions to Get Organized
How To Use Cloud Computing Solutions to Get Organized
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
an open box on the ground with some sort of paper sticking out of it's bottom
an open box on the ground with some sort of paper sticking out of it's bottom

2. Enter your SharePoint online site URL and click 'OK'.

Connecting with Azure SDK

You can also connect to SharePoint using Azure SDK for .NET. You'll need to use SharePoint Client Object Model (CSOM) or REST API for this purpose.

AD

Here's a sample CSOM code snippet to connect to SharePoint:

using (ClientContext context = new ClientContext("https://your-site-url")) { context.ExecutingWebRequest += delegate (object sender, WebRequestEventArgs e) { e.WebRequestExecutor.RequestHeaders["X-FORMS_BASED_AUTH_ACCEPTED"] = "f"; }; context.Load(context.Web); context.ExecuteQuery(); Console.WriteLine(context.Web.Title); }

Browsing SharePoint Sites

Once connected, you can browse your SharePoint sites, libraries, and lists just like you would in the SharePoint interface.

Now that we've connected to our SharePoint site, let's discuss how to copy files from SharePoint to Azure Blob Storage.

Copying Files from SharePoint to Azure Blob Storage

Now we're ready to copy our files. You can either use Azure Storage Explorer or Azure SDK for this purpose.

Let's start with Azure Storage Explorer:

Using Azure Storage Explorer

1. In Azure Storage Explorer, find your storage account and navigate to 'Blob Containers'.

2. Right-click on the container where you want to store your files and select 'Upload Blob'.

3. In the 'Upload Blob' window, select 'From SharePoint'.

4. Enter your SharePoint site URL, and browse to select the files you want to upload.

5. Click 'OK' to start the upload process.

Using Azure SDK

To copy files using Azure SDK, you'll need to write a script that authenticates with both SharePoint and Azure, downloads the files from SharePoint, and then uploads them to Azure Blob Storage.

Here's a high-level overview of the process:

  1. Authenticate with SharePoint using CSOM or REST API.
  2. Download the files from SharePoint.
  3. Authenticate with Azure Blob Storage.
  4. Upload the files to the Azure Blob Storage container.

Remember to handle any exceptions that may occur during the process and implement retry logic.

That's it! You've successfully copied your files from SharePoint to Azure Blob Storage. With this process, you can easily migrate your data between the two platforms as needed.

If you have any other data management needs, Azure offers a range of services that can help make your data operations more efficient and secure. With Azure, the possibilities are truly endless.

AD