后端与接口
跨云工作负载迁移到 Azure 时:先评估再转换代码与配置…
适用于将 AWS Lambda、Elastic Beanstalk、Heroku、App Engine、Fargate、Kubernetes、Cloud Run、Spring Boot 等工作负载迁移到 Azure Functions、App Service 或 Container Apps 的场景。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 59/100 ×0.15
适用场景
跨云工作负载迁移到 Azure 时:先评特定
解决思路
- 按阶段顺序执行迁移,不要跳过任何阶段。
- 在任何代码迁移之前,先生成评估报告。
- 加载对应场景的参考文档,并遵循该文档中的规则。
- 使用 `mcp_azure_mcp_get_azure_bestpractices` 和 `mcp_azure_mcp_documentation` MCP 工具。
- 目标服务使用最新受支持的运行时。
- 破坏性操作前必须调用 `ask_user`;参考 `references/services/functions/global-rules.md` 和 `references/services/app-service/global-rules.md`。
- 在长时间运行操作(部署、镜像推送)期间向用户报告进度,提供资源级状态更新,参见 `references/workflow-details.md`。
- 审计应用代码中的服务发现:Kubernetes DNS 名称(如 `http://order-service:3001`)在 Container Apps 中无法解析;评估期间扫描源码中 HTTP 客户端硬编码的 hostname/port,并标记为需通过环境变量注入 URL。
- 若从 AWS Lambda 迁移到 Azure Functions,加载 `references/services/functions/lambda-to-functions.md`,并参考 `references/services/functions/assessment.md` 评估、`references/services/functions/code-migration.md` 迁移代码。
- 若从 AWS Elastic Beanstalk 迁移到 Azure App Service,加载 `references/services/app-service/beanstalk-to-app-service.md`。
- 若从 Heroku 迁移到 Azure App Service,加载 `references/services/app-service/heroku-to-app-service.md`。
- 若从 Google App Engine 迁移到 Azure App Service,加载 `references/services/app-service/app-engine-to-app-service.md`。
- 若从 AWS Fargate (ECS) 迁移到 Azure Container Apps,加载 `references/services/container-apps/fargate-to-container-apps.md`,并参考 `references/services/container-apps/fargate-assessment-guide.md` 评估、`references/services/container-apps/fargate-deployment-guide.md` 部署。
- 若从 Kubernetes (GKE/EKS/Self-hosted) 迁移到 Azure Container Apps,加载 `references/services/container-apps/k8s-to-container-apps.md`。
- 若从 GCP Cloud Run 迁移到 Azure Container Apps,加载 `references/services/container-apps/cloudrun-to-container-apps.md`。
- 若从 Spring Boot (Azure Spring Apps/VMs) 迁移到 Azure Container Apps,加载 `references/services/container-apps/spring-apps-to-aca.md`。
- 若无匹配迁移场景,使用 `mcp_azure_mcp_documentation` 和 `mcp_azure_mcp_get_azure_bestpractices` 工具。
- 所有输出放到工作区根目录下的 `<workspace-root-basename>-azure/`,其中 `<workspace-root-basename>` 是顶层工作区目录本身的名称,不是其子目录;绝不修改源目录。
- 步骤 1:在工作区根目录创建 `<workspace-root-basename>-azure/`。
- 步骤 2:评估——分析源、映射服务,并按场景特定评估指南生成报告,参考 `references/services/functions/assessment.md` 或 `references/services/app-service/assessment.md`。
- 步骤 3:迁移——按场景特定迁移指南转换代码/配置,参考 `references/services/functions/code-migration.md` 或 `references/services/app-service/code-migration.md`。
- 步骤 4:询问用户——“Migration complete. Test locally or deploy to Azure?”。
- 步骤 5:移交给 `azure-prepare` 处理基础设施、测试和部署。
- 在 `migration-status.md` 中跟踪进度,参见 `references/workflow-details.md`。
适用边界 · 注意事项
- 不适用于迁移到非 Azure 云、本地环境或其他非 Azure 平台。
- 没有 Azure MCP 工具、`azure-prepare`、Azure 订阅或所需权限时,无法完整执行。
- 没有匹配迁移场景且无法使用 MCP 文档/最佳实践工具时,不应强行套用本技能。