How to copy all Azure Storage Tables data between two different Storage Accounts with Python
Background
This article describes how to copy all Azure Storage Tables data between two different storage accounts.
For this, we will use Azure Storage SDK for Python to copy all tables (and the respective data) from one Azure Storage Table to another Azure Storage Table. This approach will keep the data in the source tables, and will create new tables with the respective data in the destination Azure Storage Table.
This script was developed and tested using the following versions but it is expected to work with previous versions:
- Python 3.11.7
- azure-data-tables (version: 12.5.0)
- azure-core (version: 1.30.1)
Approach
In this section, you can find a sample code to copy all tables data between two Storage Accounts using the Azure Storage SDK for Python.
This Python sample code is based on Azure Storage SDK for Python. Please review our documentation here Azure Tables client library for Python | Microsoft Learn
-
- azure-data-tables (more information here azure-data-tables · PyPI). To install, please run:
pip install azure-data-tables - azure-core (more information here azure-core · PyPI). To install, please run:
pip install azure-core
- azure-data-tables (more information here azure-data-tables · PyPI). To install, please run:
Please see below the sample code to copy all the tables data between two Azure Storage Accounts using the storage connection string.
Special note: Only tables that do not exist with the same name in the destination Storage Account will be copied.
After executing this sample code, it is expected that you will find all the tables from the source Storage Account in the destination Storage Account, as well as the data from those tables.
Disclaimer:
- These steps are provided for the purpose of illustration only.
- These steps and any related information are provided "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
- We grant You a nonexclusive, royalty-free right to use and modify the Steps and to reproduce and distribute the steps, provided that. You agree:
- to not use Our name, logo, or trademarks to market Your software product in which the steps are embedded;
- to include a valid copyright notice on Your software product in which the steps are embedded; and
- to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of steps.
Published on:
Learn moreRelated posts
Integration Testing Azure Functions with Reqnroll and C#, Part 5 - Using Corvus.Testing.ReqnRoll in a build pipeline
If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the final post in this serie...
Integration Testing Azure Functions with Reqnroll and C#, Part 4 - Controlling your functions with additional configuration
If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the fourth of this series of...
Integration Testing Azure Functions with Reqnroll and C#, Part 3 - Using hooks to start Functions
If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the third of a series of pos...
Integration Testing Azure Functions with Reqnroll and C#, Part 2 - Using step bindings to start Functions
If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the second of a series of po...
Integration Testing Azure Functions with Reqnroll and C#, Part 1 - Introduction
If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the first of a series of pos...
Announcing Azure MCP Server 2.0 Stable Release for Self-Hosted Agentic Cloud Automation
Azure MCP Server 2.0 is now generally available, delivering first-class self-hosting, stronger security hardening, and a faster foundation for...
Azure Security: Private Vs. Service Endpoints
When connecting securely to a platform service such as a key vault or an Azure storage account, Microsoft recommends using a private endpoint ...
Give your Foundry Agent Custom Tools with MCP Servers on Azure Functions
Learn how to connect your MCP server hosted on Azure Functions to Microsoft Foundry agents. This post covers authentication options and setup ...
Azure Data Factory Tips for Reliable Microsoft Dynamics 365 CE and Dataverse Integrations
Reliable integrations between Microsoft Dynamics 365 Customer Engagement and external systems can become challenging. This is especially true ...
Scalable AI with Azure Cosmos DB: Tredence Intelligent Document Processing (IDP) | March 2026
Azure Cosmos DB enables scalable AI-driven document processing, addressing one of the biggest barriers to operational scale in today’s enterpr...