31 Mar’17

Dynamics 365, EnterpriseAlternatives of Document storage in Dynamics CRM


CRM space is expensive, and often clients want alternatives to CRM storage for storing documents, images as these take up most of the space.

Available solutions:

  1. SharePoint Online with Dynamics CRM
  2. OneDrive for Business with Dynamics CRM

Currently, SharePoint document management is the preferred choice for most of the customers as alternative to storing email attachments and documents.

Advantages of SharePoint:

  1. SharePoint storage cost is very small about $0.20 per GB/Month compared to CRM’s $9.99/GB/Month. So, CRM space is around 50 times costlier than SharePoint space.
  2. You can leverage SharePoint Document management features like:
    1. Full text Search
    2. Metadata sorting
    3. Revisions
    4. Enterprise grade security

There are 2 ways to use SharePoint for document management with Dynamics:

  1. Use SharePoint Online Integration with Dynamics CRM. This is the ideal and efficient way to use SharePoint. You can see the steps for SharePoint online integration in one of our previous blogs:
  2. Use 3rd Party tools like Power Attachment, which will migrate your File attachments (notes) and Email attachments from CRM storage to Dynamics.
    More detail and pricing about Power attachments can found here:

1st approach should be the preferred way for using SharePoint as it is free, and works well. But users complain about an extra step to navigate to attachments, in which case you can go for Approach 2.

Alternative Solution:

  • The drawback with using SharePoint is if you have requirement of migrating your documents from CRM storage (Notes Attachments and Email attachments), you need to use 3rd party paid tools like Power Attachment.
  • Developing custom plugins to migrate documents to SharePoint is difficult in CRM online, since we cannot use External libraries in Sandbox plugin.

Due to above 2 reason, we can use Azure Blob storage as a possible alternative for migrating CRM documents.

What is Azure Blob storage:

Massively-scalable object storage for unstructured data

With exabytes of capacity and massive scalability, Azure Blob storage easily and cost-effectively stores from hundreds to billions of objects, in hot or cool tiers depending on how frequently data access is needed. Store any type of unstructured data—images, videos, audio, documents and more.

Azure Blob Features:

  1. Easy to Use – Geo Redundancy
  2. Robust API access
  3. Very Cheap storage space:
    It costs about $0.03/ GB/ month- which is 6.5x less than SharePoint storage cost and 300x less than CRM storage cost.

    Learn more about pricing here: https://azure.microsoft.com/en-us/pricing/details/storage/blobs-general/

API Coding for CRUD Operations in Azure Blob:

I have written a sample plugin which will migrate the CRM attachment to Azure blob, and save the Azure blob file link back in CRM. The plugin is registered on Annotation entity

For this, I have used a RestHelper and BlobHelper utility code files, which have all the operations of (a) making a web request and (b) performing blob operations.

The Helper files and the CRM plugin sample can be found in the below GitHub link:  https://github.com/somesh2207/CRMOnlineWithAzureBlob

The plugin file is UploadDocumentToBlob.cs

  1. The below code from the plugin file takes the document from CRM and creates a blob using REST API:
  2. Entity entity = (Entity)context.InputParameters["Target"];
                    string documentBlobURL = string.Empty;
                    //// Optional condition to migrate attachments related to particular entity.
                    //// If you want to migrate attachments for all entities, remove this CONDITION
                    if (entity.Contains("isdocument") && entity.GetAttributeValue<bool>("isdocument") == true &&
                        entity.GetAttributeValue<string>("objecttypecode") == "account")
                        string storageAccount = "<storageaccountname>";
                        string filename = entity.GetAttributeValue<string>("filename");
                        string containerName = "<blobcontainername>";
                        string storageKey = "<blobstorage_accesskey>";
                        //// Read File
                        string text = entity.GetAttributeValue<string>("documentbody");
                        BlobHelper blobHelper = new BlobHelper(storageAccount, storageKey);
       bool isUploadSuccess = blobHelper.PutBlob(containerName, filename, text);
                        //// Once blob upload is Success, get the Azure blob download-able URL of the uploaded File
                        if (isUploadSuccess)
                            documentBlobURL = string.Format("https://{0}.blob.core.windows.net/{1}/{2}", storageAccount, 
                                containerName, filename);
Written by

Someswara Siripuram

CRM Team Leader

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Managing mailbox through Email Archiving

    20 March’ 2018

    Introduction: Email can fill your Outlook Inbox quickly – new messages, replies, and forwards. Before you know it, yo...

    Read more
  • Workaround to Report.SAVEASPDF in NAV 2018

    20 March’ 2018

    Objective: In NAV 2017 Emailing the PDF by running the report using Report.SAVEASPDF is now not allowed in NAV 2018. Th...

    Read more
  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more