Skip to content

Add azmcp containerapps list command#1981

Open
Copilot wants to merge 10 commits intomainfrom
copilot/implement-issue-200-app-containers
Open

Add azmcp containerapps list command#1981
Copilot wants to merge 10 commits intomainfrom
copilot/implement-issue-200-app-containers

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

  • Fix alphabetical ordering in Program.cs: move ContainerAppsSetup after ConfidentialLedgerSetup
  • Remove unused Azure.ResourceManager.AppContainers package reference from csproj
  • Remove unnecessary [JsonPropertyName] annotations from ContainerAppInfo.cs (camelCase policy handles it)
  • Remove unused tenant parameter from IContainerAppsService and ContainerAppsService (not forwarded to ExecuteResourceQueryAsync)
  • Update ContainerAppListCommand to not pass tenant to service
  • Add copyright header to AssemblyAttributes.cs
  • Add pr: 1981 to changelog entry YAML
  • Build and run unit tests (8/8 passed)
  • Code review passed with no comments
  • Security scan (CodeQL timed out - changes are minimal removals with no security impact)

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 10, 2026 07:59
Implements issue #200 - adds a new ContainerApps toolset using
Azure.ResourceManager.AppContainers to list container apps in a subscription.

Includes:
- ContainerAppListCommand with resource group filtering
- ContainerAppsService using BaseAzureResourceService with Resource Graph
- Unit tests (8 passing)
- Documentation updates (azmcp-commands.md, e2eTestPrompts.md)
- Changelog entry

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Azure Resource Manager for App Containers Add azmcp containerapps containerapp list command Mar 10, 2026
…list

Removes the intermediate 'containerapp' subgroup so the command path is
`azmcp containerapps list` instead of `azmcp containerapps containerapp list`.

Updates Setup.cs, azmcp-commands.md, e2eTestPrompts.md, and changelog entry.

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot AI changed the title Add azmcp containerapps containerapp list command Add azmcp containerapps list command Mar 10, 2026
Copilot AI and others added 2 commits March 11, 2026 03:47
…to consolidated-tools.json

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
…json

The containerapps_list tool was not mapped in consolidated-tools.json,
causing ConsolidatedModeTests to fail in DEBUG builds. Added the tool
to the get_azure_container_details consolidated tool alongside other
container service tools (ACR, AKS).

Also restores global.json SDK version to 10.0.103 (was accidentally
committed as 10.0.102 in the previous commit).

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
@ArthurMa1978 ArthurMa1978 marked this pull request as ready for review March 11, 2026 09:40
@ArthurMa1978 ArthurMa1978 requested a review from a team as a code owner March 11, 2026 09:40
Copilot AI review requested due to automatic review settings March 11, 2026 09:40
@ArthurMa1978 ArthurMa1978 requested a review from a team as a code owner March 11, 2026 09:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Azure Container Apps tool area and exposes a azmcp containerapps list command, aligning command/tool naming and wiring it into the server’s consolidated tool mappings and documentation.

Changes:

  • Introduces Azure.Mcp.Tools.ContainerApps area with containerapps list command, service layer, options, models, and JSON source-gen context.
  • Registers the new area in the server and updates consolidated tool mapping to include containerapps_list under get_azure_container_details.
  • Adds unit tests and updates server docs (command reference + e2e prompts) and changelog entry.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.ContainerApps/src/ContainerAppsSetup.cs Registers the Container Apps area and command into the command hierarchy.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerApp/ContainerAppListCommand.cs Implements the list command execution and response shaping.
tools/Azure.Mcp.Tools.ContainerApps/src/Services/ContainerAppsService.cs Implements Resource Graph-backed listing of Container Apps.
tools/Azure.Mcp.Tools.ContainerApps/src/Services/IContainerAppsService.cs Defines the Container Apps service contract used by the command.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/BaseContainerAppsCommand.cs Adds shared subscription/resource-group option behavior for Container Apps commands.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerAppsJsonContext.cs Adds AOT-friendly System.Text.Json source generation metadata for responses.
tools/Azure.Mcp.Tools.ContainerApps/src/Models/ContainerAppInfo.cs Defines the output model for listed container apps.
tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs Defines options type for the list command.
tools/Azure.Mcp.Tools.ContainerApps/src/GlobalUsings.cs Adds global usings needed across the tool project.
tools/Azure.Mcp.Tools.ContainerApps/src/Azure.Mcp.Tools.ContainerApps.csproj Adds the new tool project configuration and dependencies.
tools/Azure.Mcp.Tools.ContainerApps/src/AssemblyInfo.cs Enables InternalsVisibleTo for unit/live tests.
tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.UnitTests/Azure.Mcp.Tools.ContainerApps.UnitTests.csproj Adds a new unit test project for the Container Apps tool.
tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.UnitTests/ContainerApp/ContainerAppListCommandTests.cs Adds unit tests for validation, filtering, error handling, and serialization.
servers/Azure.Mcp.Server/src/Program.cs Registers the new Container Apps area in server startup.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds containerapps_list under get_azure_container_details and updates description.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents azmcp containerapps list usage and examples.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Updates e2e prompts to reference containerapps_list.
servers/Azure.Mcp.Server/changelog-entries/1773129554713.yaml Adds changelog entry for the new command.

ArthurMa1978 and others added 2 commits March 13, 2026 15:13
…Service.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ContainerAppListCommand.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…d add ClearEnvironmentVariablesBeforeTest assembly attribute

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot AI requested a review from ArthurMa1978 March 13, 2026 07:32
@ArthurMa1978 ArthurMa1978 linked an issue Mar 16, 2026 that may be closed by this pull request
@@ -0,0 +1,3 @@
changes:
Copy link
Member

Choose a reason for hiding this comment

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

@vcolin7 if the PR number is not added does it automagically get resolved later?

namespace Azure.Mcp.Tools.ContainerApps.Models;

public sealed record ContainerAppInfo(
[property: JsonPropertyName("name")] string Name,
Copy link
Member

Choose a reason for hiding this comment

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

These annotations aren't required if they also match the property name.

Copy link

@live1206 live1206 left a comment

Choose a reason for hiding this comment

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

Overall this is a well-structured PR that follows the repo's existing patterns (ACR, AKS). A few items to address:

: BaseAzureResourceService(subscriptionService, tenantService), IContainerAppsService
{
public async Task<ResourceQueryResults<ContainerAppInfo>> ListContainerApps(
string subscription,

Choose a reason for hiding this comment

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

Bug: The tenant parameter is accepted here but never passed to ExecuteResourceQueryAsync() below. The command layer does pass options.Tenant to this method (ContainerAppListCommand.cs line ~33), so tenant selection is silently ignored. Should tenant be forwarded to the resource query call?

</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.ResourceManager" />
<PackageReference Include="Azure.ResourceManager.AppContainers" />

Choose a reason for hiding this comment

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

Nit: Azure.ResourceManager.AppContainers is referenced but no types from this package appear to be used — the service implementation uses ExecuteResourceQueryAsync (Resource Graph) with manual JsonElement parsing. Consider removing this dependency to reduce package weight and improve AOT trimming.

new Azure.Mcp.Tools.CloudArchitect.CloudArchitectSetup(),
new Azure.Mcp.Tools.Communication.CommunicationSetup(),
new Azure.Mcp.Tools.Compute.ComputeSetup(),
new Azure.Mcp.Tools.ContainerApps.ContainerAppsSetup(),

Choose a reason for hiding this comment

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

Nit: Alphabetical ordering — ConfidentialLedger ("Conf...") sorts before ContainerApps ("Cont..."), so this line should come after the ConfidentialLedgerSetup registration.

@@ -0,0 +1,2 @@
[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]

Choose a reason for hiding this comment

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

Nit: Missing the copyright header (// Copyright (c) Microsoft Corporation. / // Licensed under the MIT License.) that all other source files in this PR include (e.g., the src AssemblyInfo.cs).

…emove redundant JsonPropertyName annotations, remove unused tenant parameter, add copyright header, add PR number to changelog

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

Add azmcp containerapps list command

5 participants