-
Notifications
You must be signed in to change notification settings - Fork 339
[ONBOARD] Add Support for Microsoft.FileShares Resource Provider to Azure MCP Server #1449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* Add Azure File Shares toolset and documentation Introduced the Azure File Shares toolset with 11 commands for managing file shares, snapshots, planning information, and private endpoint connections. Updated consolidated-tools.json, documentation, and changelogs to reflect new capabilities. Registered the new toolset in the solution and server startup. Added comprehensive command reference, implementation status, and supporting test projects. * Refactor FileShares commands and models structure Removed BaseFileSharesCommand and options classes, replaced command implementations with stubs inheriting from SubscriptionCommand. Updated FileShareListCommand to use new service and result model. Moved and renamed several model files to use schema-based naming. Deleted FileSharesJsonContext and related serialization attributes. This refactor prepares the codebase for a new command and model structure. * Expand FileShares test resources and live tests Enhanced the Bicep template to provision two file shares, two snapshots, a private endpoint, and related role assignments for more comprehensive testing. Updated the post-deployment script to output new resource details. Rewrote live tests to cover listing, retrieving, and snapshot operations for the new resource structure. * Expand and improve unit tests for FileShares commands Refactors and significantly expands unit tests for FileShareListCommand, FileShareGetLimitsCommand, FileShareGetProvisioningRecommendationCommand, and FileShareGetUsageDataCommand. Adds comprehensive coverage for command initialization, option binding, execution, error handling, and input validation, including tests for tenant ID, various parameter combinations, and service exception scenarios. Improves test clarity and reliability by using dependency injection, NSubstitute, and explicit assertions. * Refactor test projects and improve test setup Updated project references and package dependencies for both LiveTests and UnitTests projects. Consolidated and expanded global usings to reduce redundancy in test files. Added AssemblyAttributes.cs to UnitTests for environment variable cleanup and xUnit collection behavior. Refactored test classes to use new base classes and improved test coverage with additional assertions. * Update test namespaces and add body sanitizer to FileShares tests Replaces Azure.Mcp.Core.Tests references with Azure.Mcp.Tests in test files and updates global usings accordingly. Adds a BodyRegexSanitizer to FileSharesCommandTests to sanitize URLs in test recordings. Removes redundant XML doc comments from test methods and updates test class constructor to accept TestProxyFixture. * Update FileShares test infra and improve test assertions Refactored Bicep test resources to use explicit 'eastus' location and updated FileShare resources to use NFS protocol and new property schema. Enhanced test PowerShell script parameters for flexibility. Improved C# test assertions to check for non-null JSON value kinds and match expected resource names. * Add template validation before test resource deployment Introduces validation of deployment templates in New-TestResources.ps1 to catch errors before actual deployment. Improves error reporting and debugging output for failed validations. Also updates Deploy-TestResources.ps1 to pass the Force parameter explicitly. * Update .gitignore and add VSCode MCP config Added new file patterns to .gitignore for Azure.Mcp.Tools.FileShares and StorageSync directories. Introduced .vscode/mcp.json to configure a local Azure MCP server for VSCode.
Introduces the Azure FileShares module, including commands for creating, updating, deleting, and retrieving file shares and snapshots, as well as private endpoint connection management. Updates documentation, changelog, and solution/project files to register the new module. Removes obsolete commands and models, and adds new options and service logic to support the FileShares feature set.
Introduces new informational commands for file share limits, usage data, and provisioning recommendations, along with their supporting models and options. Refactors private endpoint connection commands to provide full CRUD support with improved option binding and result serialization. Enhances file share and snapshot commands to support tags and metadata via JSON, and updates FileSharesService to accept additional parameters for file share creation and update. Also adds new unit tests for the expanded command set.
Eliminated FileShare snapshot resources and related outputs from the Bicep template and test scripts. Updated FileShare resource properties for higher performance, changed service endpoint to 'Microsoft.Storage', set location to 'eastus', and adjusted private endpoint group ID. Cleaned up test output messaging to reflect these changes.
…options Removed the PrivateEndpointConnectionListCommand and its options, merging its functionality into PrivateEndpointConnectionGetCommand, which now lists all connections if no connection name is provided. Updated FileSharesOptionDefinitions to add new file share options (media tier, redundancy, protocol, mount name, allowed subnets, tags, etc.) and adjusted create/update commands to support them. Updated tests and command registration accordingly. Also improved snapshot update options and fixed minor code style issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive support for the Microsoft.FileShares resource provider to the Azure MCP Server, introducing a complete toolset with 16 commands for managing Azure managed file shares, snapshots, and private endpoint connections.
Key Changes:
- New FileShares toolset with 5 file share management commands (get, create, update, delete, check-name-availability)
- 4 snapshot management commands (get, create, update, delete)
- 3 private endpoint connection commands (get, update, delete)
- 3 informational commands (limits, provisioning recommendations, usage data)
- Comprehensive test infrastructure with unit tests, live tests, and Bicep templates
- Integration with consolidated tools and server registration
Reviewed changes
Copilot reviewed 93 out of 93 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test-resources.bicep | Bicep template for test infrastructure including VNet, file shares, and private endpoints |
| test-resources-post.ps1 | Post-deployment script for test resource configuration |
| Unit test files (11 files) | Basic command initialization tests for all commands |
| LiveTests/FileSharesCommandTests.cs | Comprehensive live integration tests with CRUD operations |
| Services/FileSharesService.cs | Service implementation using Azure Resource Manager SDK |
| Services/IFileSharesService.cs | Service interface with 15 methods |
| Command files (11 files) | Command implementations for all operations |
| Options files (11 files) | Options classes for command parameters |
| Models files (9 files) | Data models and DTOs for responses |
| Azure.Mcp.Tools.FileShares.csproj | Project configuration with Azure.ResourceManager.FileShares package |
| FileSharesSetup.cs | Area setup for DI and command registration |
| Program.cs | Integration into server with FileSharesSetup registration |
| consolidated-tools.json | Tool consolidation mappings for 4 tool groups |
| azmcp-commands.md | Documentation for all 16 commands |
| README.md | Updated service list with FileShares |
| CHANGELOG.md | Release notes for FileShares module addition |
| Directory.Packages.props | Azure.ResourceManager.FileShares package reference |
tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotDeleteCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs
Outdated
Show resolved
Hide resolved
...s/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs
Outdated
Show resolved
Hide resolved
Refined Azure FileShares documentation and command references to match current implementation, including removal of list commands and update to private endpoint connection commands. Added dynamic code attributes in ServiceCollectionExtensions, streamlined deployment scripts, and deleted obsolete storagesync.txt.
Standardized command titles in FileShareCheckNameAvailabilityCommand, FileShareDeleteCommand, and SnapshotDeleteCommand to use 'File Share' instead of 'FileShare' or 'Snapshot'. Updated azmcp-commands.md to align command metadata and remove or correct operation property comments for accuracy and consistency.
Introduces assets.json to specify asset repository and tagging information for Azure.Mcp.Tools.FileShares.LiveTests. This file will be used to manage test assets and their metadata.
Introduced a new section for Azure FileShares in e2eTestPrompts.md, including test prompts for file share creation, deletion, retrieval, limits, name availability, private endpoint connections, provisioning recommendations, snapshots, updates, and usage. This expands coverage for Azure FileShares tools in end-to-end testing.
Deleted Commands.md, IMPLEMENTATION_STATUS.md, and IMPLEMENTATION_SUMMARY.md from Azure.Mcp.Tools.FileShares. These files contained technical reference, implementation status, and summary documentation for the FileShares toolset.
Deleted the README.md file for Azure.Mcp.Tools.FileShares, removing documentation for available commands, architecture, and contribution guidelines.
Adjusted unit tests to match updated command title strings, ensuring consistency with new naming conventions for file share and snapshot commands.
Added update and delete operations to mappedToolList for file shares and snapshots, and removed some list operations. Updated the description for snapshot management to reflect new capabilities.
Renamed 'fileshares_fileshare_checkname' to 'fileshares_fileshare_check-name-availability' in consolidated-tools.json to reflect the correct operation key.
Updated tool metadata for file share and snapshot commands to accurately reflect destructive and idempotent properties. Split informational commands into a dedicated subgroup in FileSharesSetup. Revised consolidated-tools.json to clarify tool descriptions, mapped tool lists, and metadata for Azure File Shares and related operations.
Corrected the Destructive and Idempotent flags for several azmcp fileshare and private endpoint connection commands in the documentation to accurately reflect their behavior.
Deleted all code, options, models, and tests related to FileShares private endpoint connection commands (get, update, delete). Updated documentation, changelog, and consolidated-tools.json to remove references to these commands. Informational commands are now registered directly under the fileshares group. Refactored FileSharesService to remove unsupported private endpoint connection methods and updated usage of Azure.ResourceManager.Resources. Added tenant parameter to informational commands for consistency.
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/FileShareSnapshotGetOptions.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/FileShareSnapshotListOptions.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Models/FileShareSnapshotInfo.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs
Outdated
Show resolved
Hide resolved
...s/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetLimitsCommand.cs
Outdated
Show resolved
Hide resolved
...Tools.FileShares/src/Commands/Informational/FileShareGetProvisioningRecommendationCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs
Show resolved
Hide resolved
Replaces the update logic for file shares to use a new PatchFileShareAsync method, allowing partial updates without requiring all properties. Removes unused snapshot options and data schema files. Updates command IDs for consistency, adds copyright headers, and improves documentation and command metadata.
Reorders and restores the Azure.Mcp.Tools.FileShares project entries in AzureMcp.sln to maintain correct grouping and configuration. Also removes duplicate and obsolete project configuration and nesting entries to clean up the solution structure.
Replaced custom resource group extraction logic in FileShareInfo and FileShareSnapshotInfo with Azure.Core.ResourceIdentifier.Parse. This simplifies the code and leverages the Azure SDK for resource parsing.
Added PR labels, service labels, and service owners for /tools/Azure.Mcp.Tools.FileShares/ and /tools/Azure.Mcp.Tools.StorageSync/. Also made minor formatting adjustments to existing service owner comments.
Deleted descriptive metadata comments (e.g., Destructive, Idempotent, ReadOnly) from several azmcp fileshares command examples in the documentation for improved clarity and conciseness.
What does this PR do?
Microsoft.FileShares is the Azure Resource Provider for managing Azure File Shares and related operations such as snapshots, limits, and provisioning recommendations. This MCP integration exposes CLI commands aligned with the REST API operations defined in the Swagger specification.
This PR adds comprehensive support for the Microsoft.FileShares resource provider to Azure MCP Server, enabling AI agents to manage Azure File Shares, snapshots, and private endpoint connections through 15 commands across four operational categories.
Changes
New Toolset: Azure.Mcp.Tools.FileShares
Implemented a complete MCP toolset with 15 commands across four categories:
📁 File Share Management (5 commands)
azmcp fileshares fileshare get- Get file share detailsazmcp fileshares fileshare create- Create new file shareazmcp fileshares fileshare update- Update file share propertiesazmcp fileshares fileshare delete- Delete file shareazmcp fileshares fileshare checknameavailability- Validate name availability📸 Snapshot Operations (4 commands)
azmcp fileshares snapshot get- Get snapshot detailsazmcp fileshares snapshot create- Create file share snapshotazmcp fileshares snapshot update- Update snapshot propertiesazmcp fileshares snapshot delete- Delete snapshot📊 Informational Commands (3 commands)
azmcp fileshares fileshare getlimits- Get regional limits and quotasazmcp fileshares fileshare getprovisioningrecommendation- Get provisioning recommendationsazmcp fileshares fileshare getusagedata- Retrieve usage metrics and analyticsArchitecture & Implementation
IFileSharesServiceinterface withFileSharesServiceimplementation using Azure.ResourceManager APIsBaseFileSharesCommand<T>base classKey Files Added
Test Infrastructure
Unit Tests: Comprehensive test coverage for all commands including:
Live Tests:
test-resources.bicep) deploys test infrastructuretest-resources-post.ps1) configures resourcesAdditional Context
This implementation follows the patterns established in KeyVault and Storage toolsets and adheres to all standards outlined in new-command.md:
✅ Uses primary constructors for dependency injection
✅ AOT-safe with complete JSON serialization context registration
✅ Sealed command classes with proper ToolMetadata
✅ Static option definitions in
FileSharesOptionDefinitions✅ Comprehensive error handling with contextual messages
✅ Complete documentation (README.md, Commands.md)
✅ Full test coverage with live test infrastructure
✅ Follows parameter naming standards (
subscription,resourceGroup)✅ Proper separation of concerns (Commands, Options, Services, Models)
GitHub issue number?
[ONBOARD] Add Support for Microsoft.FileShares Resource Provider to Azure MCP Server #1355
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline