Open
Conversation
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.
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.
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.
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.
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.
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.
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.
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.
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.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive Azure File Shares toolset for managing Azure File Shares resources through the MCP server. The implementation includes 11 commands covering file share management, snapshot operations, informational queries, and private endpoint connections.
Key Changes:
- Complete File Shares toolset with 11 commands (list, get, create, delete, check name, snapshots, limits, recommendations, usage data, private endpoint connections)
- Service layer implementation using Azure Resource Graph and ARM clients
- Comprehensive unit and live test coverage
- Integration with existing MCP infrastructure
Reviewed changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test-resources.bicep | Bicep template defining test infrastructure with file shares, snapshots, virtual network, and private endpoints |
| test-resources-post.ps1 | Post-deployment script that extracts and displays deployment outputs |
| Unit test files (3) | Tests for informational commands (usage, limits, recommendations) |
| FileShareListCommandTests.cs | Unit tests for file share list command |
| FileSharesCommandTests.cs | Live integration tests for file shares operations |
| IFileSharesService.cs | Service interface defining all file share operations |
| FileSharesService.cs | Service implementation using ARM and Resource Graph |
| Command files (11) | Command implementations (1 complete, 10 stubs) |
| Models (multiple) | Data models for file shares, snapshots, and related resources |
| FileSharesSetup.cs | Area setup registering services and commands |
| Program.cs | Registration of FileSharesSetup in server |
| consolidated-tools.json | Tool metadata for consolidated mode |
| Documentation files | README, CHANGELOG, azmcp-commands.md updates |
| Solution file | Added FileShares projects to solution |
| var operation = await armClient.GetGenericResources() | ||
| .CreateOrUpdateAsync(WaitUntil.Completed, fileShareId, fileShareData, cancellationToken); | ||
|
|
||
| var createdResource = operation.Value; |
There was a problem hiding this comment.
This assignment to createdResource is useless, since its value is never read.
Comment on lines
+315
to
+316
| var operation = await armClient.GetGenericResources() | ||
| .CreateOrUpdateAsync(WaitUntil.Completed, snapshotResourceId, snapshotData, cancellationToken); |
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?
[Provide a clear, concise description of the changes][Any additional context, screenshots, or information that helps reviewers]GitHub issue number?
[Link to the GitHub issue this PR addresses]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