Archiving the SharePoint Office 365 Documents to Azure Cold Storage

What is SharePoint office 365?

SharePoint online is cloud based solution to reduce the dependency on the internal resources. SharePoint office 365 provides the many features of SharePoint without managing the infrastructure on your own.

For more details about the SharePoint office 355, you can refer the below link

What is Azure cool storage?

Cool storage is one of access tier mechanism in Azure Blob storage. Purpose of cool storage is to store your secondary data at a lower storage cost.

For more details about azure storage account, you can refer the below link

Today I would like to explain “How to move the document(s) from SharePoint Document library to Azure cold Storage?”



Moving the documents from SharePoint office 365 to Azure cool storage is not a straight forward mechanism. Above image represents the quick glance of moving documents to azure storage. To achieve this, you need to follow the below steps

  1. Move the Office 365 documents to Azure storage queue.

In this Process, include the “Move to Azure” option in the SharePoint document library ECB menu. The moment you click on the “Move to Azure” will create a queue in the azure storage and it put a message into the queue with document information details like “Document ID and Document url, etc.”

You can use the below JavaScript code for inserting the “Move to Azure” option in the SharePoint document library ECB menu.

Azure storage queue expose a rest API to create a queue, blobs and table. Based on that, I am creating a queue by using Queue service Rest Api. To create a queue, first we need to generate the authentication token and sample is given below for token generation.


In the above example Verb, date and CanonicalizedResource are required parameters. For building the “stringToSign” string, you need to follow the below msdn reference link

You can user the below code to create the queue in the azure storage


You can use the following code to put a message into the queue.


  1. Read the messages from the Azure storage queue and move to Azure cool storage

In this Process, Azure web job read the message form the queue and it process the data. My job picks the document library information from the message and downloading the documents based on the message url and it will move the documents to azure cold storage. Also it removes the document from the office 365 document library.

For more information related to azure jobs, refer the below url