跳转到正文
报告库
用途分类 / 开发辅助

Azure Upgrade Skill 安全审计

作者说它能做什么(原文)

Assess and upgrade Azure workloads between plans, tiers, or SKUs, or modernize Azure SDK dependencies in source code. WHEN: upgrade Consumption to Flex Consumption, upgrade Azure Functions plan, change hosting plan, function app SKU, migrate App Service to Container Apps, modernize legacy Azure Java SDKs (com.microsoft.azure to com.azure), migrate Azure Cache for Redis (ACR/ACRE) to Azure Managed

第三方安全检查结论

先别安装或运行

已检查文件
31
发现的风险
6
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 3 项风险
高风险

脚本会自动赋予项目自带包装器执行权限并运行它

原文依据:2 处
发现了什么

脚本优先采用项目目录中的 mvnw;即使它原本不可执行,也会 chmod 后作为子进程运行。包装器属于待迁移仓库内容,并非此 Skill 中已审计的代码。

为什么需要注意

若仓库或其包装器已被篡改,运行迁移可在用户权限下执行任意命令,读取本地凭据、修改文件或联系外部服务。

在用户运行 BOM 自动化脚本且项目含 mvnw 时,脚本会优先选择仓库内的包装器;即使它没有执行权限,也会为用户、组和其他人添加执行位,随后作为子进程运行。因为包装器来自待迁移项目,它可能执行该仓库控制的代码并下载组件。用户可要求先审查包装器及其配置、禁止 chmod,并通过 --mvn 指定可信 Maven。

references/languages/java/scripts/upgrade_bom.py:143来自代码打开原文件
    else:        wrapper = os.path.join(project_dir, "mvnw")        if os.path.isfile(wrapper):            if not os.access(wrapper, os.X_OK):                # Wrapper exists but isn't executable (common after fresh clones                # on filesystems that don't preserve the +x bit). Try to fix it.                try:                    mode = os.stat(wrapper).st_mode                    os.chmod(wrapper, mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)                    print(f"[upgrade_bom] Added executable bit to {wrapper}.")                except OSError as exc:                    print(                        f"[upgrade_bom] WARNING: mvnw exists at {wrapper} but is not "                        f"executable and chmod failed ({exc}); falling back to 'mvn'.",                        file=sys.stderr,                    )                    return "mvn"            if os.access(wrapper, os.X_OK):                return wrapper    return "mvn"
查看另外 1 个位置
references/languages/java/scripts/upgrade_bom.py:185来自代码打开原文件
def _run_maven_recipe(mvn_cmd: str, project_dir: str, recipe: str, options: str) -> int:    """Run an OpenRewrite recipe via the rewrite-maven-plugin."""    cmd = [        mvn_cmd, "-U",        f"{MVN_REWRITE_PLUGIN}:run",        f"-Drewrite.recipeArtifactCoordinates={MVN_REWRITE_ARTIFACT_COORDS}",        f"-Drewrite.activeRecipes={recipe}",        f"-Drewrite.options={options}",    ]    print(f"[upgrade_bom] Running: {' '.join(cmd)}")    return subprocess.run(cmd, cwd=project_dir).returncode
高风险

迁移会执行未固定版本的远程构建插件

原文依据:4 处
发现了什么

Gradle 注入明确使用 org.openrewrite.rewrite 的 latest.release,并从 Maven Central 解析;Maven 插件坐标也没有固定版本。随后脚本执行 rewriteRun 或插件 goal。

为什么需要注意

每次运行可能下载并执行不同的发布版本。上游账号、仓库或最新版本若被攻破或出现恶意/破坏性变更,代码会以用户权限执行并可改写项目。

当用户运行 Gradle 自动化时,脚本临时注入版本为 latest.release 的 OpenRewrite 插件,启用 Maven Central,然后执行 rewriteRun;这会解析并运行当时发布的远程代码,而非经审计的固定版本。Maven 路径也使用不含版本的插件坐标并执行其 goal。依赖来源正常并不能消除更新或供应链风险;用户可要求固定并审核插件版本,或在隔离且无凭据的环境执行。

references/languages/java/scripts/upgrade_bom.py:53来自代码打开原文件
# Maven constantsMVN_REWRITE_PLUGIN = "org.openrewrite.maven:rewrite-maven-plugin"MVN_REWRITE_ARTIFACT_COORDS = "org.openrewrite:rewrite-maven"MVN_UPGRADE_RECIPE = "org.openrewrite.maven.UpgradeDependencyVersion"MVN_ADD_MANAGED_RECIPE = "org.openrewrite.maven.AddManagedDependency"MVN_REMOVE_REDUNDANT_RECIPE = "org.openrewrite.maven.RemoveRedundantDependencyVersions"
查看另外 3 个位置
references/languages/java/scripts/upgrade_bom.py:348来自代码打开原文件
    kotlin = _is_kotlin_dsl(build_file)    if kotlin:        plugin_line = '    id("org.openrewrite.rewrite") version "latest.release"'    else:        plugin_line = '    id "org.openrewrite.rewrite" version "latest.release"'    rewrite_block_kt = textwrap.dedent("""\        rewrite {            activeRecipe("com.azure.UpgradeBom")        }        repositories {            mavenCentral()        }    """)
references/languages/java/scripts/upgrade_bom.py:354来自代码打开原文件
    rewrite_block_kt = textwrap.dedent("""\        rewrite {            activeRecipe("com.azure.UpgradeBom")        }        repositories {            mavenCentral()        }    """)
references/languages/java/scripts/upgrade_bom.py:430来自代码打开原文件
def _run_gradle_openrewrite(gradle_cmd: str, project_dir: str) -> int:    cmd = [gradle_cmd, "rewriteRun"]    print(f"[upgrade_bom] Running: {' '.join(cmd)}")    return subprocess.run(cmd, cwd=project_dir).returncode
中风险

Redis 请求会被转交到未随本 Skill 审计且未固定提交的外部 Skill

原文依据:4 处
发现了什么

此 Skill 不包含 Redis 迁移实现,而是让用户前往两个 GitHub 仓库并按其 README 安装专用 Skill。给出的仓库 URL 没有固定到提交或校验值,因此后续安装内容可随时间变化。

为什么需要注意

若用户安装并运行外部 Skill,其指令、脚本和权限行为超出本次提供源码的审计范围;仓库被篡改或更新后可能执行非预期命令或更改 Azure 资源。

该 Skill 本身不会安装或执行 Redis 迁移代码,但在用户提出 Redis 迁移时,会引导用户到两个外部 GitHub 仓库,并说明从其 README 获取安装指令。URL只指向仓库,没有提交哈希、版本标签或校验值;因此用户若随后安装,获得的内容可能随时间变化且不在本次证据审计范围内。用户可要求作者提供固定版本、提交哈希、校验值及安装前审计材料。

references/services/redis/redis-to-amr.md:6来自说明文档打开原文件
There are **two distinct migration paths** to AMR, depending on the source SKU. Each path is owned by a dedicated, versioned skill maintained by the Azure Managed Redis team. The `azure-upgrade` skill does **not** ship the SKU specs, pricing scripts, ARM automation, or template-transformation logic needed for either migration — it routes the user to the correct dedicated skill.
查看另外 3 个位置
references/services/redis/redis-to-amr.md:68来自说明文档打开原文件
1. **Do not attempt the migration from this skill.** Neither SKU specs nor migration automation are inlined here.2. **Determine the source** using the disambiguation signals above. If unclear, ask the user (or inspect the script/resource).3. **Point the user to the correct dedicated skill** with its repo URL. The repo READMEs include install instructions for GitHub Copilot, Claude Code, and other compatible hosts.4. After installation, the user's agent will match the dedicated skill on its trigger phrases (e.g. *"migrate my P2 cache to AMR"*, *"convert my Bicep Redis template"*, *"migrate my Enterprise_E10 cache"*, *"update my ACRE ARM template for AMR"*).5. If the user has **both** ACR and ACRE resources, recommend installing **both** skills and running them on the relevant resources separately.
references/services/redis/redis-to-amr.md:98来自说明文档打开原文件
- AMR Migration Skill (ACR → AMR): https://github.com/AzureManagedRedis/amr-migration-skill- ACRE → AMR Migration Skill: https://github.com/AzureManagedRedis/acre-to-amr-migration-skill- Azure Managed Redis docs: https://learn.microsoft.com/en-us/azure/redis/managed-redis/
references/services/redis/redis-to-amr.md:3来自说明文档打开原文件
> **Target for both paths**: Azure Managed Redis (AMR) — M, B, X (Flash), A series> **Source determines which dedicated skill to install** — see decision table below.There are **two distinct migration paths** to AMR, depending on the source SKU. Each path is owned by a dedicated, versioned skill maintained by the Azure Managed Redis team. The `azure-upgrade` skill does **not** ship the SKU specs, pricing scripts, ARM automation, or template-transformation logic needed for either migration — it routes the user to the correct dedicated skill.
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 1 项风险
高风险

应用机密可能被打印、写入报告或暴露在进程参数中

原文依据:4 处
发现了什么

流程获取全部 Function App 设置并直接 echo;评估模板还要求把每项的 Value 写入工作区报告。下载部署包时,AzureWebJobsStorage 连接字符串又作为命令行参数传给 Azure CLI。应用设置常可包含连接字符串、密钥或令牌。

为什么需要注意

终端记录、代理会话、生成的 Markdown、CI 日志或同机进程查看者可能获得可用于访问存储或其他 Azure 服务的凭据。

在用户执行 Functions 迁移流程时,命令会读取并直接输出全部应用设置;报告格式又要求记录每个设置的 Value。这些设置可能含密钥、令牌或连接字符串,因而会进入终端记录或工作区文件。部署包流程还把 AzureWebJobsStorage 连接字符串作为 CLI 参数传入,可能被进程查看工具或命令审计日志捕获。用户可要求只记录设置名称、对值做脱敏,并使用身份认证而非连接字符串。

references/services/functions/automation.md:109来自说明文档打开原文件
# Get all app settings as JSONapp_settings=$(az functionapp config appsettings list --name $appName --resource-group $rgName)echo "$app_settings"```
查看另外 3 个位置
references/services/functions/assessment.md:59来自说明文档打开原文件
## 3. App Settings Inventory| Setting | Value | Migrate? | Notes ||---------|-------|----------|-------|| | | Yes / No / Convert | |
references/services/functions/automation.md:212来自说明文档打开原文件
echo "Getting the storage account connection string..."storageConnection=$(az functionapp config appsettings list --name $appName --resource-group $rgName \    --query "[?name=='AzureWebJobsStorage'].value" -o tsv)echo "Getting the package name..."packageName=$(az storage blob list --connection-string $storageConnection --container-name scm-releases \    --query "[0].name" -o tsv)echo "Downloading package: $packageName"az storage blob download --connection-string $storageConnection --container-name scm-releases \    --name $packageName --file $packageName```
references/services/functions/automation.md:220来自说明文档打开原文件
echo "Downloading package: $packageName"az storage blob download --connection-string $storageConnection --container-name scm-releases \    --name $packageName --file $packageName```
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。发现 1 项风险
中风险

Gradle 清理逻辑可能因标记碰撞截断构建文件

原文依据:5 处
发现了什么

清理函数把第一次出现的固定标记及下一行删除,并从第二次出现起丢弃文件剩余全部内容,然后覆盖原构建文件。它不确认这些标记确实是本次注入产生的。

为什么需要注意

若 build.gradle 原先已含相同标记(例如此前失败的运行、复制的注释或恶意仓库内容),清理可能删除用户原有配置至文件末尾,使构建文件损坏且数据难以恢复。

当脚本自行注入 Gradle 插件后进入清理阶段时,它按一个固定文本标记识别内容:第一次标记会连同下一行删除,第二次标记会导致余下文件全部丢弃,然后覆盖原构建文件。若项目原先已含相同标记,标记计数可能碰撞并删除真实配置;代码没有验证标记属于本次注入。用户可要求运行前备份或提交构建文件,并在执行后检查完整差异。

references/languages/java/scripts/upgrade_bom.py:63来自代码打开原文件
GRADLE_REMOVE_REDUNDANT_RECIPE = "org.openrewrite.gradle.RemoveRedundantDependencyVersions"REWRITE_YML_NAME = "rewrite.yml"GRADLE_PLUGIN_MARKER = "// --- openrewrite-upgrade-bom-plugin (auto-added, safe to remove) ---"
查看另外 4 个位置
references/languages/java/scripts/upgrade_bom.py:410来自代码打开原文件
        line = lines[i]        if GRADLE_PLUGIN_MARKER in line:            marker_count += 1            if marker_count == 1:                # First marker (inside plugins {}): skip the marker line and                # the following injected plugin id line.                i += 2                continue            else:                # Second marker (at end of file): skip the marker and every                # remaining line — they're the injected rewrite {} and                # repositories {} blocks.                break        cleaned.append(line)
references/languages/java/scripts/upgrade_bom.py:425来自代码打开原文件
    with open(build_file, "w", encoding="utf-8") as f:        f.writelines(cleaned)    print(f"[upgrade_bom] Cleaned up OpenRewrite plugin from {build_file}")
references/languages/java/scripts/upgrade_bom.py:372来自代码打开原文件
        # `plugins {`, so don't add another one before the marker.        content = (            content[:insert_pos]            + "\n"            + GRADLE_PLUGIN_MARKER            + "\n"            + plugin_line            + content[insert_pos:]        )    else:        # No plugins block — prepend one        content = (            "plugins {\n"            + GRADLE_PLUGIN_MARKER            + "\n"            + plugin_line            + "\n}\n\n"            + content        )    content += GRADLE_PLUGIN_MARKER + "\n"    content += rewrite_block_kt if kotlin else rewrite_block_groovy
references/languages/java/scripts/upgrade_bom.py:408来自代码打开原文件
    i = 0    while i < len(lines):        line = lines[i]        if GRADLE_PLUGIN_MARKER in line:            marker_count += 1            if marker_count == 1:                # First marker (inside plugins {}): skip the marker line and                # the following injected plugin id line.                i += 2                continue            else:                # Second marker (at end of file): skip the marker and every                # remaining line — they're the injected rewrite {} and                # repositories {} blocks.                break        cleaned.append(line)        i += 1    with open(build_file, "w", encoding="utf-8") as f:        f.writelines(cleaned)    print(f"[upgrade_bom] Cleaned up OpenRewrite plugin from {build_file}")
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。未发现风险
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。发现 1 项风险
高风险

新旧 Function App 的触发器可同时运行并重复产生业务副作用

原文依据:4 处
发现了什么

流程要求保留原应用运行,同时明确指出新应用部署后触发器立即开始处理。文档列出的队列、Service Bus、Cosmos DB、Blob 和定时器均需要隔离资源、排空或错开调度。

为什么需要注意

两个应用可能重复消费或竞争消息,造成重复付款、通知、写入、作业执行或消息丢失;具体后果取决于函数的业务逻辑。

在用户部署新 Function App 代码后,新应用的触发器会立即开始处理,而流程同时建议继续保留原应用运行以便回滚。若两者指向同一队列、主题、容器、租约或定时任务,可能重复消费、重复发送或并发修改业务数据。文档列出了隔离容器、消费者组、队列及错开定时计划等缓解措施。用户应在部署前确认逐项切换方案,并可要求先禁用新应用触发器。

references/services/functions/consumption-to-flex.md:124来自说明文档打开原文件
After user selects an option, execute the corresponding deployment method from [automation.md](automation.md) — Step 5.> ⚠️ After deployment, triggers immediately start processing. Review mitigation strategies for your trigger types.
查看另外 3 个位置
references/services/functions/consumption-to-flex.md:128来自说明文档打开原文件
**After successful deployment, inform the user:**> Code deployed! Next steps to consider:>> - The original app is still running — keep it as rollback for a few days> - Update any clients/pipelines to point to the new URL> - Enable HTTPS-only and managed identity on the new app for better security> - When confident, you can delete the original app
references/services/functions/consumption-to-flex.md:155来自说明文档打开原文件
| Trigger Type | Risk | Mitigation ||-------------|------|------------|| Azure Blob storage | High | Create separate container for event-based trigger in new app || Azure Cosmos DB | High | Create dedicated lease container for new app; set `StartFromBeginning: false` || Azure Event Grid | Medium | Recreate event subscriptions; ensure idempotent functions || Azure Event Hubs | Medium | Create new consumer group for new app || Azure Service Bus | High | Create new topic/queue; update senders; drain original before shutdown || Azure Storage Queue | High | Create new queue; update senders; drain original before shutdown || HTTP | Low | Update clients to target new app URL || Timer | Low | Offset schedules during cutover to avoid simultaneous execution |
references/services/functions/consumption-to-flex.md:147来自说明文档打开原文件
### Phase 7: Cleanup (Optional)- Keep the original app for a few days/weeks as rollback- Consumption plan charges only for actual usage — low cost to keep idle- When confident, delete using the command in [automation.md](automation.md) — Step 7

Skill 逻辑拆解

7 个说明模块

此 Skill 覆盖 Azure Functions 套餐迁移、Java SDK 源码现代化和 Redis 迁移分流。顶层流程要求先评估、确认目标 SKU,并在删除或停止原应用前取得明确确认。

查看原文
SKILL.md:29来自说明文档打开原文件
1. Follow phases sequentially — do not skip2. Generate an assessment before any upgrade operations3. Load the scenario reference and follow its rules4. Use `mcp_azure_mcp_get_azure_bestpractices` and `mcp_azure_mcp_documentation` MCP tools5. Destructive actions require `ask_user` — [global-rules](references/global-rules.md)6. Always confirm the target plan/SKU with the user before proceeding7. Never delete or stop the original app without explicit user confirmation8. All automation scripts must be idempotent and resumable
references/global-rules.md:16来自说明文档打开原文件
Always use `ask_user` before:- Selecting target Azure subscription- Selecting target Azure region/location- Creating new Azure resources- Stopping or deleting the original app/service- Modifying custom domains or network restrictions- Any irreversible configuration change

Functions 流程会并行创建新的 Flex Consumption 应用,迁移设置、身份、域名和访问限制,再按用户选择部署代码;原应用通常继续运行以供回滚。

查看原文
references/services/functions/automation.md:249来自说明文档打开原文件
The command automatically:- Assesses your source app for Flex Consumption compatibility- Creates a new function app in the Flex Consumption plan- Migrates app settings, identity assignments, storage mounts, CORS, custom domains, and access restrictions
references/services/functions/automation.md:301来自说明文档打开原文件
### ask_user: Choose Deployment MethodPresent these options to the user:> Your new Flex Consumption app `<NEW_APP_NAME>` has been created and configured. Now we need to deploy your function code. How would you like to proceed?>> 1. **Update CI/CD pipeline** — I'll help you update your Azure Pipelines or GitHub Actions workflow to target the new app> 2. **Deploy from local project** — I'll run `func azure functionapp publish <NEW_APP_NAME>` from your project directory  > 3. **Deploy existing package** — I'll deploy the package we downloaded earlier from the original app

Java 流程是自主的仓库改写工作:创建迁移分支,修改构建与源码,运行编译和测试,并逐步提交。

查看原文
references/languages/java/README.md:7来自说明文档打开原文件
Upgrade all `com.microsoft.azure.*` to `com.azure.*` equivalents in one autonomous session.You are an expert Azure SDK migration agent. Generate a unique run identifier at the start (format: `azure-sdk-upgrade-YYYYMMDD-HHMMSS`) and use it throughout all phases.
references/languages/java/rules/execution-guidelines.md:7来自说明文档打开原文件
- **Uninterrupted run**: Complete each phase fully without pausing for user input.- **Git**: If git is available, create a new branch `java-upgrade/{RUN_ID}` before starting the migration. Commit changes per step on this branch. If git is not available, log a warning and proceed — files remain uncommitted in the working directory. Use `N/A` for `<current_branch>` and `<current_commit_id>` placeholders.

BOM 自动化脚本从 GitHub 获取当前 BOM 版本,然后调用 Maven 或 Gradle 的 OpenRewrite 配方直接修改项目构建文件。

查看原文
references/languages/java/scripts/upgrade_bom.py:80来自代码打开原文件
def _get_latest_bom_version() -> str:    try:        with urllib.request.urlopen(BOM_POM_URL, timeout=HTTP_TIMEOUT_SECONDS) as response:            pom_xml = response.read()    except urllib.error.URLError as exc:
references/languages/java/scripts/upgrade_bom.py:430来自代码打开原文件
def _run_gradle_openrewrite(gradle_cmd: str, project_dir: str) -> int:    cmd = [gradle_cmd, "rewriteRun"]    print(f"[upgrade_bom] Running: {' '.join(cmd)}")    return subprocess.run(cmd, cwd=project_dir).returncode
从这里开始 · 工作说明SKILL.md
azure-upgrade
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。

文件引用关系图

40 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录31 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/languages/java/scripts/upgrade_bom.py已纳入全文
  • references/global-rules.md已纳入全文
  • references/languages/java/README.md已纳入全文
  • references/languages/java/templates/PLAN_TEMPLATE.md已纳入全文
  • references/languages/java/templates/PROGRESS_TEMPLATE.md已纳入全文
  • references/languages/java/templates/SUMMARY_TEMPLATE.md已纳入全文
  • references/services/functions/assessment.md已纳入全文
  • references/services/functions/automation.md已纳入全文
  • references/services/functions/consumption-to-flex.md已纳入全文
  • references/services/redis/redis-to-amr.md已纳入全文
  • references/workflow-details.md已纳入全文
  • references/languages/java/bom-migration/bom-gradle-settings.md已纳入全文
  • references/languages/java/bom-migration/bom-gradle-toml.md已纳入全文
  • references/languages/java/bom-migration/bom-gradle.md已纳入全文
  • references/languages/java/bom-migration/bom-maven.md已纳入全文
  • references/languages/java/bom-migration/bom-migration.md已纳入全文
  • references/languages/java/bom-migration/bom-validation.md已纳入全文
  • references/languages/java/INSTRUCTION.md已纳入全文
  • references/languages/java/package-specific/com.microsoft.azure.eventprocessorhost.md已纳入全文
  • references/languages/java/package-specific/com.microsoft.azure.management.md已纳入全文
  • references/languages/java/rules/efficiency.md已纳入全文
  • references/languages/java/rules/execution-guidelines.md已纳入全文
  • references/languages/java/rules/review-code-changes.md已纳入全文
  • references/languages/java/rules/troubleshooting.md已纳入全文
  • references/languages/java/rules/upgrade-strategy.md已纳入全文
  • references/languages/java/rules/upgrade-success-criteria.md已纳入全文
  • references/languages/java/workflow/phase-1-precheck.md已纳入全文
  • references/languages/java/workflow/phase-2-plan.md已纳入全文
  • references/languages/java/workflow/phase-3-execute.md已纳入全文
  • references/languages/java/workflow/phase-4-summarize.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • references/global-rules.md配套文件
  • references/languages/java/INSTRUCTION.md配套文件
  • references/languages/java/README.md配套文件
  • references/languages/java/bom-migration/bom-gradle-settings.md配套文件
  • references/languages/java/bom-migration/bom-gradle-toml.md配套文件
  • references/languages/java/bom-migration/bom-gradle.md配套文件
  • references/languages/java/bom-migration/bom-maven.md配套文件
  • references/languages/java/bom-migration/bom-migration.md配套文件
  • references/languages/java/bom-migration/bom-validation.md配套文件
  • references/languages/java/package-specific/com.microsoft.azure.eventprocessorhost.md配套文件
  • references/languages/java/package-specific/com.microsoft.azure.management.md配套文件
  • references/languages/java/rules/efficiency.md配套文件
  • references/languages/java/rules/execution-guidelines.md配套文件
  • references/languages/java/rules/review-code-changes.md配套文件
  • references/languages/java/rules/troubleshooting.md配套文件
  • references/languages/java/rules/upgrade-strategy.md配套文件
  • references/languages/java/rules/upgrade-success-criteria.md配套文件
  • references/languages/java/scripts/upgrade_bom.py脚本
  • references/languages/java/templates/PLAN_TEMPLATE.md配套文件
  • references/languages/java/templates/PROGRESS_TEMPLATE.md配套文件
  • references/languages/java/templates/SUMMARY_TEMPLATE.md配套文件
  • references/languages/java/workflow/phase-1-precheck.md配套文件
  • references/languages/java/workflow/phase-2-plan.md配套文件
  • references/languages/java/workflow/phase-3-execute.md配套文件
  • references/languages/java/workflow/phase-4-summarize.md配套文件
  • references/services/functions/assessment.md配套文件
  • references/services/functions/automation.md配套文件
  • references/services/functions/consumption-to-flex.md配套文件
  • references/services/redis/redis-to-amr.md配套文件
  • references/workflow-details.md配套文件

代码和说明中提到的操作

连接外部网站
references/languages/java/scripts/upgrade_bom.py:45来自代码打开原文件
ARTIFACT_ID = "azure-sdk-bom"BOM_POM_URL = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/boms/azure-sdk-bom/pom.xml"POM_NAMESPACE = {"m": "http://maven.apache.org/POM/4.0.0"}
references/languages/java/scripts/upgrade_bom.py:46来自代码打开原文件
BOM_POM_URL = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/boms/azure-sdk-bom/pom.xml"POM_NAMESPACE = {"m": "http://maven.apache.org/POM/4.0.0"}MIN_BOM_VERSION = "1.3.0"
references/languages/java/scripts/upgrade_bom.py:169来自代码打开原文件
        return False    ns = {"m": "http://maven.apache.org/POM/4.0.0"}    for dep in tree.findall(".//m:dependencyManagement/m:dependencies/m:dependency", ns):
运行命令
references/languages/java/scripts/upgrade_bom.py:36来自代码打开原文件
import statimport subprocessimport sys
references/languages/java/scripts/upgrade_bom.py:195来自代码打开原文件
    print(f"[upgrade_bom] Running: {' '.join(cmd)}")    return subprocess.run(cmd, cwd=project_dir).returncode
references/languages/java/scripts/upgrade_bom.py:433来自代码打开原文件
    print(f"[upgrade_bom] Running: {' '.join(cmd)}")    return subprocess.run(cmd, cwd=project_dir).returncode
读取密钥或账号配置
references/languages/java/package-specific/com.microsoft.azure.management.md:19来自说明文档打开原文件
Treat **any** of the following shapes in the legacy code as file-based authentication that must be replaced (not migrated). Triggers include `AZURE_AUTH_LOCATION`, `.authenticate(File)`, `ApplicationTokenCredentials.fromFile`, or any code path that reads `clientId` / `clientSecret` / `tenant` from disk and feeds them into a credential builder.
references/languages/java/package-specific/com.microsoft.azure.management.md:21来自说明文档打开原文件
> **Important:** Reading `clientId`, `clientSecret`, or `tenantId` from **environment variables** (e.g., `System.getenv("AZURE_CLIENT_ID")`) does **not** constitute file-based authentication and should **not** be flagged by this rule. Only flag patterns that source credentials from files on disk.
references/languages/java/package-specific/com.microsoft.azure.management.md:25来自说明文档打开原文件
// Shape A: direct File overloadAzure azure = Azure.authenticate(new File(System.getenv("AZURE_AUTH_LOCATION")))                   .withDefaultSubscription();
读取文件
references/languages/java/scripts/upgrade_bom.py:82来自代码打开原文件
    try:        with urllib.request.urlopen(BOM_POM_URL, timeout=HTTP_TIMEOUT_SECONDS) as response:            pom_xml = response.read()
references/languages/java/scripts/upgrade_bom.py:286来自代码打开原文件
    try:        with open(build_file, "r", encoding="utf-8") as f:            content = f.read()
references/languages/java/scripts/upgrade_bom.py:331来自代码打开原文件
    with open(yml_path, "w", encoding="utf-8") as f:        f.write(yml_content)
修改文件
references/languages/java/scripts/upgrade_bom.py:332来自代码打开原文件
    with open(yml_path, "w", encoding="utf-8") as f:        f.write(yml_content)    print(f"[upgrade_bom] Created {yml_path}")
references/languages/java/scripts/upgrade_bom.py:395来自代码打开原文件
    with open(build_file, "w", encoding="utf-8") as f:        f.write(content)    print(f"[upgrade_bom] Injected OpenRewrite plugin into {build_file}")
读取了多少行
3,461
文件校验值(用于核对版本)
d21557f3479fdf4ecbda08b5d8795ee8ac1d7fd907dfcc5a8e0a3dd248603273