Azcopy Command to Upload .bak Folder to Blob Storage
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Go started with AzCopy
AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account. This article helps you lot download AzCopy, connect to your storage account, and then transfer files.
Note
AzCopy V10 is the currently supported version of AzCopy.
If you lot demand to use a previous version of AzCopy, see the Use the previous version of AzCopy section of this article.
Download AzCopy
First, download the AzCopy V10 executable file to whatever directory on your estimator. AzCopy V10 is just an executable file, so there'due south nothing to install.
- Windows 64-bit (naught)
- Windows 32-bit (nix)
- Linux x86-64 (tar)
- macOS (zip)
These files are compressed as a zippo file (Windows and Mac) or a tar file (Linux). To download and decompress the tar file on Linux, see the documentation for your Linux distribution.
Run AzCopy
For convenience, consider adding the directory location of the AzCopy executable to your organisation path for ease of use. That mode you can type azcopy
from any directory on your system.
If you cull non to add the AzCopy directory to your path, you'll have to change directories to the location of your AzCopy executable and blazon azcopy
or .\azcopy
in Windows PowerShell command prompts.
Equally an owner of your Azure Storage account, you lot aren't automatically assigned permissions to access data. Earlier you lot tin can do anything meaningful with AzCopy, you need to decide how you'll provide dominance credentials to the storage service.
Authorize AzCopy
Yous tin provide authorisation credentials by using Azure Active Directory (Advertizing), or by using a Shared Admission Signature (SAS) token.
Utilise this table as a guide:
Storage type | Currently supported method of authorisation |
---|---|
Blob storage | Azure Advertising & SAS |
Blob storage (hierarchical namespace) | Azure Advertisement & SAS |
File storage | SAS but |
Option 1: Use Azure Active Directory
This option is bachelor for hulk Storage only. By using Azure Active Directory, you tin provide credentials once instead of having to append a SAS token to each command.
Note
In the current release, if you plan to copy blobs between storage accounts, you'll accept to append a SAS token to each source URL. You lot can omit the SAS token only from the destination URL. For examples, see Copy blobs betwixt storage accounts.
To qualify access by using Azure Advertisement, see Qualify admission to blobs with AzCopy and Azure Agile Directory (Azure AD).
Option 2: Apply a SAS token
You tin can append a SAS token to each source or destination URL that utilize in your AzCopy commands.
This case command recursively copies information from a local directory to a blob container. A fictitious SAS token is appended to the cease of the container URL.
azcopy copy "C:\local\path" "https://account.blob.cadre.windows.net/mycontainer1/?sv=2018-03-28&ss=bjqt&srt=sco&sp=rwddgcup&se=2019-05-01T05:01:17Z&st=2019-04-30T21:01:17Z&spr=https&sig=MGCXiyEzbtttkr3ewJIh2AR8KrghSy1DGM9ovN734bQF4%3D" --recursive=true
To acquire more near SAS tokens and how to obtain ane, see Using shared access signatures (SAS).
Note
The Secure transfer required setting of a storage account determines whether the connection to a storage account is secured with Transport Layer Security (TLS). This setting is enabled by default.
Transfer data
Later on you've authorized your identity or obtained a SAS token, you can begin transferring data.
To detect example commands, see any of these manufactures.
Service | Article |
---|---|
Azure Hulk Storage | Upload files to Azure Hulk Storage |
Azure Blob Storage | Download blobs from Azure Blob Storage |
Azure Blob Storage | Copy blobs between Azure storage accounts |
Azure Hulk Storage | Synchronize with Azure Hulk Storage |
Azure Files | Transfer data with AzCopy and file storage |
Amazon S3 | Copy data from Amazon S3 to Azure Storage |
Google Deject Storage | Copy information from Google Deject Storage to Azure Storage (preview) |
Azure Stack storage | Transfer data with AzCopy and Azure Stack storage |
Get command help
To see a list of commands, type azcopy -h
and then press the ENTER key.
To learn about a specific command, only include the name of the command (For example: azcopy listing -h
).
List of commands
The following table lists all AzCopy v10 commands. Each command links to a reference article.
Command | Description |
---|---|
azcopy bench | Runs a performance benchmark by uploading or downloading exam data to or from a specified location. |
azcopy copy | Copies source information to a destination location |
azcopy medico | Generates documentation for the tool in Markdown format. |
azcopy env | Shows the environment variables that can configure AzCopy'southward beliefs. |
azcopy jobs | Subcommands related to managing jobs. |
azcopy jobs clean | Remove all log and program files for all jobs. |
azcopy jobs list | Displays data on all jobs. |
azcopy jobs remove | Remove all files associated with the given job ID. |
azcopy jobs resume | Resumes the existing job with the given job ID. |
azcopy jobs prove | Shows detailed information for the given job ID. |
azcopy load | Subcommands related to transferring data in specific formats. |
azcopy load clfs | Transfers local information into a Container and stores it in Microsoft's Avere Deject FileSystem (CLFS) format. |
azcopy listing | Lists the entities in a given resources. |
azcopy login | Logs in to Azure Agile Directory to access Azure Storage resources. |
azcopy logout | Logs the user out and terminates access to Azure Storage resources. |
azcopy make | Creates a container or file share. |
azcopy remove | Delete blobs or files from an Azure storage account. |
azcopy sync | Replicates the source location to the destination location. |
Note
AzCopy does non have a command to rename files.
Use in a script
Obtain a static download link
Over time, the AzCopy download link will point to new versions of AzCopy. If your script downloads AzCopy, the script might cease working if a newer version of AzCopy modifies features that your script depends upon.
To avoid these issues, obtain a static (unchanging) link to the current version of AzCopy. That style, your script downloads the same exact version of AzCopy each time that it runs.
To obtain the link, run this command:
Operating system | Control |
---|---|
Linux | curl -s -D- https://aka.ms/downloadazcopy-v10-linux | grep ^Location |
Windows | (curl https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction silentlycontinue).headers.location |
Notation
For Linux, --strip-components=one
on the tar
control removes the summit-level folder that contains the version proper noun, and instead extracts the binary directly into the current folder. This allows the script to be updated with a new version of azcopy
by only updating the wget
URL.
The URL appears in the output of this control. Your script can then download AzCopy by using that URL.
Operating system | Command |
---|---|
Linux | wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux && tar -xf azcopy_v10.tar.gz --strip-components=1 |
Windows | Invoke-WebRequest https://azcopyvnext.azureedge.net/release20190517/azcopy_windows_amd64_10.one.2.zip -OutFile azcopyv10.nada <<Unzip hither>> |
Escape special characters in SAS tokens
In batch files that accept the .cmd
extension, you'll take to escape the %
characters that announced in SAS tokens. You lot can do that by adding an boosted %
character next to existing %
characters in the SAS token cord.
Run scripts past using Jenkins
If y'all program to utilise Jenkins to run scripts, make sure to place the following command at the first of the script.
/usr/bin/keyctl new_session
Apply in Azure Storage Explorer
Storage Explorer uses AzCopy to perform all of its data transfer operations. You lot tin can use Storage Explorer if y'all desire to leverage the functioning advantages of AzCopy, but you prefer to use a graphical user interface rather than the command line to collaborate with your files.
Storage Explorer uses your account key to perform operations, so later you sign into Storage Explorer, you lot won't demand to provide additional say-so credentials.
Configure, optimize, and fix
Run across any of the following resources:
-
AzCopy configuration settings
-
Optimize the performance of AzCopy
-
Troubleshoot AzCopy V10 issues in Azure Storage by using log files
Employ a previous version
If you lot need to employ the previous version of AzCopy, run across either of the following links:
-
AzCopy on Windows (v8)
-
AzCopy on Linux (v7)
Next steps
If y'all have questions, issues, or general feedback, submit them on GitHub page.
Feedback
Submit and view feedback for
kaufmanparliveartle.blogspot.com
Source: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
Belum ada Komentar untuk "Azcopy Command to Upload .bak Folder to Blob Storage"
Posting Komentar