Skip to content

Migrate App Service tools to new tool design#2875

Open
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:MigrateAppServiceToNewToolDesign
Open

Migrate App Service tools to new tool design#2875
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:MigrateAppServiceToNewToolDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates App Service 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 Jun 12, 2026
Copilot AI review requested due to automatic review settings June 12, 2026 21:05
@alzimmermsft alzimmermsft requested review from a team and KarishmaGhiya as code owners June 12, 2026 21:05
@github-actions github-actions Bot added the tools-AppService tools for app service label Jun 12, 2026

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 App Service tool commands to the newer “options POCO + [Option] attribute” design, moving option registration/binding to OptionBinder conventions and aligning commands with SubscriptionCommand<TOptions, TResult> patterns used across the repo.

Changes:

  • Replaced legacy RegisterOptions/BindOptions(ParseResult) patterns with options POCOs annotated via [Option], and updated commands to accept bound options directly.
  • Removed the App Service-specific BaseAppServiceCommand wrapper and the System.CommandLine global using, simplifying command implementations.
  • Updated App Service tool unit tests to use the subscription-aware command test base, and added an Azure server changelog entry.

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.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappGetCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappChangeStateCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsUpdateCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsGetCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorListCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorDiagnoseCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Deployment/DeploymentGetCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Database/DatabaseAddCommandTests.cs Updates test base class for subscription-aware command testing.
tools/Azure.Mcp.Tools.AppService/src/Services/IAppServiceService.cs Adjusts service contract for nullable restart options.
tools/Azure.Mcp.Tools.AppService/src/Services/AppServiceService.cs Aligns implementation with nullable restart options and updated command behavior.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappGetOptions.cs Introduces new options POCO for webapp “get” with [Option] attributes.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappChangeStateOptions.cs Migrates change-state options to [Option]-based binding.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsUpdateOptions.cs Migrates app settings update options to [Option]-based binding.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsGetOptions.cs (No diff shown) Included as updated via command migration context (if present in PR).
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Diagnostic/DetectorDiagnoseOptions.cs Migrates detector diagnose options to [Option]-based binding.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Deployment/DeploymentGetOptions.cs Migrates deployment-get options to [Option]-based binding.
tools/Azure.Mcp.Tools.AppService/src/Options/Database/DatabaseAddOptions.cs Migrates database-add options to [Option]-based binding.
tools/Azure.Mcp.Tools.AppService/src/Options/BaseAppServiceOptions.cs Reworks shared option set into an [Option]-bound POCO.
tools/Azure.Mcp.Tools.AppService/src/Options/AppServiceOptionDefinitions.cs Simplifies option definitions to only retained string constants/descriptions.
tools/Azure.Mcp.Tools.AppService/src/GlobalUsings.cs Removes System.CommandLine global using after migration away from manual option registration.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappGetCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> with option validation in ValidateOptions.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> and moves parsing/validation to POCO model.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsUpdateCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> with POCO-based validation.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsGetCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> with POCO binding.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorListCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> with POCO binding.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorDiagnoseCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> and simplifies time validation to typed options.
tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Deployment/DeploymentGetCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> with POCO binding.
tools/Azure.Mcp.Tools.AppService/src/Commands/Database/DatabaseAddCommand.cs Converts command to SubscriptionCommand<TOptions, TResult> with POCO binding.
tools/Azure.Mcp.Tools.AppService/src/Commands/BaseAppServiceCommand.cs Removes legacy base command wrapper after migration to subscription command base.
servers/Azure.Mcp.Server/changelog-entries/1781298285544.yaml Adds a changelog entry for the App Service tool changes.

Comment on lines +43 to 46
if (!string.IsNullOrWhiteSpace(options.App) && string.IsNullOrWhiteSpace(options.ResourceGroup))
{
return context.Response;
validationResult.Errors.Add($"When specifying '{AppServiceOptionDefinitions.AppName}', you must also specify '{OptionDefinitions.Common.ResourceGroupName}'.");
}
Comment thread tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.AppService/src/Services/AppServiceService.cs Outdated
Comment on lines +1 to +3
changes:
- section: "Breaking Changes"
description: "Removed unused parameters from App Service tools."
Comment thread tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools-AppService tools for app service

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants