Skip to main content

How I Used GitHub Copilot to Automate an Azure DevOps Migration

 The primary goal of this work was to assess whether an AI system could define and support the entire migration process, from design through script creation to execution.

This effort was not limited to faster code generation. The experiment aimed to determine whether AI could practically support all migration stages, including analysis, process structuring, task automation, documentation, and execution support.
For this experiment, I migrated from Azure DevOps Server to Azure DevOps Services using Microsoft’s official Data Migration Tool. This scenario was selected for its complexity, which includes technical dependencies, validation points, identity management, infrastructure setup, and post-migration verification. Such migrations are prone to errors if the process is unclear or not repeatable.
The objective was to automate as much of the end-to-end migration flow as possible. Typically, such migrations require several days for planning, scripting, testing, documentation, troubleshooting, and execution. In this case, the solution was designed and built in approximately three hours, providing a strong test of AI’s practical value in engineering work.
The final deliverable was a production-ready automation package with 10 PowerShell scripts, 11 orchestration scripts for dry-run and production workflows, 16 Markdown documentation files, and 2 configuration files. This totalled approximately 4,500 lines of PowerShell and 3,000 lines of documentation. This is a comprehensive migration framework that enables structured, repeatable execution. The output is publicly available on GitHub in the vulnerable/azure-devops-migration repository and was successfully tested in a dedicated environment.
One key design decision was to centralise configuration in a single file. This approach ensures the environment is configured once and all scripts use consistent parameters throughout the migration. The automation scope is broad and covers the most important migration phases. It starts with pre-flight validation. This includes SQL connectivity, tool paths, disk space, server version, and Azure region checks. Next, it exports on-premises users, group memberships, and access levels through the Azure DevOps REST API. After this, it cross-references users with Entra ID and can optionally create missing accounts where needed.
The solution automates the Migrator validate and prepare steps, analyses the identity map, detaches the collection, generates the DACPAC using SqlPackage.exe, uploads required artefacts to Azure Storage, creates the SAS token, updates the import definition, and executes the import for either DryRun or ProductionRun. After migration, it validates the target cloud organisation and compares results to a pre-cutover baseline.
Post-migration validation is essential. Migration involves not only moving data but also confirming the target state is correct. Automation verifies projects, repositories, work items, build counts, and restores access levels. An 11-point automated pre-cutover check helps prevent last-minute problems. Some areas were intentionally left manual. For example, Entra ID Connect setup remains an IT responsibility, collection detach still requires human confirmation, Entra ID sign-in during import is interactive, and some post-migration tasks, such as billing setup, agent reconfiguration, service connections, secrets re-entry, and extension reinstallations, still need manual work. This was also part of the experiment. I wanted to understand not only where AI helps, but also where human control should remain in the process.
The productivity gain was substantial. Using GitHub Copilot, the entire process took about three hours. Without AI, it would have required an estimated 10 to 16 days for one engineer, including research, planning, development, orchestration, documentation, testing, debugging, execution, and updates. This represents a 25- to 40-fold increase in speed.
AI delivered the most value in handling repetitive patterns and supporting rapid iteration. Boilerplate code, configuration loading, REST API calls, parameter validation, and error handling were generated consistently across all scripts. Documentation, including guides, checklists, rollback plans, and troubleshooting content, was produced much faster. Additionally, AI facilitated live debugging, allowing about 10 issues to be identified and resolved in real time. This demonstrated AI’s usefulness both in preparation and during the migration itself.
The experiment showed that AI dramatically sped up delivery and handled repetitive tasks effectively, but human oversight was crucial for architectural, security, and critical validation decisions. The best outcomes combined AI's efficiency with human judgment, ensuring quality and control.
Lessons learned
  • AI can help not only with code generation, but also with defining and structuring an end-to-end migration process.
  • A migration plan becomes much stronger when processes, scripts, documentation, and validation are designed together.
  • Documentation generation is one of the biggest productivity gains, not only code generation.
  • Real-time AI debugging can markedly reduce troubleshooting time.
  • A single configuration model improves consistency and decreases operational mistakes.
  • Security separation between config and secrets should be designed from the beginning.
  • Not every step should be automated. Some actions should remain manual for control and risk reasons.
  • Post-migration validation is as important as the migration itself.
  • AI can accelerate delivery a lot, but human review is still necessary for quality and judgment.
Repository:
https://github.com/vunvulear/azure-devops-migration

Comments

Popular posts from this blog

How to audit an Azure Cosmos DB

In this post, we will talk about how we can audit an Azure Cosmos DB database. Before jumping into the problem let us define the business requirement: As an Administrator I want to be able to audit all changes that were done to specific collection inside my Azure Cosmos DB. The requirement is simple, but can be a little tricky to implement fully. First of all when you are using Azure Cosmos DB or any other storage solution there are 99% odds that you’ll have more than one system that writes data to it. This means that you have or not have control on the systems that are doing any create/update/delete operations. Solution 1: Diagnostic Logs Cosmos DB allows us activate diagnostics logs and stream the output a storage account for achieving to other systems like Event Hub or Log Analytics. This would allow us to have information related to who, when, what, response code and how the access operation to our Cosmos DB was done. Beside this there is a field that specifies what was th...

Why Database Modernization Matters for AI

  When companies transition to the cloud, they typically begin with applications and virtual machines, which is often the easier part of the process. The actual complexity arises later when databases are moved. To save time and effort, cloud adoption is more of a cloud migration in an IaaS manner, fulfilling current, but not future needs. Even organisations that are already in the cloud find that their databases, although “migrated,” are not genuinely modernised. This disparity becomes particularly evident when they begin to explore AI technologies. Understanding Modernisation Beyond Migration Database modernisation is distinct from merely relocating an outdated database to Azure. It's about making your data layer ready for future needs, like automation, real-time analytics, and AI capabilities. AI needs high throughput, which can be achieved using native DB cloud capabilities. When your database runs in a traditional setup (even hosted in the cloud), in that case, you will enc...

Azure Well-Architected AI workload Assessment

  AI is everywhere, part of the IT solutions we build and run today. Having an AI service, a good model, and data is not enough. As for cloud, the real difference is how we build, manage and run the whole solution. Microsoft created the Azure Well-Architected Framework for AI Workloads exactly for this reason — to help teams design AI systems that are reliable, secure, and cost-efficient. The assessment has six main categories that we cover in the next section. Based on the results, we can gain a good understanding of the current AI workload estate and a list of actions to improve how you run and manage your AI workloads . Designing the AI Application The first step in building your AI application is to consider how you will structure it. Using containers for tasks like data processing or model inference helps maintain consistency across the system. This approach makes it easier to update, move, and manage different components. When you have multiple steps in your workflow, such as...