Skip to content

Commit 40f5b1d

Browse files
authored
Merge pull request #307991 from habibaum/server-repdeploy-doc
Adding server redeploy article
2 parents 8650a18 + b63d10b commit 40f5b1d

File tree

9 files changed

+121
-1
lines changed

9 files changed

+121
-1
lines changed
364 KB
Loading
106 KB
Loading
197 KB
Loading
143 KB
Loading
274 KB
Loading
127 KB
Loading
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: Redeploy servers to Azure using Infrastructure as Code
3+
description: Learn how to automate Windows Server redeployment to Azure using Infrastructure as Code (IaC) with Azure Migrate.
4+
author: piyushdhore-microsoft
5+
ms.author: piyushdhore
6+
ms.topic: how-to
7+
ms.service: azure-migrate
8+
ms.reviewer: v-uhabiba
9+
ms.date: 11/10/2025
10+
ms.custom: engagement-fy25
11+
# Customer intent: As a system administrator, I want to redeploy Windows Server 2003 machines to Azure using Infrastructure as Code so that I can automate the migration and reduce manual steps.
12+
---
13+
14+
# Redeploy servers to Azure using Infrastructure as Code (IaC)
15+
16+
This article helps you redeploy **Windows and Linux Servers to Azure using Infrastructure as Code (IaC)** with step-by-step guidance to generate templates, deploy landing zones, migrate servers, and integrate disk configurations for automated, repeatable migrations.
17+
18+
Azure Migrate supports server redeployment through Infrastructure as Code (IaC).
19+
You can automate the process of rebuilding and configuring servers in Azure using declarative scripts instead of manual steps. By leveraging this feature, you can:
20+
21+
- Create IaaS application IaC based on assessment.
22+
- Deploy the IaaS application IaC.
23+
- Migrate the server using the Server Migration tool.
24+
- Detach the data disk using the disk migration script to generate disk IaC.
25+
- Merge disk IaC with application IaC.
26+
- Reapply the application IaC script.
27+
28+
29+
## Create IaaS application IaC
30+
31+
Azure Migrate lets you generate Infrastructure as Code (IaC) templates for your assessed workloads or applications. These templates create an application landing zone in Azure, enabling automated deployment and configuration.
32+
33+
### Prerequisites
34+
35+
Before you begin, complete the Azure VM assessment in Azure Migrate either through workload assessment or application assessment.
36+
37+
### Generate Application Landing Zone IaC
38+
39+
Follow the steps to generate Infrastructure as Code (IaC) for your assessed workloads or applications in Azure Migrate:
40+
41+
1. Open the assessment report in the Azure Migrate portal after you complete the workload or application assessment.
42+
1. Select **Generate IaC** at the top of the report to start the code generation process.
43+
44+
45+
:::image type="content" source="./media/server-redeploy/code-generation-process.png" alt-text="The screenshot shows how to start the code generation process." lightbox="./media/server-redeploy/code-generation-process.png":::
46+
47+
3. The portal redirects you to the IaC generation flow, where you review and select details before generating the code.
48+
49+
:::image type="content" source="./media/server-redeploy/generation-flow.png" alt-text="The screenshot shows how to redirect to IaC generation flow to review and select details before generating the code." lightbox="./media/server-redeploy/generation-flow.png":::
50+
51+
4. IaC generation currently supports only IaaS (Infrastructure as a Service) targets.
52+
5. For workload assessments, select the workloads you want to include in the generated application code.
53+
6. For application assessments, select the application you want to generate IaC for. You can generate code for only one application at a time.
54+
55+
56+
:::image type="content" source="./media/server-redeploy/generate-application.png" alt-text="The screenshot shows how to select application to generate IaC for one application at a time." lightbox="./media/server-redeploy/generate-application.png":::
57+
58+
7. Review the workloads and select **Next**.
59+
60+
:::image type="content" source="./media/server-redeploy/generate-for-one-application.png" alt-text="The screenshot shows how to generate code for IaC application." lightbox="./media/server-redeploy/generate-for-one-application.png":::
61+
62+
8. Select **Next** again to go to the **Generate and Download** page, and review the base architecture.
63+
64+
9. The IaC generation feature currently supports only one architecture—a basic three-tier design with frontend, backend, and database layers optimized for non-critical development applications. This architecture also includes Cloud Adoption Framework (CAF)-aligned security best practices.
65+
66+
:::image type="content" source="./media/server-redeploy/supported-architecture.png" alt-text="The diagram shows the supported architecture." lightbox="./media/server-redeploy/supported-architecture.png":::
67+
68+
10. Select Generate Code after you finish reviewing the architecture. The assessment’s baseline architecture generates your IaC and automatically adds the selected workloads.
69+
70+
:::image type="content" source="./media/server-redeploy/generate-code.png" alt-text="The screenshot shows how to select Generate Code after review is complete." lightbox="./media/server-redeploy/generate-code.png":::
71+
72+
11. When the download completes, extract the ZIP file and open the folder in an IDE such as **Visual Studio Code** to explore the generated code.
73+
74+
## Deploy the IaaS application IaC
75+
76+
After generating the Infrastructure as Code (IaC) package for your assessed workloads, follow these steps to deploy the application:
77+
78+
1. The VM configuration details are saved in the vm_config.json file, which is automatically generated from your assessment data.
79+
1. To deploy the code, follow the instructions in the readme.md file included in the downloaded folder.
80+
81+
## Migrate servers using the server migration tool
82+
83+
Use the Server Migration tool in Azure Migrate to move your on-premises servers to Azure. The migration process depends on your scenario, such as:
84+
85+
- Lift-and-shift migration for physical or virtual machines.
86+
- Agentless migration for VMware environments.
87+
- Agent-based migration for Hyper-V or physical servers.
88+
89+
## Detach data disks and generate IaC configuration with Azure Migrate
90+
91+
1. Use the disk migration script in this [repository](https://github.com/Azure/AzMigrate-Hydration/tree/asr-am-support-scripts/Post%20Migration%20Customization) to detach the data disk from the migrated VM. The script generates the `disk-config.json` file, which contains the disk’s Infrastructure as Code (IaC) details.
92+
1. Follow the instructions in the readme.md file included in the downloaded folder to complete the detachment process.
93+
94+
## Merge disk IaC with application IaC
95+
96+
After generating the disk Infrastructure as Code (IaC) configuration, you need to integrate it with the Application IaC package to ensure the migrated application includes the correct disk settings.
97+
98+
### Steps to merge disk IaC
99+
100+
Follow the steps to merge the disk IaC:
101+
102+
1. **Copy disk configuration file**: Locate the `disk-config.json` file generated in step 4 and copy it into the folder that contains your Application IaC code.
103+
1. **Update Terraform variables**: Open the terraform.tfvars file in the Application IaC folder.
104+
- Uncomment the following line:
105+
- `disk_config_file = "./disk-config.json"`
106+
- This links the disk configuration to your application deployment.
107+
1. **Review integration instructions**: For detailed guidance on using the disk configuration file, refer to the readme.md file included in the Application IaC package generated in step 1. The README explains how Terraform processes the disk configuration and applies it during deployment.
108+
109+
## Re-apply the application IaC script
110+
111+
Follow the instructions in the readme.md file included with the Application IaC package to re-apply the script. This step ensures that the disk changes are incorporated and your migration is completed successfully.
112+
113+
## Next steps
114+
115+
- Learn more [Migrate VMware VMs to Azure (agentless)](tutorial-migrate-vmware.md).
116+
- Learn more [Migrate VMware vSphere VMs to Azure (agent-based)](tutorial-migrate-vmware-agent.md).

articles/migrate/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ items:
253253
href: tutorial-migrate-vmware.md
254254
- name: Agent-based migration using portal
255255
href: tutorial-migrate-vmware-agent.md
256+
- name: Redeploy servers using IaC
257+
href: server-redeploy.md
256258
- name: Support Matrix
257259
items:
258260
- name: VMware vSphere migration requirements

articles/migrate/whats-new.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ ms.custom: mvc, engagement-fy25
1818

1919
## Update (November 2025)
2020

21-
- Public preview: Azure Migrate now supports adding code insights using GitHub Copilot assessment to enhance web app assessments. This capability helps you evaluate migration readiness more accurately and get recommend migration strategy for Azure Kubernetes Service (AKS) or Azure App Service. You can add code insights by either uploading a ZIP file of reports or requesting a report through a GitHub connection. [Learn more](add-copilot-code-insights.md).
21+
- Public preview: Azure Migrate now enables **Windows Server redeployment to Azure using Infrastructure as Code (IaC)**. Generate IaC templates for assessed workloads, deploy application landing zones, and integrate disk configurations for complete, repeatable migrations—reducing manual effort and improving consistency. [Learn more](server-redeploy.md).
22+
23+
- Public preview: Azure Migrate now supports adding code insights using GitHub Copilot assessment to enhance web app assessments. This capability helps you evaluate migration readiness more accurately and get the recommended migration strategy for Azure Kubernetes Service (AKS) or Azure App Service. You can add code insights by either uploading a ZIP file of reports or requesting a report through a GitHub connection. [Learn more](add-copilot-code-insights.md).
2224

2325
- Public preview: Azure Migrate now supports Arc-based discovery, enabling you to assess on-premises servers and SQL Server instances that are already Azure Arc-enabled—without deploying additional infrastructure. This integration accelerates migration planning by leveraging existing Arc data to generate business cases and assessments within an hour. [Learn more](concepts-arc-resource-discovery.md).
2426
- The VM extension is an optional component that collects performance data from Arc-enabled servers to provide right sized recommendations in assessments and business cases. [Learn more](migrate-virtual-machine-extension-reference.md).

0 commit comments

Comments
 (0)