Migrate App Service tools to new tool design#2875
Open
alzimmermsft wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
BaseAppServiceCommandwrapper and theSystem.CommandLineglobal 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 on lines
+1
to
+3
| changes: | ||
| - section: "Breaking Changes" | ||
| description: "Removed unused parameters from App Service tools." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Migrates App Service tools to new design where Register and Bind options are based on
Optionattributes.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline