Azure Migration 1/4: Using Azure Migrate discovery and assessment function

### Japanese version is here → [Click](https://qiita.com/SatoshiKaneshiro/items/319180e3f1141fcde113)

Hi, This series introduces a method for migrating PCs using an Azure-native tool called Azure Migrate. You can migrate physical machines and VMs on Hyper-V and VMware to the Azure environment. Especially in cases where there are many migration terminals, it is more convenient.

Also, **VMware's VMs** have two migration options: **"agentless"** and **"agent-based"**. The former allows you to migrate more easily without installing an agent (application) on the VMware side's VM. 

This is the first article about migrating a physical machine in an on-premises (home environment) to an Azure VM on IaaS using the Azure Migrate tool. Then I will write three other articles about the replication and migration steps. 

So, we will eventually have four articles about Azure Migrate.

**Azure Migration 1/4: Using Azure Migrate discovery and assessment function (this article)**
Azure Migration 2/4: [Deploying a Replication Appliance on a physical Windows server](https://qiita.com/SatoshiKaneshiro/items/9d5f3d8217d0ad3612a8) (Published)
Azure Migration 3/4: Replicating and migrating a physical PC to Azure VM
Azure Migration 4/4: Clean up about replication appliance-relevant apps and Azure Migrate Project Resources

OK, now let us get started.

---

## ■ **What is Azure Migrate?**
Azure Migrate is a migration tool provided by Microsoft Azure, and its functions are broadly divided into two categories: **assessment** and **migration**.

**Assessment** is a function that evaluates the feasibility of migrating the target machines to Azure, sizing the post-migration VMs, estimating costs, and evaluating dependencies between migration machines before migration.

**Migration** is a function that consistently performs tasks from detecting the target machines to deploying them to Azure VM. By the way, the results of the VM sizing generated by assessment can be used when deploying the VMs, so it is very convenient as it eliminates the need to manually set the VM's specs for each machine during migration. Of course, it is possible to execute migration without performing an assessment.

===========================
**Azure Migrate Official Documentation**

https://learn.microsoft.com/en-us/azure/migrate/

===========================


Now, let's get started right away! 

Firstly, here are the prerequisites and recommended preparations before operating.

## ■ Prerequisites
This article is about migrating a physical machine（in my home environment）to Azure VM (IaaS)
Communication between the home environment and Azure is possible. 
Only Azure Migrate will be used.
Communication for migration will be carried out through Azure PrivateEndpoint (APE).
Communication between Azure Migrate Appliance Server (AMA) and the target physical machine is possible.
All operations on the Azure side will be performed on the Azure Portal.

## ■ Network Architecture
The connection between the home environment and Azure is through an S2S VPN, and the Azure side is configured in a hub-spoke network topology. 

Communication between the home environment and Azure is via an AFW (Azure Firewall). The Azure Migrate tool automatically creates the APE, Key vault, Storage Account, and Private DNS Zone used during migration and places them in the SpokeVNET. ※ Each VNET, Subnet, AFW, and VPN Gateway must be created and communication verified beforehand. (The creation procedure for each resource is omitted here.)
※ The red lines indicate the communication route.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/4a9b41e3-fdd4-611a-bb4c-25a51fdf823f.png)
|:-:|

## ■ Communication Image
The communication ports and communication data between the physical machine, Azure Migrate Appliance (AMA), and Azure Migrate Portal are as follows:
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3e108c4d-6969-325f-dd37-79b98ca81789.png)
|:-:|


## ■ Recommended Preparations
**1.Create a resource group for Migrate-related resources.** <br>※ It's to delete related resources quickly after migration.
**2.Make a naming rule.** <br>※ It is to recognize migration-related resources easily.

---
From here, we will explain the procedure for assessing the target machines for whether they could be migrated to Azure properly. Processes will be broken down into steps.

### 【Step1】- Create an Azure Migrate Project
#### 1. Open the main screen of Azure Migrate on the Azure portal and create a project.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/5434152b-ca74-5db8-b055-9e4e8d98ceab.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/57108084-0fca-9341-7b12-7eaa45183b1a.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/cdaad039-6729-4c92-66a5-5dd247d2d563.png)
|:-:|

#### 2． Enter the necessary information, and click "Create."
- Select the resource group created in advance or create a new one here.
- Fill in the input fields under "Advanced." 
-- Connect with Private Endpoint
*Note: Azure Migrate supports both Public and Private Endpoints. However, most companies connect their on-premises environment and Azure using S2S VPN or ExpressRoute. Therefore, a connection via Private Endpoint without going through the Internet will be more helpful, and we will use it.*
-- Regarding "disable public network access."
*Note: This option appears when you connect via a Private Endpoint, and it is an option to turn off connections from the Internet. Azure Migrate supports third-party migration tools, which may need Internet access, so it might be better to select "No." However, since we are using only Azure Migrate this time and have already connected the two environments via S2S VPN, let's try "Yes." -- Select the VNET and Subnet that were created in advance.*

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/c6cfaf12-e2ad-eb49-344a-c84ae0b1ec49.png)
|:-:|

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/56fb8b0a-7f8d-078b-7dee-24d334201f89.png)
|:-:|

The Azure Migrate home screen appears as follows after creation.
- Since it is possible to create multiple projects, you can switch between them by clicking on the project name and selecting from the drop-down menu.
- As you can see, the categories are broadly divided into two: "Assessment" (evaluation) and "Migration" (migration) 

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/aa66bdc1-0c27-3e83-0417-dee5d015106c.png)
|:-:|

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b01c1a80-e96e-bc24-1e20-8ae8e4ed3cbc.png)
|:-:|

---

### 【Step2】- Installing *Azure Migrate Appliance* (AMA) for Detecting Physical Machines

===========================
**Official Documentation for Azure Migrate Appliance**

https://learn.microsoft.com/en-us/azure/migrate/migrate-appliance#appliance---physical

===========================

Installing AMA on an on-premises server is necessary to act as an intermediary to relay information between the target machines and Azure Migrate. We will install the AMA from now on.

#### 1. Click on "Discover" in Azure Migrate's "Assessment Tool."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3aa87c56-aa02-9dad-1d05-dc56f7bea47f.png)
|:-:|

↓
-You can also upload CSV files besides deploying AMA.
-Select the type of server to install AMA on, but choose "Physical" as we are migrating physical machines.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/7ebdc2ac-da60-84b9-5511-bfce13b7e720.png)
|:-:|

##### <1. Generate a Project Key>
Generate a project key that needs to be entered when installing AMA to link it with the Azure Migrate project.
- Enter the AMA name.
- Click "Generate Key" (It takes some time to generate: about 10 minutes).
Confirm that the project key has been generated.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3096821f-e045-1784-c844-58e7bb865a7e.png)
|:-:|

<font color= "Red">*Note: Multiple AMAs can be created, but each requires a unique project key.*</font>

You can generate a new project key once you close the Discover screen and reopen it. On the other hand, you can check the generated project key by clicking "Manage existing appliances" next to "Generate Key."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/72257751-f54b-b441-6a2d-4b3411484a57.png)
|:-:|


##### <2. Download the AMA Script>
Download the AMA script.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/a8efc24b-967c-872f-30ef-bb1635849ec8.png)
|:-:|

↓ 
Since the size is about 500MB, it might be better to download it on the server where you will install AMA.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/fd715f52-b4ae-4831-88cf-7bbee601d987.png)
|:-:|

<font color="Red">*Note: All actions in Step2 and Step3 will be done on the server where AMA is installed.*</font>

##### <3. Install the Azure Migrate Appliance (AMA)>
Check here for the prerequisites and other details of the AMA server to install the AMA.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6d832fd4-e395-dd0e-e432-7fd1ee244aeb.png)
|:-:|

↓ 
Unzip the ZIP file and open the Readme file in the folder.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6d832fd4-e395-dd0e-e432-7fd1ee244aeb.png)
|:-:|

↓ 
Start Powershell in administrator mode and execute the command described in #4 of Readme.

The script to be executed is named "AzureMigrateInstaller.ps1", but you'll need to put the script's full path in Powershell to run it. <br>※If the folder path is not set in the environment variables, the path will not be found.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/aad25784-db4d-7773-b466-f91226472c34.png)
|:-:|

↓
If there has already been another AMA on the same server, the part in red below will appear, but pressing "Y" will automatically delete the previous AMA.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/09c2c693-1df8-f82d-9381-689b5eacf9e1.png)
|:-:|

↓
Next, answer the questions in sequence.
- Since this is a migration of physical machines, select 3. Physical or other (AWS, GCP, Xen, etc.).
- Since this is neither the US government nor China, select 1. Azure Public.
- Since we connect via Private Endpoint, choose 2. Set up an appliance for a Migrate project created with private endpoint connectivity.<br> ※In the case of connection via a Private Endpoint, it is a prerequisite that the AMA server is placed in a network environment where the Private Endpoint is reachable.

Confirm all the inputs, and if everything is fine, answer "Y" to the last question, and the installation will begin.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/7aa1ca79-b241-f837-f146-d6cf516f845a.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/1c798e64-a41e-4a60-9f6c-4318865e89f0.png)
|:-:|

↓
Installation complete (The message "You may use..." will appear at the end)
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6f03bee7-4417-6d9a-24ac-312bd35a5ebf.png)
|:-:|

---

### 【Step3】- Registering DNS Information of Private Endpoint
When connecting AMA to Azure Migrate using a Private Endpoint, it's necessary to resolve the FQDN of the Private Endpoint. You can download this information on Azure Migrate. Place the downloaded DNS information in the DNS server or AMA server's hosts file.

Here's how to add it to the hosts file.
<font color="Red"> *Note: If you do not register the DNS information correctly, an error will occur in Step 4, preventing a proper connection with the Private Endpoint. Be sure to register it.*</font>

##### 1. Click on "Assessment tools" and then "Overview" (Summary) in Azure Migrate.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/8b5ada4b-18ab-3bcf-05a8-a17bc1eacd63.png)
|:-:|

##### 2. Click on "Properties" in the side menu.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/aecca81f-b0ba-cb66-b8c8-49cc0e129475.png)
|:-:|

##### 3. Scroll down and click "Download DNS settings" to download.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/bd89c5db-f00d-9d80-425e-42d1a83029b1.png)
|:-:|

##### 4. Add the downloaded DNS information (txt) to the hosts file. The hosts file is located in "C:\Windows\System32\drivers\etc."
*※Since the hosts file is read-only, copy it to another location first, update it, and then overwrite the original file.*
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/ac86fe25-16fc-7180-7283-88839826d523.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3e18c8a4-318a-7465-2f5c-bac532392e11.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/d8c65dcb-b2eb-6194-dc2b-fc061b65c4e4.png)
|:-:|

##### 5. Restart the AMA server.
---

### 【Step4】- Regist the AMA Server to the Azure Migrate.

##### 1. After installing AMA, double-click the "Azure Migrate Appliance Configuration Manager" on the AMA server's desktop.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/703664f9-fca3-f321-0be9-618b080f5235.png)
|:-:|

↓ 
The following screen will be displayed.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6338977f-a47e-386f-dfd9-55a6381174d5.png)
|:-:|

##### 2. Scroll down a little and enter the project key.
*(Do you still remember? (Laughs) The project key... It seems familiar... It was generated in Step 2)*
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/aab3fa0b-398d-0ff2-743f-02700b401214.png)
|:-:|

↓ 
Once the project key is entered and "Verify" is clicked, the project key will be authenticated. A comment that says "Azure Migrate project key has been verified" will be displayed if the verification is successful.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/ee98c118-a12c-1110-f4be-ce4f71579cf7.png)
|:-:|

##### 3. Check the automatic update status of AMA.
Once the project key is verified, AMA's status check will be performed automatically. This time, the result was shown as unusable, but clicking on the blue text "Show appliance services" confirmed that all service versions are up to date. There are "Stopped" agents, but this is not a problem for the initial startup. After all subsequent registrations are completed, it will become "Running."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/37bf3b5c-f0ba-dcb6-ca38-d5a2311e9a45.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/4db4c342-6143-941c-6385-cf05ab3dfa04.png)
|:-:|

##### 4. Log in to Azure.
Click the login button, and log in to Azure, as shown below.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/93966585-8b85-6207-ca5d-c27aecc2f84f.png)
|:-:|

↓ 
If the following dialog is displayed, click "Copy code and log in" to proceed.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/5b68503f-8b81-802a-5008-51256c643f3c.png)
|:-:|

↓ 
For some reason, you will be asked to enter the code displayed earlier (though it doesn't seem to make much sense), but paste it and click "Next."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/2c053a97-51c8-d8dd-0e4f-a27abda6e2d3.png)
|:-:|

↓ 
Select or enter the account to log into Azure. The necessary roles for this account are described in the official document below.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/5e319966-36f7-3d13-6873-5d9e7c5d37fb.png)
|:-:|

===========================

https://learn.microsoft.com/en-us/azure/migrate/tutorial-discover-physical

===========================

##### We'll use an account with the <font color='red'>*"Subscription Owner"*</font> role this time.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/50dee28b-4947-8a7f-07dd-e1fa0d320da6.png)
|:-:|

↓
 After logging in, you can close the tab if the following message is displayed.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/8c5d596b-bbf1-c4f6-241e-b3a51e363055.png)
|:-:|

↓
When you return to the appliance screen, a warning dialog about setting up DNS name resolution accurately will be displayed if you select a connection with Private Endpoint.

---

<font color="Red">*Note: If the correspondence of the name resolution of the Private Endpoint explained in Step 3 is not completed, the following message will be displayed. Click "Error details" to check the error content.*
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6a560e09-0af7-13a8-046a-67ac8fedca82.png)
|:-:|

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/983dcc42-4e39-e07a-0f72-9cb3f2e73b0a.png)
|:-:|

---

↓
Once the connection is completed, the following message will be displayed.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/25143b1f-b9ed-ac97-55b8-cd9ec2a11977.png)
|:-:|

<font color="Red"> *Note: If there are changes to the information registered up to Step 4, you need to click "Re-run prerequisites" below to update.* </font>
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/888294ee-c0e7-d349-e54d-56347cd5a4a1.png)
|:-:|

You have now registered the AMA server's information with Azure Migrate. From here, you'll follow the procedure to register the physical machines targeted for migration with Azure Migrate via the AMA server.

---

### 【Step5】- Regist the Physical Machine Credentials (Login information)

Next, we must register **account information** to log into the physical machine and **connection information** to the physical machine.

We need to navigate to the "2. Credentials and Detection Source Management" on the screen below.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/2f59408a-154a-affb-042d-ccee97ed301b.png)
|:-:|

##### 1. Click the "Add Credentials" button.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3220fa67-c027-b17f-c683-222169c3c903.png)
|:-:|

##### 2. Enter the physical machine credentials (login information) and click "Save."
*Note: This process assumes the migration of Windows Server. If there are multiple target machines, you must register the credentials for each type of machine. A single registration will be enough if the same credentials are being used.*

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/5873a964-cbac-085a-c13e-c8cc26e7466c.png)
|:-:|

##### 3. The registered information will be displayed as shown below.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/bac7db52-bd63-f0df-cf12-5218c10b497d.png)
|:-:|

---

### 【Step6】- Regist the Physical Machine Connection Information

We will register the connection information of the physical machine.

##### 1. Click on "Add Detection Source."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/108f6934-91b9-3f00-1b4d-dd5bfed5844a.png)
|:-:|

##### 2. Choose the method of addition, and input the connection information.
*Note: The methods for addition are "Add a Single Item," "Add Multiple Items," or "CSV Import." If there are many target machines, filling in the required information in the specified CSV format and uploading it might be more accessible. In this case, as it's only one machine, select "Add a Single Item."*
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/1c4cadc1-8e50-5651-8932-1a62b06d8bdd.png)
|:-:|

#### ＜Add a Single Item＞ 
Choose the machine type and IP (or FQDN), select the credentials you previously registered, and click "Save" at the end.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3f00ffc5-00a5-b4d8-4e21-ea4d0c22d9d2.png)
|:-:|

<font color="Red">*NOTE: At this point, communication occurs between the AMA server and the physical machine, so don't forget to open port 5985.*</font>

If communication through the port is unavailable or the credentials are incorrect, or for any other reason, verification may fail, as shown below. In this case, click "Validation failed" to identify the reason for failure. Click "Reverify" to conduct the verification again.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/531fb5e9-f313-64c9-bda9-e295eef56bf0.png)
|:-:|

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/ebd52358-ae3a-b870-98d0-351d40aed2e9.png)
|:-:|

<font color="Red">*Note: Details of two errors that occurred during actual work and the solutions are mentioned at the end of this article.*</font>

**↓ If verification is completed without issues, it will be displayed below.**
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/185e4271-f85b-c3d3-996d-7a4d81f251a3.png)
|:-:|

##### 3. About the Web Apps or SQL Server in the physical machine
If the physical machine has Web Apps or SQL Server installed, these functions can be detected. However, if these features are absent, uncheck the option for "These features... this can be changed later." (In this case, these features are not on the physical machine, so turn OFF.)

---

### 【Step7】- Detect Physical Machines

The machine's credentials and detailed information (IP address and verification of login credentials) have been registered. Next, we will use this information to extract the information of the target machine and register it with Azure Migrate.

##### 1. Click "Start Detection."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/4be86201-7a13-d9f5-2a19-cfaec4ddc5c9.png)
|:-:|

↓ 
If you use a Private Endpoint, the following message will be displayed.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6bce9f41-a8b0-1c6f-97ee-4f24499ab2e4.png)
|:-:|

↓ 
The number of target machines and the time required per machine are mentioned. Still, the required time may vary depending on factors such as the internet environment and the specifications of the physical machine. Most of the time, it takes several minutes.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/a4f8dab5-f45f-2dba-e10b-a453cb7928e5.png)
|:-:|

↓ 
I waited about 5 minutes, and the detection was completed when the following message was displayed.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/95fc1b50-cd2a-ccd7-fe8e-97a064fe849e.png)
|:-:|

↓
The registration section's status has been set to "Discovery Initiated."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/bfd6f53e-4f7a-198e-be93-84ef9a994968.png)
|:-:|

---

### 【Step8】- Verification of Physical Machine Registration Results

The work on the AMA server is done for now. Next, we move to Azure Migrate on the Azure Portal to check the information of the registered machines.

##### 1. Access the Azure Migrate Portal.
Here is an overview of the entire home screen of the Azure Migrate Portal project.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/1586cdb7-f5c5-2bd7-3e4c-0c135f5f3463.png)
|:-:|

↓
The "Detected Servers" and the Windows OS distribution in the assessment tool section are set to "1." Since there is only one evaluation appliance (AMA server), it is set to "1."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/750f8ad7-e143-32d6-8b33-b69538748f9b.png)
|:-:|

##### 2. Check the detected physical machine.
Click on "1" under "Detected Servers" and check the information of the registered physical machine in the list of detected servers.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/76ea5c30-79dc-cc9d-8a3a-acd9c1ed116e.png)
|:-:|

↓
As you can see, the status of some items is "Detecting" and "Verification in Progress," so please do not close the AMA and leave the AMA server and the physical machine powered on.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/a3b109ba-6c21-d21f-0161-72f09f7c3dda.png)
|:-:|

---

### 【Step9】- About "Business Case" and "Dependency Analysis"
#### ＜Business Case＞

"Building a Business Case" is a convenient tool for managing and progressing migration projects of a specific scale. Still, it will be omitted this time as it is a review of the assessment procedure.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b2ccbd10-7e37-03b0-f193-52cb58cd1cb4.png)
|:-:|

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/91a08702-eadf-c780-51f5-9d1560179f4c.png)
|:-:|

#### ＜Dependency Analysis＞
In most migration cases, multiple target machines exist, and the dependencies between servers may need to be fully understood. This feature allows you to analyze the dependencies between registered target machines.

===========================

https://learn.microsoft.com/en-us/azure/migrate/concepts-dependency-visualization#analysis-type

===========================

<font color="Red">*Note: This analysis is limited to the range that Azure Migrate can detect, so please cross-check with the dependency information that administrators, users, and other stakeholders have!*</font>

After registering the evaluation target machine for the first time, dependency analysis is performed automatically, so if you click "Add Servers" in "Dependency Analysis," the selection of target servers is inactive.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/16b81423-112a-cf44-0f54-ee4355818b69.png)
|:-:|

↓
Select the AMA server from the "Select Appliance" drop-down menu if there are multiple AMA servers. Also, depending on the number of chosen machines, dependency analysis may take time.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/ef49f0e6-699a-10a7-fbb2-4f936dad92aa.png)
|:-:|

---

### 【Step10】 - Evaluation

"Evaluation" is not only for Azure VM, but it's also possible to evaluate the migration cases for Azure SQL, App Server, or AVS (Azure VMware Solution). Since migrating from on-premises to VM, we'll select "Azure VM."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/adcb8529-107d-fd6a-820e-68865b711c2a.png)
|:-:|

##### 1. Select the type of evaluation and the detection source.
As mentioned before, while you can evaluate for Azure VM, Azure SQL, App Server, or AVS (Azure VMware Solution), we'll select "Azure VM" here.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/c5df7efc-fd73-3a69-f4d6-11750673f2ab.png)
|:-:|

↓
For "Detection Source," you can select machines detected directly from the appliance or those imported directly. In this case, since we registered via the AMA server, we'll choose the former.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/a4a7dc14-42b2-94d5-0d92-29151f9124f9.png)
|:-:|

##### 2. Set up the evaluation.
After migrating the target machine to Azure, this step involves setting configurations for evaluating things like VM specifications and costs. You can change the conditions for the same machine and assess it in different scenarios multiple times.

Click "Edit".
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/d92ef0bb-0400-574d-a810-83cb5e7034aa.png)
|:-:|

↓
Set the conditions.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/9be67ae4-40a8-2cd7-7b8e-82350799e1ba.png)
|:-:|

↓
Let's explain some of the items here:

- **Type of Storage**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/4ef007fb-0f37-80ea-5c84-1b2fda5c53af.png)
|:-|
It refers to the type of disk used in Azure VM. There are three choices. You can check if you've decided on one from the beginning. Controlling all three is okay if you're leaving it up for evaluation.

- **Saving Options**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/81a55b6e-3374-ebcf-8297-6536f265dc9e.png)
|:-|
This might be a bit difficult to understand for those unfamiliar with Azure. The saving option refers to the so-called Reserved Instance. You can get a discount by reserving the right to use it for 1 or 3 years. If you don't have such plans, "None" is okay.

===========================

https://azure.microsoft.com/en-us/pricing/reserved-vm-instances/

===========================

- **VM Size**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/df9a3912-0a47-867a-c150-14245fba9228.png)
|:-|
It's about whether you want to evaluate the Azure VM size based on performance or purely on on-premises specifications. You can find the difference between the two in the following official MS document. 

===========================

https://learn.microsoft.com/en-us/azure/migrate/concepts-assessment-calculation#types-of-assessments

===========================

Also, hovering over the "!" symbol next to each item name will display its description.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/da1fda17-a71e-355d-6303-1c0f5a83e9cd.png)
|:-:|

- **Offer or License Program**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/5bc60a69-5f1a-2000-17de-9d83a75a8219.png)
|:-|
If your Azure VM subscription is tied to an EA agreement, select "EA agreement."

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/c4a4a576-f2a4-beef-0c50-e1ac49dff73e.png)
|:-|
For subscriptions not tied to an EA agreement, choose "Pay-as-you-go" or "Pay-as-you-go Dev/Test."

- **Azure Hybrid Benefit**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/7a197bf3-7789-03a7-f01e-a44e2b433768.png)
|:-|
If applying a valid Windows Server license to an Azure VM, set this item to "Yes" (This can give significant discounts!).

↓
For example, set as shown below and click "Save."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3c51e21f-fb1b-5cc4-b43d-0ddc64db499d.png)
|:-:|

##### 3. Perform the evaluation.

Click "Select Server to Evaluate."

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/64e04454-3df7-84e0-2279-f1010e198e60.png)
|:-:|

↓
Enter the required information and click "Review and Create Evaluation."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/1bed3aee-928c-44bb-d3a9-767472207b2d.png)
|:-:|

↓
Click "Create Evaluation".
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/d548b579-0e9a-ca0b-39d8-c8cff034f886.png)
|:-:|

↓
A message, as shown below, will appear in "Notifications." It may take some time for the evaluation results to be ready.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/e13ef4b9-a7d2-3d69-7dfb-13b4404e883c.png)
|:-:|

↓ 
Click "Update to Latest Information" in Azure Migrate.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3bd130e4-092d-32df-8a03-cf0e8adcdc65.png)
|:-:|

↓
Once the evaluation is complete, as shown below, the number in the "Evaluation" category will become "1". The total count of evaluation results will be displayed if multiple evaluations have been conducted.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/0f15abbf-a0fc-22c0-78e2-093b5a069736.png)
|:-:|

##### 4. Confirm the evaluation results.
Click on the total number in the "Evaluation" category or the number for Azure VM to go to the list of evaluation results. You can confirm that the evaluation you created earlier has been output.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/1acad04b-c4ba-ee9a-2dce-f01c39a37344.png)
|:-:|

The item on the far right, "Confidence Rating," is currently not applicable for evaluating physical servers, so it displays "Not Applicable." Details about the confidence rating and how to improve it are provided in the following official documentation:

===========================

https://learn.microsoft.com/en-us/azure/migrate/concepts-assessment-calculation#confidence-ratings-performance-based

===========================

↓
Click on the evaluation result to display the result.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/ec9afadc-4351-d836-2c6b-a3b1ab22bf3c.png)
|:-|
Firstly, in the "Overview" section, three graphs show the compatibility with Azure (whether migration is possible), the monthly amount for the VM after migration, and the savings from utilizing Azure Hybrid Benefit. By clicking each part, more details will be revealed.<br><br>The monthly cost of the VM includes the monthly cost of storage and computing. The costs are displayed separately because, if you stop the VM, you won't incur costs for the CPU, memory, etc., on a pay-as-you-go basis, but the pay-as-you-go charge for storage always occurs. In other words, if the VM is fully operational for one month, the monthly cost of the VM will be incurred. Still, even if it is fully non-operational for a month, the monthly storage cost will be incurred, so the amounts are listed separately to clarify.

↓
You can check the details of the evaluation result of Azure VM in the side menu "Azure Compatibility." There is also information on the VM's specifications, prerequisites for migration (conditional), recommended migration tools, and boot methods.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/3b168972-9e96-adab-373d-f1d6c9c80e65.png)
|:-:|

↓
You can also check the details of the monthly costs in the side menu "Cost Details." What you should be careful about is that the computing cost in the graph is the pure monthly cost without the Azure Hybrid Benefit. The red frame in the bottom right shows the monthly cost after applying for the Azure Hybrid Benefit.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/79764097-bfe7-8f4f-e5c5-474c7786919f.png)
|:-:|

↓ 
Evaluation results can be exported. Also, you can change the conditions in "Settings" and recalculate by clicking "Recalculate."

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/efb436d2-8c2f-2f6f-08fe-1b621a689ffa.png)
|:-:|

---

###  Summary

This article summarized registering and evaluating physical machines in the on-premises environment to Azure Migrate. How was it?

Although there are quite a few steps to set up initially, once you have set up an AMA server, a single AMA server can support migrating up to 1000 machines, so it might be easier than manually migrating 1000 servers.

**Next time, I'd like to summarize the actual migration procedure.**

---
---

##  Reference

###  Troubleshooting Errors That Occurred During Machine Authentication for Migration

#### ■ Errors Related to WinRM (Windows Resource Management) Being Unreachable
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/97000e58-0229-8849-ef71-aac245394495.png)
|:-|

##### WinRM is required for the authentication of the machine targeted for migration. The cause of this error can be broadly considered in the following three ways:
- The user selected as the credentials may not belong to the migration target machine's user group, "Remote Management Users," or that group may not even exist.
- WinRM may not be running at all.
- Communication with WinRM (port:5985) may be denied due to firewall or proxy server settings.


### Now, let's explain the remedies for each cause.

- #### Register the user to the user group "Remote Management Users."

1). Right-click the Windows icon on the migration target machine and click "Computer Management."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/c36f522c-6705-450f-7058-2fb948a50cf7.png)
|:-:|

2). Go to "Local Users and Groups" → "Groups" in the side menu. 
→ Check for the existence of "Remote Management Users." If not, create a new group.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/546996bb-c3bb-23b4-c04b-8ab678e7bdcc.png)
|:-:|

3). Enter the group and check if the user selected as credentials belongs to the group. If not, add it.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/546996bb-c3bb-23b4-c04b-8ab678e7bdcc.png)
|:-:|

- #### Start WinRM
WinRM can be set to either start or not start at machine boot. Some machines may be configured not to start WinRM at boot, so check the settings and turn on automatic startup at boot.

1). Press the Win key + R on the migration target machine and execute the "services.msc command."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/558caa7b-b8b9-e90f-c78e-89bf1cb0b495.png)
|:-:|

2). Check the status of "Windows Remote Management" from the list of services. If it is not "Running," start it manually.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b0538758-aee6-3f8d-d671-e2fde05ca6b2.png)
|:-:|

↓
Click "Start."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/f71b1368-bd01-8658-b457-62f9753e31b1.png)
|:-:|

↓ 
Confirm that the service status is "Running."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/f71b1368-bd01-8658-b457-62f9753e31b1.png)
|:-:|

- #### Open the WinRM communication port 5985.

If you use a firewall or proxy, you must allow communication on port 5985. Here, we explain the setting to open this port using Windows Defender. If using third-party products, please follow the procedures specific to that product.

1). Click the Win key on the migration target machine and search for "fire." Select "Check Firewall Status" from the results and check the "Connected" network (remember it 😆). In the example below, it's a "Public Network."
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/31536898-8927-bfb2-2d79-ec8aaa5684cf.png)
|:-:|

2). Click the Win key on the migration target machine and search for "security." Select "Enhanced Windows Defender Firewall" from the results.
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/cd6eb8fe-dd81-2ca4-95bb-c6db6ab5a769.png)
|:-:|

3). In the "Inbound Rules" on the side menu, identify "Windows Remote Management (HTTP Inbound)." There will be two items with the same name; enable the one for the network you remembered in #1 (in this case, Public Network).
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b796af4b-4175-ef8f-dd69-56db1a3221d0.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/40f64fd8-5133-4d76-79ac-249ea320991e.png)
|:-:|

↓
|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/e0ab907f-a2cf-1f36-4b62-cd34c5952052.png)
|:-:|

---

#### ■ Error: "The WMI service returned an 'access denied' error."

This error is also mentioned in the MS official documentation for troubleshooting. Please refer to the document for details:

https://learn.microsoft.com/en-us/azure/migrate/troubleshoot-appliance#access-is-denied-error-occurs-when-you-connect-to-physical-servers-during-validation



#### *The end.*