All skills
microsoft avatar

/azure-upgrade

@b3c238e
by microsoftmicrosoft/skills3.1k stars
351

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 Redis (AMR).

Use this Skill: https://skilld.dev/gh/microsoft/skills/azure-upgrade

This session only. Nothing lands on disk.

referenceslanguagesjavabom-migrationbom-maven.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

BOM Migration — Maven Projects

Python/script availability: The script below requires Python 3.10+. If python3 --version (or python --version) fails, or if upgrade_bom.py exits unsuccessfully, skip the script path and follow Manual Fallback instead.

Automated (Python available)

Run the upgrade_bom.py script located at references/languages/java/scripts/upgrade_bom.py (relative to this skill). It resolves the latest stable BOM version, auto-detects Maven, and performs two steps:

  1. Set/upgrade the BOM — adds azure-sdk-bom if missing, or upgrades the version if already present.
  2. Remove redundant explicit versions — strips explicit <version> tags from individual Azure dependencies that are now managed by the BOM.

The following invocation works identically in bash and PowerShell:

# Path is relative to the skill directory (plugin/skills/azure-upgrade/)
python3 ./references/languages/java/scripts/upgrade_bom.py <project_dir>

Options:

  • --mvn <cmd> — override the Maven command (default: auto-detects mvnw or mvn).

If the script fails after starting, treat that as an automation failure only: keep the resolved TARGET_AZURE_SDK_BOM_VERSION, manually apply the fallback steps below, and continue validation.

Under the hood (OpenRewrite recipes):

  • Add BOM: AddManagedDependency (docs)
  • Upgrade BOM: UpgradeDependencyVersion (docs)
  • Remove redundant versions: RemoveRedundantDependencyVersions (docs)

Expected pom.xml after migration

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-sdk-bom</artifactId>
            <version>{bom_version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-identity</artifactId>
    </dependency>
    <dependency>
        <groupId>com.azure.resourcemanager</groupId>
        <artifactId>azure-resourcemanager</artifactId>
    </dependency>
</dependencies>

Manual Fallback (no Python or script failure)

When Python is unavailable or upgrade_bom.py fails, edit pom.xml directly. Apply the same two steps as the script:

Step 1 — Add or upgrade azure-sdk-bom

Locate the <dependencyManagement><dependencies> block (create it inside <project> if absent). Add or update the BOM entry:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-sdk-bom</artifactId>
            <version>{bom_version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <!-- keep any other managed dependencies here -->
    </dependencies>
</dependencyManagement>
  • If the entry exists: update only the <version> value to {bom_version}.
  • If the entry is missing: insert the full <dependency> block above. Preserve any other existing managed dependencies.
  • Multi-module project: add the BOM in the parent (aggregator) pom.xml only. Child modules inherit it.

Step 2 — Remove redundant explicit versions

For every <dependency> whose <groupId> starts with com.azure (e.g. com.azure, com.azure.resourcemanager, com.azure.spring), check whether the BOM manages it (see the BOM POM at https://repo1.maven.org/maven2/com/azure/azure-sdk-bom/{bom_version}/azure-sdk-bom-{bom_version}.pom). If managed:

  • Remove the <version> element entirely.
  • Leave <groupId>, <artifactId>, <scope>, <classifier>, <exclusions>, etc. unchanged.

Before:

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
    <version>1.13.0</version>
</dependency>

After:

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
</dependency>

Do not strip versions from artifacts not managed by the BOM (verify each one against the BOM POM).

Step 3 — Verify

Run mvn -q -DskipTests dependency:tree (the same command works in both bash and PowerShell) and confirm:

  • com.azure:azure-sdk-bom:pom:{bom_version}:import appears in the managed dependencies and {bom_version} equals TARGET_AZURE_SDK_BOM_VERSION.
  • All BOM-managed Azure artifacts resolve to versions from {bom_version}.

Then continue with the validation checklist in bom-validation.md.

Source: SKILL.md on GitHub

No alerts15d3 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    This skill provides a structured framework for Azure workload upgrades and Java SDK modernization. It incorporates several security-focused practices, such as mandatory reviews to ensure the preservation of authentication and authorization controls during code migration. The skill utilizes standard development tools and follows official Microsoft guidance for Azure resource management.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

Signed by skilld at b3c238e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
compatibility
python3.10+
metadata
{
  "author": "Microsoft",
  "version": "1.2.1"
}

README badge

README badge for microsoft/skills/azure-upgrade