Skip to content
Thursday, May 8, 2025
Latest:
  • Changing Service tiers? Do you need downtime?
  • Different Database Services in AWS
  • Google Launched second Cloud Region in India
  • SQL Server IaaS Agent Extension |Part-1
  • Day-3 | SQL Server Internals and SQL Azure Workshop | IBM Noida

SQLChamp

Let's learn together!

  • Home
  • LearnSQL
  • SQLServer
  • SQLTips
  • Azure Data Platform
    • SQLAzure
    • SQLServer on Azure VM
  • Best Practices
  • Speaking Events
    • In-Person Events
    • Events
  • Contact – us
    • form7
Azure Data PlatformSQLAzure

AZCopy to upload or download Azure SQL Database export

April 18, 2016 Sarabpreet Singh Anand

Let’s take a hypothetical example that your app generates a subsequent file for each order in your storage account and you’ve to download\copy it to one of your servers. Now how will you achieve this? AZCopy is the solution.

You can use Azure portal to do it, however it will be a manual exercise and not a feasible solution. Here comes AZCopy to rescue. This is a powerful tool which can help you do this easily. It’s just like Robocopy.exe. This tiny tool helps you copy all type data from your storage account be it a blob or a table entity.

AZCopy Benefits

You can upload, download, copy files concurrently & the biggest advantage you get is it can resume interrupted operations.

Download the latest version of AZCopy Utility (MicrosoftAzureStorageTools.msi) from here: http://aka.ms/downloadazcopy. The setup is less than 3 megabytes in size. Here is how it looks like:

AZCopy installed
AZCopy installed
azcopy console
azcopy console

It doesn’t offer any GUI to play with. That means there is a slight learning curve for all those GUI people.

Let’s see a basic command, how to copy/upload a single file from local disk to Azure storage account:

AzCopy /Source:C:\Backup /Dest:https://sepstoragedemo.blob.core.windows.net/db-files /DestKey:a4IQjGlIpDFPwMS4sF8v+tSrd50s5+XXFSS17JFw3hTl4fnrJvigNA9OAZAx5u4m8DmcTlRKvtibX1GLRW9jDw== /Pattern:AZCopy.txt

Please note that you must issue the statement in a single line without any linebreaks.

In-case you want to download the file from Azure to local disk you just need to change the source and destination values accordingly along with relevant Access Keys. You can also use the same command if you want to copy files between different storage accounts, the storage accounts can be in the same or different regions.

The syntax is quite simple, here are the switches one may use with the command:

/Pattern:”file-pattern”

Specifies a file pattern that indicates which files to copy. The behavior of the /Pattern parameter is determined by the location of the source data, and the presence of the recursive mode option. Recursive mode is specified via option /S.

If the specified source is a directory in the file system, then standard wildcards are in effect, and the file pattern provided is matched against files within the directory. If option /S is specified, then AzCopy also matches the specified pattern against all files in any subfolders beneath the directory.

AzCopy uses case-sensitive matching when the /Source is a blob container or blob virtual directory, and uses case-insensitive matching in all the other cases.

/S à Specifies recursive mode for copy operations. In recursive mode, AzCopy will copy all blobs or files that match the specified file pattern, including those in subfolders.

AZCopy Script execution
AZCopy Script execution

Let’s cross verify the file on Azure storage account using Portal:

verify fileupload azure storage account
verify fileupload azure storage account

Since the tool copies the files asynchronously, once you issue the statement the copy operation starts in the background and uses only the available spare bandwidth. You can however use /SyncCopy parameter to force the copy operation synchronously.

Hope you got answer to your questions! Happy Learning!

feel free to leave a comment. 🙂

Thanks,
Sarabpreet Singh Anand
Subscribe now to get latest Tips\blog posts in your Inbox
Follow @SQLChamp

  • Dynamic Data Masking Intro
  • How to find the Isolation level being used by a Database?
  • Azure (2)
  • Azure Data Platform (32)
  • Azure Data Platform (2)
  • Best Practices (37)
  • Events (9)
  • In-Person (9)
  • In-Person Events (22)
  • Latest Announcements (6)
  • LearnSQL (32)
  • Powershell for SQL (5)
  • Powershell-Basics (1)
  • Pro-Tip (1)
  • Product Reviews (1)
  • Speaking Events (18)
  • SQL for Beginners (5)
  • SQL Server (1)
  • SQLAzure (33)
  • SQLServer (15)
  • SQLServer on Azure VM (17)
  • SQLServer on Azure VM (1)
  • SQLTips (22)
  • Uncategorized (9)
  • Webcast (6)

Always Encrypted (6) azure (32) azure portal (6) Azure SQL Database (10) backup (5) backup encryption (6) cloud (6) Database (4) DDM (5) deadlock (4) Dynamic Data Masking (5) error log (3) event (21) Execute As (4) Execution context (3) free (10) Free event (8) free sql learning (6) Function (3) grant (3) gurgaon (9) in person (9) learn (3) Learning (9) limitations (4) MCT (8) Microsoft (8) MVP (8) permissions (3) powershell (8) Powershell4SQL (3) restore (3) sarab (19) sarabpreet singh anand (4) security (11) SQL (51) SQL 2012 (5) SQL 2014 (8) SQL Azure (12) SQLAzure (10) SQL Database (10) SQL Saturday (9) SQLServer (31) sql server (17) sql server 2012 (6) SQLServer 2014 (9) sql server 2014 (4) SQL Server 2016 (8) SQLServerday (13) SQL Server day (9) SQLServer Workshop (3) sql tips (4) step-by-step (4) t-sql (8) tech days (3) tips (4) Training (10) tricks (3) webcast (7) windows azure (6)

Copyright © 2025 SQLChamp. All rights reserved.
Theme: ColorMag by ThemeGrill. Powered by WordPress.