Skip to content

Migrate File Shares tools to new tool design#3084

Open
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateFileSharesToolsToNewDesign
Open

Migrate File Shares tools to new tool design#3084
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateFileSharesToolsToNewDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates File Shares 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 Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 17:45
@alzimmermsft
alzimmermsft requested review from a team and ankushbindlish2 as code owners July 17, 2026 17:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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

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 + FileSharesOptionDefinitions usage with [Option]-decorated option POCOs implementing ISubscriptionOption.
  • 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants