### AzCopy Get Started and Authorization Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This section covers the initial steps to use AzCopy, including how to get started and authorize access to Azure Storage using Microsoft Entra ID. It details the necessary configurations and steps for authentication. ```APIDOC AzCopy Get Started: - Download and install AzCopy. - Basic usage examples for copying files and directories. AzCopy Authorization with Microsoft Entra ID: - Method: Use `azcopy login` command. - Prerequisites: Azure CLI installed and logged in, or Service Principal credentials. - Scenarios: Authenticating to Azure Blob Storage and Azure Files. - Example: azcopy login --tenant-id azcopy copy "" "" --recursive=true ``` -------------------------------- ### Install AzCopy on Ubuntu/Debian using apt Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Installs AzCopy on Ubuntu and Debian-based systems using the apt package manager. This process involves downloading the .deb configuration package, installing it, updating the package list, and then installing AzCopy. ```bash curl -sSL -O https://packages.microsoft.com/config///packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update sudo apt-get install azcopy ``` -------------------------------- ### AzCopy v10 Usage Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Instructions and examples for using AzCopy v10, the latest version of the utility. This includes installation, authorization, data transfer, and command help. ```APIDOC AzCopy v10 Usage: - Installation: Instructions for installing AzCopy on Linux using a package manager or downloading the portable binary. - Authorization: Methods for authorizing AzCopy, including using SAS tokens or Azure AD authentication. - Data Transfer: Commands for copying data to and from Azure Blob storage and Azure Files. - Example: azcopy copy 'https://[account].blob.core.windows.net/[container]/[path/to/file]?[SAS_TOKEN]' 'C:\path\to\local\file' - Command Help: Use 'azcopy help' to get detailed information about available commands and their options. ``` -------------------------------- ### AzCopy Examples: Download from Blob Storage Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Provides examples for downloading data from Azure Blob storage using AzCopy. Includes downloading specific blobs or entire containers. ```azcopy azcopy copy "https://[account].blob.core.windows.net/[container]/[path-in-container]" "" [flags] ``` -------------------------------- ### Install AzCopy on Linux Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Instructions for installing AzCopy on Linux using a package manager. This typically involves adding a repository and then installing the AzCopy package. ```bash # Example for Debian/Ubuntu based systems # Add the Microsoft package repository wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ sudo sh -c 'echo "deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list' # Update package list and install AzCopy sudo apt-get update sudo apt-get install azcopy ``` -------------------------------- ### AzCopy Examples: Manage Properties and Metadata Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Demonstrates how to set or retrieve properties and metadata for blobs using AzCopy. Essential for data management. ```azcopy azcopy set-properties "https://[account].blob.core.windows.net/[container]/[blob]" --content-type="application/json" ``` ```azcopy azcopy set-metadata "https://[account].blob.core.windows.net/[container]/[blob]" key1=value1 key2=value2 ``` -------------------------------- ### Get AzCopy Command Help Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Shows how to access help documentation for AzCopy commands. This is useful for understanding available options and parameters for specific operations. ```cli # Get help for the main AzCopy command azcopy --help # Get help for a specific command, e.g., 'copy' azcopy copy --help ``` -------------------------------- ### Install AzCopy on RHEL using dnf Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Installs AzCopy on Red Hat Enterprise Linux (RHEL) and compatible distributions using the dnf package manager. This involves downloading the repository configuration, installing it, updating the package index, and finally installing AzCopy. ```bash curl -sSL -O https://packages.microsoft.com/config///packages-microsoft-prod.rpm sudo rpm -i packages-microsoft-prod.rpm rm packages-microsoft-prod.rpm sudo dnf update sudo dnf install azcopy ``` -------------------------------- ### Download AzCopy Portable Binary Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Provides download links for the AzCopy portable binary across different operating systems and architectures. These files are compressed and can be used without a formal installation. ```bash # Windows 64-bit (zip) # https://aka.ms/downloadazcopy-v10-windows # Windows 32-bit (zip) # https://aka.ms/downloadazcopy-v10-windows-32bit # Windows ARM64 Preview (zip) # https://aka.ms/downloadazcopy-v10-windows-arm64 # Linux x86-64 (tar) # https://aka.ms/downloadazcopy-v10-linux # Linux ARM64 (tar) # https://aka.ms/downloadazcopy-v10-linux-arm64 # macOS (zip) # https://aka.ms/downloadazcopy-v10-mac # macOS ARM64 Preview (zip) # https://aka.ms/downloadazcopy-v10-mac-arm64 ``` -------------------------------- ### Install AzCopy on openSUSE/SLES using zypper Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Installs AzCopy on openSUSE and SUSE Linux Enterprise Server (SLES) using the zypper package manager. The process includes downloading the repository configuration, importing GPG keys, and installing AzCopy. ```bash curl -sSL -O https://packages.microsoft.com/config///packages-microsoft-prod.rpm sudo rpm -i packages-microsoft-prod.rpm rm packages-microsoft-prod.rpm sudo zypper --gpg-auto-import-keys refresh sudo zypper install -y azcopy ``` -------------------------------- ### Get AzCopy Command Help Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs To view a list of available AzCopy commands, use the '-h' flag. To get help for a specific command, include the command name followed by '-h'. ```azcopy azcopy -h ``` ```azcopy azcopy list -h ``` -------------------------------- ### AzCopy Examples: Interact with Amazon S3 Buckets Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Provides guidance on using AzCopy to copy data to and from Amazon S3 buckets. Facilitates cross-cloud data transfer. ```azcopy azcopy copy "s3://[bucket-name]/[path]" "https://[account].blob.core.windows.net/[container]/[path]" --s3-access-key=[access-key] --s3-secret-key=[secret-key] ``` -------------------------------- ### AzCopy Examples: Upload to Blob Storage Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Demonstrates how to upload data to Azure Blob storage using AzCopy. Covers common upload scenarios and configurations. ```azcopy azcopy copy "" "https://[account].blob.core.windows.net/[container]/[path-in-container]" [flags] ``` -------------------------------- ### Install AzCopy on Azure Linux using tdnf Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Installs AzCopy on Azure Linux distributions using the tdnf package manager. This is a straightforward command to install the AzCopy package. ```bash sudo tdnf install azcopy ``` -------------------------------- ### AzCopy Examples: Interact with Google Cloud Storage Buckets Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Shows how to use AzCopy to copy data to and from Google Cloud Storage buckets. Supports multi-cloud data integration. ```azcopy azcopy copy "gs://[bucket-name]/[path]" "https://[account].blob.core.windows.net/[container]/[path]" --google-storage-key="[json-key-file-path]" ``` -------------------------------- ### AzCopy Examples: Copy Between Azure Storage Accounts Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Illustrates how to copy data between different Azure Storage accounts using AzCopy. Useful for data migration or backup. ```azcopy azcopy copy "https://[source-account].blob.core.windows.net/[container]/[path]" "https://[destination-account].blob.core.windows.net/[container]/[path]" [flags] ``` -------------------------------- ### Use AzCopy in a Script Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Provides examples of how to integrate AzCopy commands into shell scripts for automated data transfer tasks. This often involves setting environment variables for authentication. ```bash #!/bin/bash # Set environment variables for authentication (e.g., SAS token) export AZCOPY_AUTH_MODE="SAS" export AZCOPY_SAS_TOKEN="" # Define source and destination SOURCE_DIR="/path/to/local/data" DEST_URL="https://[account].blob.core.windows.net/[container]/[path]" # Perform the copy operation azcopy copy "$SOURCE_DIR" "$DEST_URL" --recursive=true # Check exit code for success or failure if [ $? -eq 0 ]; then echo "AzCopy operation completed successfully." else echo "AzCopy operation failed." exit 1 fi ``` -------------------------------- ### Transfer Data with AzCopy Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Examples of using AzCopy to transfer data, including uploading files, downloading blobs, and copying between storage accounts. Supports various protocols and authentication methods. ```cli # Upload a directory to blob storage azcopy copy "/path/to/local/directory" "https://[account].blob.core.windows.net/[container]/[path]?[SAS]" --recursive=true # Download blobs from a container azcopy copy "https://[account].blob.core.windows.net/[container]/[path]?[SAS]" "/path/to/local/directory" --recursive=true # Copy between storage accounts azcopy copy "https://[source-account].blob.core.windows.net/[container]/[path]?[source-SAS]" "https://[destination-account].blob.core.windows.net/[container]/[path]?[destination-SAS]" --recursive=true ``` -------------------------------- ### AzCopy Examples: Synchronize Blob Storage Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Shows how to synchronize local data with Azure Blob storage or vice versa using AzCopy. Ensures data consistency. ```azcopy azcopy sync "" "https://[account].blob.core.windows.net/[container]/[path-in-container]" [flags] ``` -------------------------------- ### AzCopy Copy Command Example Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This command recursively copies data from a local directory to an Azure Blob Storage container. It requires a SAS token appended to the container URL for authorization. ```azcopy azcopy copy "C:\local\path" "https://account.blob.core.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 ``` -------------------------------- ### Download and Extract AzCopy v10 Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Scripts for downloading and extracting AzCopy v10 binaries for Linux and Windows using provided static links. ```bash wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux && tar -xf azcopy_v10.tar.gz --strip-components=1 ``` ```powershell Invoke-WebRequest -Uri -OutFile 'azcopyv10.zip' Expand-archive -Path '.\azcopyv10.zip' -Destinationpath '.\' $AzCopy = (Get-ChildItem -path '.\' -Recurse -File -Filter 'azcopy.exe').FullName # Invoke AzCopy & $AzCopy ``` ```powershell Invoke-WebRequest -Uri -OutFile 'azcopyv10.zip' $AzCopy = (Expand-archive -Path '.\azcopyv10.zip' -Destinationpath '.\' -PassThru | where-object {$_.Name -eq 'azcopy.exe'}).FullName # Invoke AzCopy & $AzCopy ``` -------------------------------- ### AzCopy V10 Command-Line Utility Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs AzCopy V10 is a command-line utility that enables you to copy data to and from Azure Blob storage and Azure Files by using the most efficient path. This documentation covers common AzCopy commands and their usage. ```APIDOC AzCopy Commands: Copy Blobs: azcopy copy '' '' [flags] - Copies files and directories to and from Azure Storage. - Source and destination can be local paths, Azure Blob URLs, or Azure Files URLs. - Common flags include: --recursive: Copies subdirectories recursively. --include-pattern: Include only files that match the pattern. --exclude-pattern: Exclude files that match the pattern. --overwrite: Overwrite existing files at the destination. --check-length: Compare the length of the source and destination files. --content-type: Set the content type for uploaded blobs. --cache-control: Set the cache-control header for uploaded blobs. --metadata: Set metadata for uploaded blobs. --blob-type: Specify the blob type (BlockBlob, PageBlob, AppendBlob). Sync Blobs: azcopy sync '' '' [flags] - Synchronizes the contents of a source directory with a destination directory. - Only files that are new or have changed in the source are uploaded. - Flags are similar to the 'copy' command. List Blobs: azcopy list '' [flags] - Lists the blobs in a specified container. - Flags: --delimiter: Specifies a delimiter for listing blobs (e.g., '/'). --machine-readable: Outputs results in a machine-readable format. Remove Blobs: azcopy remove '' [flags] - Removes blobs from a specified container. - Flags: --recursive: Removes blobs in subdirectories recursively. --include-pattern: Include only blobs that match the pattern. --exclude-pattern: Exclude blobs that match the pattern. Make Blobs: azcopy make '' [flags] - Creates a container or a virtual directory. - Flags: --public-access: Sets the public access level for the container (blob, container, off). Job Commands: azcopy jobs list - Lists all completed, failed, and in-progress jobs. azcopy jobs show - Shows details of a specific job. azcopy jobs resume - Resumes a failed or cancelled job. azcopy jobs cancel - Cancels a running job. Authentication: - AzCopy uses Azure Active Directory (Azure AD) or Shared Access Signature (SAS) tokens for authentication. - Login using Azure AD: azcopy login - Using SAS token: Set the AZCOPY_AUTO_LOGIN_TYPE environment variable to 'SharedKey' or 'SAS' and provide the SAS token in the AZCOPY_SAS_TOKEN environment variable, or pass it directly in the command. Example Usage: Copy a local directory to a blob container: azcopy copy "C:\my-local-data" "https://[account].blob.core.windows.net/[container]?[SAS-token]" --recursive=true Sync a blob container with a local directory: azcopy sync "https://[account].blob.core.windows.net/[container]?[SAS-token]" "C:\my-local-data" --delete-destination=true ``` -------------------------------- ### Obtain Static AzCopy Download Link Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Commands to retrieve the static download URL for AzCopy v10 for different operating systems. This helps in scripting reliable downloads of a specific AzCopy version. ```bash curl -s -D- https://aka.ms/downloadazcopy-v10-linux | grep ^Location ``` ```powershell (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue).headers.location ``` ```powershell (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue -SkipHttpErrorCheck).headers.location ``` -------------------------------- ### AzCopy v10 Command Reference Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This section lists all available AzCopy v10 commands and their primary functions. AzCopy is a command-line utility that you can use to copy files to and from Azure Blob Storage and Azure Files by using simple REST APIs with optimal performance. ```APIDOC azcopy bench Runs a performance benchmark by uploading or downloading test data to or from a specified location. azcopy copy Copies source data to a destination location. azcopy doc Generates documentation for the tool in Markdown format. azcopy env Shows the environment variables that can configure AzCopy's behavior. azcopy jobs clean Remove all log and plan files for all jobs. azcopy jobs list Displays information 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 show Shows detailed information for the given job ID. azcopy list Lists the entities in a given resource. azcopy login Logs in to Microsoft Entra ID to access Azure Storage resources. azcopy login status Lists the entities in a given resource. 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. azcopy set-properties Change the access tier of one or more blobs and replace (overwrite) the metadata, and index tags of one or more blobs. Note: AzCopy does not have a command to rename files. ``` -------------------------------- ### AzCopy Configuration Settings Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Details on various configuration settings available for AzCopy to customize its behavior and optimize performance. This includes settings related to performance tuning, logging, and authentication. ```APIDOC AzCopy Configuration Settings: - AZCOPY_AUTO_LOGIN: Automatically logs in to Azure. - AZCOPY_CONFIG_FILE_PATH: Specifies the path to the AzCopy configuration file. - AZCOPY_LOG_LOCATION: Sets the directory for AzCopy log files. - AZCOPY_JOB_PLAN_LOCATION: Specifies the directory for AzCopy job plan files. - AZCOPY_BLOCK_BLOB_MAX_BLOCK_SIZE: Sets the maximum block size for block blobs. - AZCOPY_PAGE_BLOB_MAX_PAGE_SIZE: Sets the maximum page size for page blobs. - AZCOPY_MAX_CONCURRENT_REQUESTS: Controls the maximum number of concurrent requests. - AZCOPY_MAX_MEMORY_PERCENTAGE: Sets the maximum percentage of memory AzCopy can use. - AZCOPY_LOG_LEVEL: Defines the verbosity of the logs (e.g., ERROR, WARNING, INFO, DEBUG). ``` -------------------------------- ### Previous AzCopy Versions (Deprecated) Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Information regarding the use of previous, deprecated versions of AzCopy, specifically v8 for Windows and v7 for Linux. Microsoft recommends using AzCopy v10. ```APIDOC Previous AzCopy Versions (Deprecated): - AzCopy on Windows (v8): Refer to legacy documentation for v8 usage. - AzCopy on Linux (v7): Refer to legacy documentation for v7 usage. - Recommendation: Microsoft strongly advises migrating to AzCopy v10 for all operations due to the deprecation of older versions. ``` -------------------------------- ### AzCopy Troubleshooting and Resuming Jobs Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Information on how to find errors and resume interrupted AzCopy jobs using log and plan files. This section covers common issues and their resolutions. ```APIDOC AzCopy Troubleshooting and Resuming Jobs: - Log Files: Located in the directory specified by AZCOPY_LOG_LOCATION. These files contain detailed information about AzCopy operations, including errors. - Plan Files: Located in the directory specified by AZCOPY_JOB_PLAN_LOCATION. These files store the state of ongoing jobs, allowing them to be resumed. - Resuming Jobs: Use the 'resume' command-line flag or the job plan files to resume interrupted transfers. - Common Errors: Network connectivity issues, authentication failures, insufficient permissions, and invalid file paths. ``` -------------------------------- ### Run AzCopy Scripts with Jenkins Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs A command to be placed at the beginning of scripts when using Jenkins to manage AzCopy operations, ensuring proper session handling. ```bash /usr/bin/keyctl new_session ``` -------------------------------- ### AzCopy Performance Optimization Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Guidance on optimizing AzCopy performance for faster data transfers. This includes recommendations on network configuration, hardware, and AzCopy-specific settings. ```APIDOC AzCopy Performance Optimization: - Increase concurrent requests: Use AZCOPY_MAX_CONCURRENT_REQUESTS to increase the number of parallel operations. - Optimize block size: Adjust AZCOPY_BLOCK_BLOB_MAX_BLOCK_SIZE for optimal throughput based on your network and storage. - Network bandwidth: Ensure sufficient network bandwidth is available for transfers. - Hardware: Utilize faster storage and CPUs for improved performance. - Compression: Consider enabling compression if transferring compressible data. ``` -------------------------------- ### Copy Data to Azure Files with AzCopy Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This snippet shows how to copy local files to an Azure Files share. It uses a connection string for authentication and supports recursive copying of directories. This command is compatible with both Windows and Linux. ```bash azcopy copy "" "https://.file.core.windows.net//?" --recursive=true ``` ```powershell azcopy copy "" "https://.file.core.windows.net//?" --recursive=true ``` -------------------------------- ### AzCopy Performance Optimization and Logging Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This section focuses on optimizing AzCopy performance and utilizing logs for error resolution. It provides guidance on configuring AzCopy for better throughput and how to interpret log files to diagnose and fix issues. ```APIDOC AzCopy Performance Optimization: - Environment Variables: Configure `AZCOPY_CONCURRENCY_VALUE` for parallel operations. - Job Configuration: Adjusting block size and retry logic. - Network Considerations: Ensuring sufficient bandwidth. AzCopy Logging for Error Resolution: - Log Location: Default log directory (`%USERPROFILE%\AppData\Local\Temp\azcopy`). - Log Levels: Verbose logging for detailed information. - Troubleshooting Steps: - Identify failed operations in logs. - Analyze error messages for specific causes (e.g., network issues, permissions). - Use logs to resume interrupted jobs. ``` -------------------------------- ### AzCopy Command to REST Operation Mapping Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This reference maps AzCopy commands to their corresponding Azure Storage REST API operations. Useful for understanding the underlying API calls. ```APIDOC AzCopy Command Mapping to Azure Storage REST Operations: AzCopy Command | Azure Storage REST Operation | Description ----------------|----------------------------|------------ `azcopy copy` | `Put Blob`, `Get Blob`, `List Blobs` | Copies data to/from Azure Storage. `azcopy sync` | `List Blobs`, `Get Blob Properties`, `Delete Blob`, `Put Blob` | Synchronizes local data with Blob Storage. `azcopy set-properties` | `Set Blob Properties` | Modifies blob properties like content type. `azcopy set-metadata` | `Set Blob Metadata` | Adds or updates metadata for a blob. Refer to the Azure Storage REST API documentation for detailed information on each operation. ``` -------------------------------- ### Copy Data to Blob Storage with AzCopy Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This snippet demonstrates how to copy local files to an Azure Blob Storage container using AzCopy. It requires a SAS token for authentication. This command is applicable to both Windows and Linux environments. ```bash azcopy copy "" "https://.blob.core.windows.net//?" --recursive=true ``` ```powershell azcopy copy "" "https://.blob.core.windows.net//?" --recursive=true ``` -------------------------------- ### Synchronize Data with AzCopy Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Demonstrates how to synchronize local data with Azure Blob Storage or vice versa. The sync command copies only the files that have changed. ```cli # Synchronize local directory to blob storage azcopy sync "/path/to/local/directory" "https://[account].blob.core.windows.net/[container]/[path]?[SAS]" --delete-destination=true # Synchronize blob storage to local directory azcopy sync "https://[account].blob.core.windows.net/[container]/[path]?[SAS]" "/path/to/local/directory" --delete-destination=true ``` -------------------------------- ### Authorize AzCopy Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Demonstrates how to authorize AzCopy to access Azure Storage. This can be done using Azure Active Directory (Azure AD) or Shared Access Signatures (SAS). ```cli # Authorize using Azure AD (interactive) azcopy login # Authorize using SAS token export AZCOPY_AUTO_LOGIN_TYPE=SPN_KEY export AZCOPY_SPA_CLIENT_ID= export AZCOPY_SPA_CLIENT_SECRET= export AZCOPY_TENANT_ID= # Or directly using SAS token for a specific operation azcopy copy "" "" --sas-token "" ``` -------------------------------- ### Synchronize Directories with AzCopy Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs This snippet demonstrates how to synchronize a local directory with a remote directory in Azure Blob Storage. The --delete-destination=true flag removes files in the destination that are not present in the source. This command is cross-platform. ```bash azcopy sync "" "https://.blob.core.windows.net//?" --delete-destination=true ``` ```powershell azcopy sync "" "https://.blob.core.windows.net//?" --delete-destination=true ``` -------------------------------- ### Escape Special Characters in SAS Tokens Source: https://learn.microsoft.com/en-us/azure/storage/common/azcopy/AzCopy/Docs Instructions for escaping special characters like '%' and '&' in SAS tokens when using them in batch files (.cmd) to prevent command interpretation errors. ```batch Escape '%' characters by adding an extra '%' (%%). Escape '&' characters by adding a '^' before them (^&). ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.