Migrate File Shares tools to new tool design#3084
Open
alzimmermsft wants to merge 1 commit into
Open
Conversation
alzimmermsft
requested review from
KarishmaGhiya,
hallipr,
jairmyree,
jongio,
tmeschter,
vukelich and
xirzec
July 17, 2026 17:45
|
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
Migrates the Azure File Shares toolset to the newer command/options design by removing manual option registration/binding and switching to [Option]-attribute-based option binding, along with updating commands, models, and tests to match the new patterns.
Changes:
- Replaced legacy
RegisterOptions/BindOptions+FileSharesOptionDefinitionsusage with[Option]-decorated option POCOs implementingISubscriptionOption. - Updated File Shares commands to the newer
SubscriptionCommand<TOptions, TResult>pattern and aligned response/result shapes. - Updated unit/integration tests and removed now-unnecessary global usings and System.CommandLine references.
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Snapshot/SnapshotUpdateCommandTests.cs | Switches unit test base to subscription-aware test base and updates imports. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Snapshot/SnapshotGetCommandTests.cs | Switches unit test base to subscription-aware test base and updates imports. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Snapshot/SnapshotDeleteCommandTests.cs | Switches unit test base to subscription-aware test base and updates imports. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Snapshot/SnapshotCreateCommandTests.cs | Switches unit test base to subscription-aware test base and updates imports. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommandTests.cs | Switches unit test base to subscription-aware test base and updates imports. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/PrivateEndpointConnection/PrivateEndpointConnectionGetCommandTests.cs | Switches unit test base to subscription-aware test base and updates imports. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Informational/FileShareGetUsageDataCommandTests.cs | Switches unit test base and updates imports for new command/options pattern. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Informational/FileShareGetProvisioningRecommendationCommandTests.cs | Switches unit test base and updates imports for new command/options pattern. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/Informational/FileShareGetLimitsCommandTests.cs | Switches unit test base and updates imports for new command/options pattern. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/GlobalUsings.cs | Removes test project global usings (migrated to per-file usings). |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileSharesCommandTests.cs | Updates snapshot delete invocation/response assertions to match new option/response shape. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareUpdateCommandTests.cs | Updates tests to new option binding/test harness helpers and renames option fields. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareGetCommandTests.cs | Switches unit test base and updates imports for new command/options pattern. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareDeleteCommandTests.cs | Switches unit test base and updates imports for new command/options pattern. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareCreateCommandTests.cs | Updates tests to new option binding/test harness helpers and renames option fields. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareCheckNameAvailabilityCommandTests.cs | Switches unit test base and updates imports for new command/options pattern. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/assets.json | Updates recorded test assets tag reference. |
| tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/AssemblyAttributes.cs | Adds explicit Xunit using after removing global usings. |
| tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs | Updates usings to align with model namespace changes (no global using reliance). |
| tools/Azure.Mcp.Tools.FileShares/src/Services/FileSharesService.cs | Adjusts usings and updates return construction to match new record-based models. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotUpdateOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO with required fields. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotGetOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotDeleteOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO with required fields. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO with required fields. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionUpdateOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO with required fields. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionGetOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetUsageDataOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO with required fields. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetProvisioningRecommendationOptions.cs | Converts to [Option]-based options; renames storage option to ProvisionedStorageInGiB. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetLimitsOptions.cs | Converts to [Option]-based, ISubscriptionOption-implementing POCO with required fields. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileSharesOptionDescriptions.cs | Adds centralized string constants for option descriptions used by [Option] attributes. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileSharesOptionDefinitions.cs | Removes legacy System.CommandLine Option<> definitions. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareUpdateOptions.cs | Adds new [Option]-based options type for update command. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareListOptions.cs | Removes legacy list options type (previously inherited base options). |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareGetOptions.cs | Converts to [Option]-based options and renames FileShareName to Name. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareDeleteOptions.cs | Converts to [Option]-based options and renames FileShareName to Name. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCreateOptions.cs | Converts to [Option]-based create options (split from prior create-or-update options). |
| tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCheckNameAvailabilityOptions.cs | Converts to [Option]-based options and renames FileShareName to Name. |
| tools/Azure.Mcp.Tools.FileShares/src/Options/BaseFileSharesOptions.cs | Removes legacy shared base options type. |
| tools/Azure.Mcp.Tools.FileShares/src/Models/PrivateEndpointConnectionDataSchema.cs | Removes unused model import after refactors. |
| tools/Azure.Mcp.Tools.FileShares/src/Models/FileShareUsageDataResult.cs | Converts usage data models to records. |
| tools/Azure.Mcp.Tools.FileShares/src/Models/FileShareProvisioningRecommendationResult.cs | Converts recommendation result model to record. |
| tools/Azure.Mcp.Tools.FileShares/src/Models/FileShareLimitsResult.cs | Converts limits/provisioning constants to records. |
| tools/Azure.Mcp.Tools.FileShares/src/GlobalUsings.cs | Removes src global usings (replaced with explicit file usings). |
| tools/Azure.Mcp.Tools.FileShares/src/FileSharesJsonContext.cs | Simplifies JSON context declaration to file-scoped form. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotUpdateCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotGetCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotDeleteCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and updates response result type. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotCreateCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionGetCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetProvisioningRecommendationCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetLimitsCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareUpdateCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and updates option field names. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareGetCommand.cs | Migrates to SubscriptionCommand<TOptions, TResult> and adds option validation for --resource-group/--name. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCreateCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> and removes manual binding. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/BaseFileSharesCommand.cs | Removes legacy base command abstraction (no longer needed with new pattern). |
| tools/Azure.Mcp.Tools.FileShares/src/Azure.Mcp.Tools.FileShares.csproj | Aligns ProjectReference to $(RepoRoot) and removes direct System.CommandLine dependency. |
| using Azure.Mcp.Core.Commands.Subscription; | ||
| using Azure.Mcp.Core.Services.Azure.Subscription; | ||
| using Azure.Mcp.Tools.FileShares.Models; | ||
| using Azure.Mcp.Tools.FileShares.Options; |
| using Azure.Mcp.Tools.FileShares.Services; | ||
| using Microsoft.Extensions.Logging; | ||
| using Microsoft.Mcp.Core.Commands; | ||
| using Microsoft.Mcp.Core.Extensions; |
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 File Shares 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