Skip to content

Migrate Container Apps tools to new tool design#3091

Open
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateContainerAppsToolsToNewDesign
Open

Migrate Container Apps tools to new tool design#3091
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateContainerAppsToolsToNewDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates Container Apps tools to new design where Register and Bind options are based on Option attributes.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@alzimmermsft alzimmermsft self-assigned this Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 21:48
@alzimmermsft
alzimmermsft requested review from a team as code owners July 17, 2026 21:48
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the Azure Container Apps tool to the newer command/options design that binds CLI options via [Option] / [OptionContainer] attributes and uses the two-generic SubscriptionCommand<TOptions, TResult> pattern.

Changes:

  • Refactors ContainerAppListCommand to use SubscriptionCommand<ContainerAppListOptions, TResult> and attribute-based option binding (removing the legacy RegisterOptions/BindOptions approach).
  • Updates unit tests to use SubscriptionCommandUnitTestsBase and removes the Container Apps test assembly attributes file.
  • Updates project references to use $(RepoRoot) in two tool .csproj files and adds a changelog entry.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Cosmos/src/Azure.Mcp.Tools.Cosmos.csproj Switches Azure.Mcp.Core project reference to $(RepoRoot) (scope note: touches Cosmos in a Container Apps PR).
tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/ContainerApp/ContainerAppListCommandTests.cs Migrates tests to SubscriptionCommandUnitTestsBase and simplifies validation setup.
tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/AssemblyAttributes.cs Removes assembly-level test attributes (env var clearing + collection behavior).
tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs Replaces inherited options with a flat, attribute-bound options POCO implementing ISubscriptionOption.
tools/Azure.Mcp.Tools.ContainerApps/src/GlobalUsings.cs Removes global System.CommandLine using.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerAppsJsonContext.cs Converts JSON context type to file-scoped declaration.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerApp/ContainerAppListCommand.cs Converts command to two-generic subscription command and updates execution signature to take bound options.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/BaseContainerAppsCommand.cs Deletes legacy base command that performed manual option registration/binding.
tools/Azure.Mcp.Tools.ContainerApps/src/Azure.Mcp.Tools.ContainerApps.csproj Switches Azure.Mcp.Core reference to $(RepoRoot) and removes direct System.CommandLine package reference.
servers/Azure.Mcp.Server/changelog-entries/1784324895091.yaml Adds changelog entry describing breaking changes for Container Apps tool parameters.
Comments suppressed due to low confidence (1)

tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/AssemblyAttributes.cs:1

  • The test project no longer has the assembly-level attributes that clear known environment variables before each test run. Other tool test projects in this repo keep these attributes to prevent ambient CI/dev environment variables (e.g., AZURE_SUBSCRIPTION_ID, proxies, auth settings) from influencing unit tests and to keep xUnit isolation consistent.

Comment thread tools/Azure.Mcp.Tools.Cosmos/src/Azure.Mcp.Tools.Cosmos.csproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants