evaluate-azure-migration-assessment

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Evaluate Azure Migration Assessment

评估 Azure Migration Assessment

The bundled references define the ARM API contracts and assessment output contract.
随附的参考文档定义了 ARM API 契约和评估输出契约。

When to Use

适用场景

Use directly or from
run-migration-assessment
for Azure SQL Server instances.
可直接使用,也可通过
run-migration-assessment
针对 Azure SQL Server 实例使用。

Workflow

工作流

Step 1: Resolve the Resource

第 1 步:解析资源

Collect subscription, resource group, and instance name using ARM resource identification if not in context. Before calling ARM, initialize the API versions and instance endpoint from
references/command-execution.md
.
如果上下文中没有相关信息,请使用 ARM 资源标识收集订阅、资源组和实例名称。 调用 ARM 前,根据
references/command-execution.md
初始化 API 版本和实例终结点。

Step 2: Check Existing Assessment

第 2 步:检查现有评估

Always check for an existing assessment first for a general request such as "run migration assessment".
Skip this check only when the user explicitly asks to refresh, rerun, replace, or generate a new/fresh assessment, or explicitly says to ignore existing results.
Invoke
get-migration-assessment
with the resolved identifiers.
  • Existing data -> render it before asking anything else. Trigger a fresh assessment only after the user explicitly confirms.
  • Enabled with no data -> continue to Step 3.
  • Explicitly disabled -> offer ARM enablement, portal enablement, or Local assessment if the host tool allows.
对于“运行迁移评估”等常规请求,始终先检查是否存在现有评估。
仅当用户明确要求 刷新、重新运行、替换,或生成 新的/全新的评估,或者明确表示 忽略现有结果时,才跳过此检查。
使用解析出的标识符调用
get-migration-assessment
。
  • 存在数据 -> 在询问任何其他问题之前先呈现数据。只有用户明确确认后,才能触发全新评估。
  • 已启用但没有数据 -> 继续执行第 3 步。
  • 明确禁用 -> 提供通过 ARM 启用、通过 Azure 门户启用或运行 Local assessment 的选项(如果宿主工具允许)。

Step 3: Trigger and Monitor Assessment

第 3 步:触发并监控评估

Record the trigger request time and run the assessment trigger from
references/command-execution.md
when starting a fresh assessment. Continue in the same command by polling
MigrationJobOnDemand
using the configurable attempt count and interval from that reference.
  • 2xx or 409 -> continue.
  • Other 4xx/5xx -> report the error and stop.
  • InProgress
    -> continue polling in the same turn without asking the user.
  • Succeeded
    with
    lastExecutionTime
    later than the trigger request time -> continue to Step 4.
  • Succeeded
    with an older
    lastExecutionTime
    -> continue polling.
  • Failed
    -> show
    jobException
    and stop.
  • Still running after the polling window -> show the portal link and stop; the user can return later to refresh.
启动全新评估时,记录触发请求的时间,并根据
references/command-execution.md
运行评估触发操作。在同一条命令中,使用该参考文档中可配置的重试次数和间隔轮询
MigrationJobOnDemand
。
  • 2xx 或 409 -> 继续执行。
  • 其他 4xx/5xx -> 报告错误并停止。
  • InProgress
    -> 在当前轮次中继续轮询,无需询问用户。
  • Succeeded
    且
    lastExecutionTime
    晚于触发请求时间 -> 继续执行第 4 步。
  • Succeeded
    且
    lastExecutionTime
    早于触发请求时间 -> 继续轮询。
  • Failed
    -> 显示
    jobException
    并停止。
  • 轮询窗口结束后仍在运行 -> 显示门户链接并停止;用户可以稍后返回并刷新。

Step 4: Retrieve Telemetry

第 4 步:检索 Telemetry

Run
getTelemetry
, capture its
Azure-AsyncOperation
URL, and poll it using
references/command-execution.md
when retrieving a completed report. Save the full response to a temporary file.
  • Succeeded
    -> decode the response.
  • Failed
    or
    Canceled
    -> report the error.
  • Timeout -> show the portal link and stop.
运行
getTelemetry
,捕获其
Azure-AsyncOperation
URL,并在检索已完成的报告时, 根据
references/command-execution.md
对其进行轮询。将完整响应保存到临时文件。
  • Succeeded
    -> 解码响应。
  • Failed
    或
    Canceled
    -> 报告错误。
  • 超时 -> 显示门户链接并停止。

Step 5: Confirm Fresh Results

第 5 步:确认最新结果

Decode the portal's four telemetry report families:
  • Suitability
    /
    Suitability_V2
    .
  • SKURecommendation_AzureSQLVM
    /
    _V2
    .
  • SKURecommendation_AzureSQLMI
    /
    _V2
    .
  • SKURecommendation_AzureSQLDB
    /
    _V2
    .
For each family, select the report with the newer telemetry
ObservedTimestampUTC
. Use Suitability for readiness and blockers, and the three SKU reports for sizing and recommendation details.
Compare the selected Suitability
EndedOn
with the trigger request time after converting both to UTC. Also require each available selected SKU report's
ObservedTimestampUTC
to be later than the trigger request time. If any selected report is stale, repeat telemetry retrieval and decoding up to three times for report propagation. Use the job only for running, fresh success, and failure state.
Use the selected fresh telemetry reports as the source for readiness, blockers, target SKU, requirements, recommendation details, and available monetary cost fields.
解码门户中的四个 telemetry 报告族:
  • Suitability
    /
    Suitability_V2
    。
  • SKURecommendation_AzureSQLVM
    /
    _V2
    。
  • SKURecommendation_AzureSQLMI
    /
    _V2
    。
  • SKURecommendation_AzureSQLDB
    /
    _V2
    。
对于每个报告族,选择 telemetry
ObservedTimestampUTC
较新的报告。 使用 Suitability 获取就绪性和阻碍因素,使用三个 SKU 报告获取规模调整和推荐详情。
将选定的 Suitability
EndedOn
和触发请求时间都转换为 UTC 后再进行比较。此外,要求每个 可用的已选定 SKU 报告的
ObservedTimestampUTC
都晚于触发请求时间。如果任何选定报告 已过期,则最多重复三次 telemetry 检索和解码,以处理报告传播延迟。作业仅用于确定运行中、 最新成功和失败状态。
使用选定的最新 telemetry 报告作为以下信息的数据源:就绪性、阻碍因素、 目标 SKU、要求、推荐详情以及可用的货币成本字段。

Step 6: Render

第 6 步:呈现结果

Use the recommended target and available cost from the fresh telemetry selected in Step 5.
Use assessment output when rendering the combined readiness and SKU recommendation. Include the portal report link.
使用第 5 步中选定的最新 telemetry 所提供的推荐目标和可用成本。
呈现综合就绪性和 SKU 推荐时,使用评估输出。 包含门户报告链接。

Check it worked

验证是否成功

  • Positive verification: When reusing existing assessment data, confirm it was retrieved and rendered without triggering a refresh. When a fresh assessment was requested, require a successful assessment job, completed report retrieval, and selected report timestamps later than the recorded trigger time.
  • Cleanup verification: Clear the ARM token and signed operation URL, then remove the temporary run directory only after any requested report has been saved elsewhere.
  • 正向验证: 复用现有评估数据时,确认已成功检索并呈现数据,且未触发刷新。请求全新评估时,要求评估作业成功、报告检索完成,且选定报告的时间戳晚于记录的触发时间。
  • 清理验证: 清除 ARM token 和签名操作 URL,然后仅在请求的报告已另存到其他位置后,删除临时运行目录。

Notes

注意事项

  • Follow the transport rules in
    references/command-execution.md
    whenever calling ARM.
  • Run its PowerShell sections in order and execute each fenced block as one terminal command.
  • The telemetry operation URL comes from
    getTelemetry
    .
  • Treat a successful telemetry LRO as report-read completion. Use
    MigrationJobOnDemand
    for assessment-job completion.
  • Use
    EndedOn
    as the generated time.
  • Use only the recommended target and user databases in output.
  • 每次调用 ARM 时,都应遵循
    references/command-execution.md
    中的传输规则。
  • 按顺序运行其中的 PowerShell 部分,并将每个围栏代码块作为一条终端命令执行。
  • telemetry 操作 URL 来自
    getTelemetry
    。
  • 将成功的 telemetry LRO 视为报告读取完成。使用
    MigrationJobOnDemand
    判断评估作业是否完成。
  • 使用
    EndedOn
    作为生成时间。
  • 输出中仅使用推荐目标和用户数据库。

References

参考文档

  • Open
    references/command-execution.md
    before triggering, polling, or retrieving an assessment.
  • ARM resource identification
  • Assessment output
  • 触发、轮询或检索评估前,打开
    references/command-execution.md
    。
  • ARM 资源标识
  • 评估输出