How to migrate all Azure Storage Queue data between two different Storage Accounts with Python
Background
This article describes how to migrate all Azure Storage Queues data between two different storage accounts.
For this, we will use Azure Storage SDK for Python to copy all queues (and the respective data) from one Azure Storage Queue to another Azure Storage Queue. This approach will keep the data in the source queues, and will create new queues with the respective data in the destination Azure Storage Queue.
This script was developed and tested using the following versions but it is expected to work with previous versions:
- Python 3.11.7
- azure-identity (version: 1.15.0)
- azure-storage-queue (version: 12.9.0)
Approach
In this section, you can find a sample code to copy all queues 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 Quickstart: Azure Queue Storage client library for Python.
-
- azure-identity (more information here azure-identity · PyPI). To install, please run:
pip install azure-identity - azure-storage-queue (more information here azure-storage-queue · PyPI). To install, please run:
pip install azure-storage-queue
- azure-identity (more information here azure-identity · PyPI). To install, please run:
Please see below the sample code to copy all the queues data between two Azure Storage Accounts using the storage connection string.
After executing this sample code, it is expected that you will find all the queues from the source Storage Account in the destination Storage Account, as well as the data/messages from those queues.
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
UPDATED: Azure outage affecting Windows Updates and related services
UPDATED 1:45 PM PST: Resolution efforts are complete at this time, and Windows services are expected to be back to normal. Notices related to ...
Native Agent Memory for Microsoft Agent Framework, Powered by Azure Cosmos DB
Recently we introduced the Agent Memory Toolkit and the Agentic Retrieval Toolkit for Azure Cosmos DB. The Agent Memory Toolkit gives your age...
Building AI Chatbots with Copilot Studio and Azure OpenAI (Complete 2026 Guide)
Introduction Artificial Intelligence has fundamentally changed how businesses interact with customers, employees and partners. Modern organisa...
Build locally, ship to Azure: meet Azure SQL Developer
Big news: Azure SQL Developer is here, in private preview. It’s the Azure SQL Database engine, on your laptop, in a container. Build aga...
Azure Developer vs Azure Administrator: Which Azure Career Path Should You Choose in 2026?
Introduction Cloud computing has become the backbone of modern businesses, and Microsoft Azure continues to be one of the world’s leadin...
Azure Developer Roadmap 2026: Skills, Certifications, Projects, and Career Path
Introduction Cloud computing has become the backbone of modern software development, and Microsoft Azure is one of the world’s leading c...
July Patches for Azure DevOps Server
We are releasing new patches for our self‑hosted product, Azure DevOps Server. We strongly recommend that all customers stay up to date with t...
What Is Azure AI Foundry and Why Should Developers Learn It? (Complete 2026 Guide)
Introduction Artificial Intelligence is no longer a futuristic technology—it’s becoming a core component of modern software development....
AI agents, meet the Azure Cosmos DB vNext emulator
If you use the Azure Cosmos DB vNext emulator, you probably know the local development loop: start the emulator, connect to it, create some re...