131
CHAPTER 4 | Azure Storage
AzCopy: A very useful tool
Before finishing the chapter on Azure Storage, you need to know about AzCopy. This is a
free tool
provided by the Azure Storage team to move data around. The core use case is asynchronous server-
side copies. When you copy blobs or files from one storage account to another, they are not
downloaded from the first storage account to your local machine and then uploaded to the second
storage account. The blobs and files are copied directly within Azure.
Here are some of the things you can do with AzCopy:
Upload blobs from the local folder on a machine to Azure Blob storage.
Upload files from the local folder on a machine to Azure File storage.
Copy blobs from one container to another in the same storage account.
Copy blobs from one storage account to another, either in the same region or in a different
region.
Copy files from one file share to another in the same storage account.
Copy files from one storage account to another, either in the same region or in a different region.
Copy blobs from one storage account to an Azure File share in the same storage account or in a
different storage account.
Copy files from an Azure File share to a blob container in the same storage account or in a
different storage account.
Export a table to an output file in JSON or CSV format. You can export this to blob storage.
Import the previously exported table data from a JSON file into a new table. (Note: It won’t
import
from a CSV file.)
As you can see, there are a lot of possibilities when using AzCopy. It also has a bunch of options. For
example, you can tell it to only copy data where the source files are newer than the target files. You
can also have it copy data only where the source files are older than the target files. And you can
combine these options to ask it to copy only files that don’t exist in the destination at all.
AzCopy is frequently used to make backups of Azure Blob storage. Maybe you have files in Blob
storage that are updated by your customer frequently, and you want a backup in case there’s a
problem. You can do something like this:
Do a full backup on Saturday from the source container to a target container and
put the date in
the name of the target container.
For each subsequent day, do an incremental copy—copy only the files that are newer in the
source than in the destination.
If your customer uploads a file by mistake, if they contact you before end of day, you can retrieve the
previous version from the backup copy.
Here are some other use cases:
You want to move your data from a classic storage account to a
Resource Manager storage
account. You can do this by using AzCopy, and then you can change your applications to point to
the data in the new location.
132
CHAPTER 4 | Azure Storage
You want to move your data from general-purpose storage to cool storage. You would copy your
blobs from the general-purpose storage account to the new Blob storage account, then delete the
blobs from the original location.
For more information and a ton of examples,
check out
https://azure.microsoft.com/documentation/articles/storage-use-azcopy/
.
The Azure Data Movement Library
Many people wanted to be able to call AzCopy with their own specialized case. Because of this, the
Azure Storage team open sourced the Azure Storage Data Movement Library,
giving you
programmatic access to AzCopy. For more information, check out the repository and samples on
GitHub at
https://github.com/Azure/azure-storage-net-data-movement
.
133
CHAPTER 5 | Azure Virtual Networks
C H A P T E R
5
Azure Virtual
Networks
In
this chapter, we take a look at Azure Virtual Networks. We discuss the
various components and see how to create a virtual network in Azure. We
also see how to set up and use a point-to-site network.
What is a virtual network (VNet)?
Let’s take a look at what a virtual network is and what they’re used for. We’ll define the terms used
(such as subnets), and see how to create a VNet in Azure.
Do'stlaringiz bilan baham: