Migrate Quota tools to new tool design#3066
Open
alzimmermsft wants to merge 3 commits into
Open
Conversation
alzimmermsft
requested review from
KarishmaGhiya,
RickWinter,
g2vinay,
hallipr,
jairmyree,
tmeschter and
xirzec
July 16, 2026 16:04
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Quota toolset’s commands and options to the newer attribute-based option binding model (OptionBinder) and updates the command implementations to the two-generic SubscriptionCommand<TOptions, TResult> pattern with subscription resolution.
Changes:
- Converted Quota
checkandregion availability listcommands fromRegisterOptions/BindOptions(ParseResult)to[Option]-attributed POCO options +ValidateOptions. - Removed legacy
QuotaOptionDefinitionsand tool-levelGlobalUsings.csin favor of explicit imports and new option binding. - Updated related helpers (primary constructors, minor cleanups) and added an Azure MCP Server changelog entry.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.Tests/Commands/Usage/CheckCommandTests.cs | Switches test base class to subscription-aware unit test base. |
| tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.Tests/Commands/Region/AvailabilityListCommandTests.cs | Updates test base class and adjusts invalid input testing. |
| tools/Azure.Mcp.Tools.Quota/src/Services/Util/Usage/ContainerAppUsageChecker.cs | Minor cast style cleanup when mapping quota values. |
| tools/Azure.Mcp.Tools.Quota/src/Services/Util/JsonElementHelper.cs | Adds explicit System.Text.Json using after removing global usings. |
| tools/Azure.Mcp.Tools.Quota/src/Services/Util/AzureUsageChecker.cs | Adds explicit System.Text.Json using after removing global usings. |
| tools/Azure.Mcp.Tools.Quota/src/Services/Util/AzureRegionChecker.cs | Refactors to primary constructors + minor list creation cleanup. |
| tools/Azure.Mcp.Tools.Quota/src/Options/Usage/CheckOptions.cs | Migrates options to [Option] attributes + ISubscriptionOption. |
| tools/Azure.Mcp.Tools.Quota/src/Options/Region/AvailabilityListOptions.cs | Migrates options to [Option] attributes + ISubscriptionOption. |
| tools/Azure.Mcp.Tools.Quota/src/Options/QuotaOptionDefinitions.cs | Deletes legacy System.CommandLine option definitions. |
| tools/Azure.Mcp.Tools.Quota/src/GlobalUsings.cs | Removes tool-scoped global using directives no longer needed. |
| tools/Azure.Mcp.Tools.Quota/src/Commands/Usage/CheckCommand.cs | Converts to SubscriptionCommand<TOptions, TResult> + ValidateOptions. |
| tools/Azure.Mcp.Tools.Quota/src/Commands/Region/AvailabilityListCommand.cs | Converts to SubscriptionCommand<TOptions, TResult> + ValidateOptions. |
| tools/Azure.Mcp.Tools.Quota/src/Commands/QuotaJsonContext.cs | Simplifies JsonSerializerContext to file-scoped declaration. |
| servers/Azure.Mcp.Server/changelog-entries/1784217749433.yaml | Adds changelog entry for Quota tool breaking change note. |
RickWinter
reviewed
Jul 16, 2026
RickWinter
left a comment
Member
There was a problem hiding this comment.
This PR migrates the Quota commands to attribute-based option binding. The resource-type migration drops an accepted CLI input form, so that compatibility regression needs to be addressed before merge.
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 Quota 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