-
Notifications
You must be signed in to change notification settings - Fork 342
Files shares onboarding #1443
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?
Files shares onboarding #1443
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.
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 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; |
Copilot
AI
Jan 6, 2026
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.
This assignment to createdResource is useless, since its value is never read.
| var operation = await armClient.GetGenericResources() | ||
| .CreateOrUpdateAsync(WaitUntil.Completed, snapshotResourceId, snapshotData, cancellationToken); |
Copilot
AI
Jan 6, 2026
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.
This assignment to operation is useless, since its value is never read.
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