Skip to main content Explore View all products (200+) Microsoft Foundry Azure Copilot GitHub Copilot Azure Kubernetes Service (AKS) Azure Cosmos DB Azure Database for PostgreSQL Azure Arc Microsoft Fabric Linux virtual machines in Azure Foundry Models Foundry Agent Service Foundry IQ Foundry Tools Foundry Control Plane Observability in Foundry Control Plane Azure OpenAI in Foundry Models Azure Speech in Foundry Tools Azure Machine Learning View all databases Azure Cosmos DB Azure DocumentDB Azure SQL Azure Database for PostgreSQL Azure Managed Redis Microsoft Fabric Azure Databricks Linux virtual machines in Azure Windows Server on Azure Azure Functions Azure Virtual Machine Scale Sets Azure API Management Azure Container Apps Azure Kubernetes Service (AKS) Azure Kubernetes Fleet Manager Azure Container Registry Azure Red Hat OpenShift Azure Container Instances Azure Container Storage Azure Arc Azure Local Microsoft Defender for Cloud Azure Monitor Microsoft Sentinel Azure Migrate View all solutions (40+) Cloud solutions for small and medium businesses Cloud migration and modernization center Data analytics for AI Azure Databases AI apps and agents Microsoft Marketplace Microsoft Sovereign Cloud AI apps and agents Responsible AI with Azure AI Infrastructure Data analytics for AI Machine learning operations (MLOps) Low-code application development on Azure Integration Services Serverless computing DevOps Migration and modernization center .NET apps migration Databases on Azure Linux on Azure Oracle on Azure SAP on the Microsoft Cloud Adaptive cloud High-performance computing (HPC) Infrastructure as a service (IaaS) Resiliency Azure Essentials Frontier Accelerate for Azure FinOps on Azure Microsoft Marketplace Azure pricing overview Create an Azure account Free Azure services Flexible purchase options Pricing calculator FinOps on Azure Maximize ROI from AI Azure savings plans Azure reservations Azure Hybrid Benefit Virtual Machines Azure SQL Microsoft Foundry Microsoft Fabric Azure Kubernetes Service (AKS) Microsoft Defender for Cloud View more Software Development Companies Microsoft Marketplace Find a partner Resources for Azure partners Get started with Azure Customer stories Analyst reports, white papers, and e-books Videos Learn more about cloud computing Documentation Explore Azure portal Developer resources Quickstart templates Resources for startups Developer community Students Azure for partners Blog Events and Webinars Learn Support Contact Sales Get started with Azure Sign in

Since AzCopy was first released, a large number of customers have requested programmatic access to AzCopy. We are pleased to announce a new open-sourced Azure Storage data movement library for .NET (DML for short). This library is based on the core data movement framework that powers AzCopy. The library is designed for high-performance, reliable and easy Azure Storage data transfer operations enabling scenarios such as:

  • Uploading, downloading and copying data between Microsoft Azure Blob and File Storage
  • Migrating data from other cloud providers such as AWS S3 to Azure Blob Storage
  • Backing up Azure Storage data

Here is a sample demonstrating how to upload a blob, (find more samples at GitHub).

using System;
using System.Threading;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
// Include the New Azure Storage Data Movement Library
using Microsoft.WindowsAzure.Storage.DataMovement;

// Setup the storage context and prepare the object you need to upload
string storageConnectionString = "myStorageConnectionString";
CloudStorageAccount account = CloudStorageAccount.Parse(storageConnectionString);
CloudBlobClient blobClient = account.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference("mycontainer");
blobContainer.CreateIfNotExists();
string sourcePath = "pathtotest.txt";
CloudBlockBlob destBlob = blobContainer.GetBlockBlobReference("myblob");


// Use the interfaces from the new Azure Storage Data Movement Library to upload the blob
// Setup the number of the concurrent operations
TransferManager.Configurations.ParallelOperations = 64;

// Setup the transfer context and track the upoload progress
TransferContext context = new TransferContext();
context.ProgressHandler = new Progress((progress) =>
{
    Console.WriteLine("Bytes uploaded: {0}", progress.BytesTransferred);
});

// Upload a local blob
var task = TransferManager.UploadAsync(
    sourcePath, destBlob, null, context, CancellationToken.None);
task.Wait();

Azure Storage Data Movement Library has the same performance and exposes the core functionalities of AzCopy. You can install the first preview of the library from Nuget or download the source code from GitHub. In the initial version (0.1.0) of this library, you can find the following abilities:

  • Support data transfer for Azure Storage abstraction: Blob
  • Support data transfer for Azure Storage abstraction: File
  • Download, upload, copy single object
  • Control the number of concurrent operations
  • Synchronous and asynchronous copying
  • Define the number of concurrent operations
  • Define the suffix of the user agent
  • Set the content type
  • Set the Access Condition to conditionally copy objects, for example: copy objects changed since certain date
  • Validate content MD5
  • Download specific blob snapshot
  • Track transfer progress: bytes transferred, number of success, fail, skip files
  • Recover (Set/Get transfer checkpoint)
  • Transfer Error handling (transfer exception and error code)
  • Client-side logging

DML is an open source project. We welcome contributions from the community. In particular we are interested in extensions to our samples to help make them more robust. Together with the release of version 0.1.0, we have created the following samples, for more details, please visit GitHub Readme.md.

Next steps

We will continue the investment for both AzCopy and Data Movement Library, and in the next releases of Data Movement Library, we will add the support for more advanced features, which shall include:

  • Download, upload, copy directory (local file directory, blob virtual directory, file share directory)
  • Transfer directory in recursive mode or flat mode
  • Specify the file pattern when copying files and directories
  • Download Snapshots under directories

As always, we look forward to your feedback.

WE ARE MICROSOFT

Explore Microsoft Foundry

The future of AI starts here. Envision your next great AI app with the latest technologies. Get started with Azure.