Bobcares Logo
Search Phone User Profile Emergency Contact
Bobcares Logo
Search Phone User Profile Emergency Contact
Emergency Contact Client Portal
SOLUTIONS
Product Engineering
MVP Build
MVP to Scale
Product Maintenance
Digital Transformation
Process Digitization & Automation
Systems Integration & Workflow Orchestration
Data Enablement & Decision Support
Application & Platform Modernization
Transformation Execution
AI Services
AI Readiness & Use-Case Discovery
AI Integration & Application Enablement
Intelligent Automation & AI Workflows
Infrastructure Management & Optimization
Always-On Infrastructure Management
Proactive Monitoring & Incident Prevention
Cloud Cost Control & Optimization (FinOps)
Outsourced IT & End-User Support
Managed Infrastructure Execution Support
DevOps & Automation Services
CI/CD & Release Automation
Infrastructure as Code & Platform Standardization
Reliability Engineering & Observability
DevSecOps Enablement
Cybersecurity
Security Assessment & Risk Posture
Threat Monitoring & Incident Response
Infrastructure & Cloud Security Hardening
Vulnerability Assessment & Penetration Testing (VAPT)
Backup, Disaster Recovery & BCP

AzCopy to S3: Data transfer tutorial

by Nikhath K | Nov 1, 2021 | Amazon Web Services (AWS), Latest, Server Management | 1 comment

Please Note: This article is part of our historical archive. Because it was published a while ago, some of the information, links, or context may now be outdated.

AzCopy to S3 has made copying files, directories, and buckets an easy task.

As a part of our AWS Support Service, we offer solutions to every query that comes our way.

Let’s take a look at this in-depth tutorial about AzCopy by our skilled Support Engineers.

AzCopy to s3

AzCopy is a CLI utility that we use to copy files or blobs to or from a storage account. Today, we are going to take a look at how to use this handy tool to copy buckets, directories, and objects from AWS S3 to Azure Blob Storage with the help of AzCopy.

Before we begin we have to offer the following authorization credentials:

  • To authorize with Azure Storage, use SAS (Shared Access Signature) or AD (Azure Directory) token.
  • To authorize with AWS S3 as well use a secret access key and an AWS access key.

How to Authorize with Azure Storage

First, we will download AzCopy and choose how to provide authorization credentials to Azure Storage.

Our Support Engineers would like to point out that the examples in this tutorial assume your identity is authenticated via the AzCopy login command. This way, your Azure AD account authorizes access to data in Blob Storage.

However, we can also use SAS token for authorization as long as the token is appended to the resource URL in each AzCopy command.

How to Authorize with AWS S3

Here, we will set the environment variables after getting hold of the AWS access key and secret access key:

  • macOS:
    export AWS_ACCESS_KEY_ID=<access-key>
    export AWS_SECRET_ACCESS_KEY=<secret-access-key>
  • Linux:
    export AWS_ACCESS_KEY_ID=<access-key>
    export AWS_SECRET_ACCESS_KEY=<secret-access-key>
  • Windows:
    set AWS_ACCESS_KEY_ID=<access-key>
    set AWS_SECRET_ACCESS_KEY=<secret-access-key>

AzCopy to s3: Copy objects, directories & buckets

AzCopy uses Put Block From URL API to copy data directly between storage servers and AWS S3. In other words, the network bandwidth of the machine is not used.

Our Support Engineers would like to point out that the examples in this article include path arguments within single quotes (“).

In other words, we have to use single quotes in all command shells except cmd.exe. In case, we turn to cmd.exe we will use double quotes (“”) instead.

Copy an object

We will use the same URL syntax for accounts with a hierarchical namespace.

Syntax

azcopy copy https://s3.amazonaws.com/<bucket-name>/<object-name>' 'https://<storage-account-name>.blob.core.windows.net/<container-name>/<blob-name>'

For instance:

azcopy copy 'https://s3.amazonaws.com/mybucket/myobject' 'https://mystorageaccount.blob.core.windows.net/mycontainer/myblob'

Copy a directory

We will use the same URL syntax for accounts with a hierarchical namespace.

Syntax

azcopy copy
'https://s3.amazonaws.com/<bucket-name>/<directory-name>'
'https://<storage-account-name>.blob.core.windows.net/<container-name>/<directory-name>'
--recursive=true

For instance:

azcopy copy 'https://s3.amazonaws.com/mybucket/mydirectory' 'https://mystorageaccount.blob.core.windows.net/mycontainer/mydirectory' –recursive=true

Copy contents of a directory

We can copy the contents of a directory without having to copy the entire directory by using the * or wildcard symbol.

Syntax

azcopy copy
'https://s3.amazonaws.com/<bucket-name>/<directory-name>/*'
'https://<storage-account-name>.blob.core.windows.net/<container-name>/<directory-name>'
--recursive=true

For instance:

azcopy copy 'https://s3.amazonaws.com/mybucket/mydirectory/*' 'https://mystorageaccount.blob.core.windows.net/mycontainer/mydirectory' –recursive=true

Copy a bucket

We will use the same URL syntax for accounts with a hierarchical namespace.

Syntax

azcopy copy 'https://s3.amazonaws.com/<bucket-name>'
'https://<storage-account-name>.blob.core.windows.net/<container-name>'
--recursive=true

For instance:

azcopy copy 'https://s3.amazonaws.com/mybucket' 'https://mystorageaccount.blob.core.windows.net/mycontainer' --recursive=true

Copy all buckets in a specific S3 region

We will use the same URL syntax for accounts with a hierarchical namespace.

Syntax

azcopy copy 'https://s3-<region-name>.amazonaws.com/'
'https://<storage-account-name>.blob.core.windows.net'
--recursive=true

For instance:

azcopy copy 'https://s3-rds.eu-north-1.amazonaws.com' 'https://mystorageaccount.blob.core.windows.net' --recursive=true

Copy all buckets in all regions

We will use the same URL syntax for accounts with a hierarchical namespace.

Syntax

azcopy copy 'https://s3.amazonaws.com/' 'https://<storage-account-name>.blob.core.windows.net' --recursive=true

For instance:

azcopy copy 'https://s3.amazonaws.com' 'https://mystorageaccount.blob.core.windows.net' –recursive=true

AzCopy to S3: Handling differences in object naming rules

Did you know the naming conventions for bucket names are different while comparing AWS S3 and Azure blob containers?

Fortunately, AzCopy takes care of this issue. In other words, AzCopy checks for naming collisions and ultimately attempts to resolve them while copying files.

For instance, AWS S3 bucket names with periods and consecutive hyphens are replaced by AzCopy.

AzCopy to S3: Handling differences in object metadata

Another key point to look out for while copying files is to remember that AWS S3 and Azure permit different character sets in object key names.

Fortunately, this is resolved by the AzCopy copy command by using the s2s-handle-invalid-metadata flag. The value of the flag indicates how the incompatible key names have to be handled. This table describes each flag value:

  • FailIfInvalid:
    Objects are not copied. AzCopy logs an error. It also includes the error in the failed count in the transfer summary.
  • ExcludeIfInvalid:
    This is the default option. It indicates that the metadata is not included in the transferred object. Moreover, AzCopy logs a warning.
  • RenameIfInvalid:
  • AzCopy resolves the invalid metadata key. Furthermore, it copies the object via the resolved metadata key-value pair. In case AzCopy is not able to rename the key, the object is not copied.

AzCopy to S3: How to rename object keys

We will perform the following steps to rename object keys:

  1. First, we will replace all invalid characters with ‘_’.
  2. Then, we will add rename_ to the start of a new valid key. In fact,t his key will contain the original metadata value.
  3. After that, we will addrename_key_ to the start id a new valid key and use it to save the original metadata invalid key.

[Need a hand with Server Management? We are here to help.]

Conclusion

In brief, this tutorial by the skilled Support Engineers at Bobcares demonstrated how to use AzCopy to copy files between AWS S3 and Azure.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

Related posts:

    1. AWS DMS: Migrate data to Amazon S3 – How to do
    2. Retrieve log data from CloudWatch – How to do
    3. AWS error Route not stabilize in expected time: Quick fix
    4. All about AWS ACM email validation

1 Comment

  1. camilia
    camilia on 2023-08-17 at 16:15

    Great article, for me I use Gs Richcopy 360

    Reply

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to Fix VMware Datastore Connectivity and Storage Latency Issues
  • DevSecOps Automation Platform for Secure Development
  • AI and ML for DevOps: The Complete Guide
  • 3-2-1-1-0 Backup Strategy With Restic, Wasabi, and Air-Gapped Storage
  • How to Improve API Reliability with HAProxy Load Balancing and Health Checks

Categories

  • Advanced Vulnerability
  • AI Automation
  • AI Services
  • AI Support
  • AIOps
  • Amazon Web Services (AWS)
  • Apache
  • API Integration
  • Application Development
  • Azure
  • Business Process Management
  • Business Process Reengineering
  • Cloud Cost Optimization
  • Cloud Management
  • Cloud-Native Application
  • Cloudflare
  • cPanel
  • cPanel migration
  • Cyberpanel
  • DDoS
  • Development Service
  • DevOps
  • DevOps Consulting
  • DevSecOps
  • Digital Transformation
  • DigitalOcean
  • DirectAdmin
  • Docker
  • Drupal
  • Ecommerce
  • Feedback Management Systems
  • Filezilla
  • FTP
  • Full-Stack Product Development
  • Google cloud platform
  • HAProxy
  • Headless CMS Integration
  • Hosting Support
  • Hybrid Cloud Management
  • IIS
  • Infrastructure Management & Optimization
  • Kubernetes
  • KVM
  • Laravel
  • Latest
  • Legacy Application Modernization
  • Linode
  • Litespeed
  • LXC/LXD
  • Magento
  • Microservices Architecture
  • Mobile App Development
  • MongoDB
  • Moodle
  • MySQL
  • NFS
  • Nginx
  • OnApp
  • Outsourced Support
  • OVH
  • ovirt
  • Performance Optimization & Monitoring
  • pfsense
  • Plesk
  • PostgreSQL
  • PowerDNS
  • Product Engineering
  • Proxmox
  • RedHat
  • Redis
  • SaaS Development
  • Sendmail
  • Server Administration
  • Server Management
  • Software Development
  • Software Testing
  • SQLServer
  • Technical Support
  • UI/UX
  • Virtualizor
  • VMware
  • VPN
  • Vulnerability Scanning
  • Vultr
  • Web Development
  • Windows
  • WordPress
  • WordPress Hosting
  • WordPressHA

Subscribe to our newsletter

Footer newsletter

Email inquiry@bobcares.com | Phone 1-800-383-5193

Solutions

  • Product Engineering
  • Digital Transformation
  • AI Services
  • Infrastructure Management & Optimization
  • DevOps & Automation Services
  • Cybersecurity

Services

  • Managed IT Services
  • Cloud Modernization Services
  • Custom Software Development Services
  • DevOps services
  • Business Process Management Services

Insights

  • Case Studies
  • Blog

Company

  • About Us
  • Our Partners
  • Careers
  • CSR
Product Engineering +
Web Development MVP to Scale Builds Microservices Architecture Agile & Dev Team Augmentation Mobile Apps Ecommerce UI/UX Design QA & Test Automation
Digital Transformation +
Legacy Modernization Workflow Automation Data-Driven Dashboards CRM / ERP Integration Business Process Re-engineering
AI Services +
AI & Machine Learning AIOps Intelligent Automation Business Intelligence & Analytics AI Installation & Compute
Infrastructure Management +
Cloud Setup Cloud Migration Managed Cloud Services Server & Hosting Cost Optimization Performance Optimization Outsourced Support
DevOps & Automation Services +
CI/CD Setup Kubernetes & Docker Infrastructure as Code Cloud-Native Migration DevSecOps
Cybersecurity & Compliance Services +
Security Hardening VAPT Incident Response Backup & DR

© 2026 Bobcares. All Rights Reserved.

  • Cookie Policy
  • |
  • GDPR
  • |
  • Privacy Policy
  • |
  • Terms of Service
  • LinkedIn
  • YouTube
  • Instagram
  • Facebook

Preview of the new Bobcares experience
NEW UPDATE
See What’s New
at Bobcares

Discover a faster, clearer view of our services and expertise.


Explore the New Experience
Arrow Right