Skip to content

Add support for Azure NetApp Files Accounts create, get, update - #3708

Open
Christian Stump (stumpc) wants to merge 25 commits into
microsoft:mainfrom
stumpc:stumpc/anf-accounts
Open

Christian Stump (stumpc) wants to merge 25 commits into
microsoft:mainfrom
stumpc:stumpc/anf-accounts

Conversation

@stumpc

@stumpc Christian Stump (stumpc) commented Sep 17, 2026 •

Copy link
Copy Markdown

What does this PR do?

This PR is for adding Azure NetAppFiles Account object create/read/update support to the Azure MCP. This includes tools for create, get, and update actions.

GitHub issue number?

#3966

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

Documentation

Azure NetApp Files Documentation: https://learn.microsoft.com/en-us/azure/azure-netapp-files/

@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.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution Christian Stump (@stumpc)! We will review the pull request and get back to you soon.

@stumpc

Copy link
Copy Markdown
Author

/azp run mcp - pullrequest - live

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 3708 in repo microsoft/mcp

@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.

@stumpc

Copy link
Copy Markdown
Author

I'm still actively figuring out issues I have with getting any of my subscriptions to let me run the recorded test code to generate those fixtures, which that should be the big thing making the builds red at the moment.

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.

🟡 Changes recommended

Recorded tests lack committed playback assets, and an added unit-test file is not included in any test project.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR adds Azure NetApp Files account management support to the Azure MCP server.

Changes:

  • Adds account create, get, and update commands with validation and ARM integration.
  • Adds unit/live tests and test-resource infrastructure.
  • Registers the toolset and updates documentation, metadata, packaging, and ownership.
File summaries
File Description
.vscode/cspell.json Adds NetApp terminology.
.github/CODEOWNERS Adds tool ownership.
Directory.Packages.props Adds the NetApp SDK package.
Microsoft.Mcp.slnx Registers projects.
servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Registers server projects.
servers/Azure.Mcp.Server/src/Program.cs Registers the toolset.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds consolidated mappings.
servers/Azure.Mcp.Server/README.md Lists Azure NetApp Files support.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds test prompts.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents commands.
servers/Azure.Mcp.Server/changelog-entries/stumpc-netappfiles-account.yaml Adds changelog entry.
tools/Azure.Mcp.Tools.NetAppFiles/src/Azure.Mcp.Tools.NetAppFiles.csproj Defines the tool project.
tools/Azure.Mcp.Tools.NetAppFiles/src/AssemblyInfo.cs Enables test access.
tools/Azure.Mcp.Tools.NetAppFiles/src/NetAppFilesSetup.cs Registers commands and services.
tools/Azure.Mcp.Tools.NetAppFiles/src/Commands/Account/AccountCreateCommand.cs Implements account creation.
tools/Azure.Mcp.Tools.NetAppFiles/src/Commands/Account/AccountGetCommand.cs Implements account retrieval.
tools/Azure.Mcp.Tools.NetAppFiles/src/Commands/Account/AccountUpdateCommand.cs Implements account updates.
tools/Azure.Mcp.Tools.NetAppFiles/src/Commands/NetAppFilesJsonContext.cs Registers JSON models.
tools/Azure.Mcp.Tools.NetAppFiles/src/Models/NetAppFilesAccount.cs Defines the response model.
tools/Azure.Mcp.Tools.NetAppFiles/src/Options/Account/AccountCreateOptions.cs Defines create options.
tools/Azure.Mcp.Tools.NetAppFiles/src/Options/Account/AccountGetOptions.cs Defines get options.
tools/Azure.Mcp.Tools.NetAppFiles/src/Options/Account/AccountUpdateOptions.cs Defines update options.
tools/Azure.Mcp.Tools.NetAppFiles/src/Services/INetAppFilesAccountService.cs Defines the service contract.
tools/Azure.Mcp.Tools.NetAppFiles/src/Services/NetAppFilesAccountService.cs Implements ARM operations.
tools/Azure.Mcp.Tools.NetAppFiles/src/Validation/AccountNameValidator.cs Validates account names.
tools/Azure.Mcp.Tools.NetAppFiles/tests/test-resources.bicep Configures live-test RBAC.
tools/Azure.Mcp.Tools.NetAppFiles/tests/test-resources-post.ps1 Generates test settings.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.Tests/Azure.Mcp.Tools.NetAppFiles.Tests.csproj Defines the test project.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.Tests/assets.json Configures recorded-test assets.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.Tests/NetAppFilesCommandTests.cs Adds recorded live tests.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.Tests/Account/AccountCreateCommandTests.cs Tests account creation.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.Tests/Account/AccountGetCommandTests.cs Tests account retrieval.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.Tests/Account/AccountUpdateCommandTests.cs Tests account updates.
tools/Azure.Mcp.Tools.NetAppFiles/tests/Azure.Mcp.Tools.NetAppFiles.UnitTests/SnapshotPolicy/SnapshotPolicyUpdateCommandTests.cs Adds an unregistered test file.
Review details
  • Files reviewed: 34/34 changed files
  • Comments generated: 7
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Services/NetAppFilesAccountService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Services/NetAppFilesAccountService.cs Outdated
Comment thread servers/Azure.Mcp.Server/README.md Outdated
Id = "a63649c2-caaa-4744-a35b-6a67db0527b7",
Name = "create",
Title = "Create Azure NetApp Files Account",
Description = "Creates an Azure NetApp Files account in a specified resource group and region. Returns the account name, resource ID, location, and provisioning state.",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another one I'm having some trouble with my environment on, as the model I've deployed to run the ToolEvaluationDescriptor against just keeps returning empty strings for some reason and I haven't quite figured out why yet. Getting there though.

Id = "a63649c2-caaa-4744-a35b-6a67db0527b7",
Name = "create",
Title = "Create Azure NetApp Files Account",
Description = "Creates an Azure NetApp Files account in a specified resource group and region. Returns the account name, resource ID, location, and provisioning state.",
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Services/NetAppFilesAccountService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Models/NetAppFilesAccount.cs Outdated
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Commands/Account/AccountCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Services/NetAppFilesAccountService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Models/NetAppFilesAccount.cs
Comment thread tools/Azure.Mcp.Tools.NetAppFiles/src/Options/Account/AccountUpdateOptions.cs Outdated
Comment thread servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Outdated
Comment thread .github/CODEOWNERS Outdated

@KarishmaGhiya KarishmaGhiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I reviewed it against the add-azure-mcp-tools skill checklist and compared it with existing toolsets (Storage, SQL, FileShares, ManagedLustre).

Blocking

  1. AccountCreateCommand metadata (Idempotent = true): Calling create twice with the same account does not give the same result, because the service throws "already exists" on the second call. Storage AccountCreate and SQL ServerCreate use Idempotent = false. Please set it to false and update azmcp-commands.md and consolidated-tools.json to match. The consolidated tool create_or_update_azure_netapp_files_accounts currently reports idempotent: true for both create and update.

  2. NetAppFilesAccountService.CreateAccountAsync existence pre-check: The GetNetAppAccountAsync pre-check adds an extra ARM call and throws InvalidOperationException, which most likely surfaces as a 500 (please verify against the base GetStatusCode). Storage and SQL let ARM return the 409 and map it in GetErrorMessage. Note that CreateOrUpdateAsync would silently update an existing account, so if you want create-only semantics, please keep the check but return a 409. Otherwise remove it.

  3. PR description: Please add the Tool Description Evaluator score (>= 0.4, top 3 ranking) for all three tools, the GitHub issue link, and a link to the Azure NetApp Files docs. The pre-merge checklist is also still unchecked.

Should fix

  1. AccountCreateCommand error handling: GetErrorMessage handles KeyNotFoundException, but there is no GetStatusCode override. get and update have one, so a missing resource group on create returns the wrong status. Please add the same override.

  2. servers/Azure.Mcp.Server/README.md: The NetApp Files entry has no emoji like its neighbors and sits between PostgreSQL and Device Registry, so please move it to a sensible spot. Per the skill (5d), please also add example prompts to the "What can you do" section.

  3. azmcp-commands.md: Please confirm ./eng/scripts/Update-AzCommandsMetadata.ps1 was run, because CI fails without it. The new section also sits before MySQL, so please check alphabetical placement.

Nits and questions

  1. AccountCreateOptions and AccountGetOptions aren't sealed, but AccountUpdateOptions is. Please make them consistent.
  2. Tests: please add a case for updating --nfs-v4-id-domain alone, and check that live tests clean up the accounts they create.
  3. test-resources.bicep only assigns Contributor and outputs an unused NETAPP_ACCOUNT_NAME. Is that output needed?
  4. Please confirm the AOT native build (./eng/scripts/Build-Local.ps1 -BuildNative), dotnet format and cspell all pass.

Positives

  • Fixed, non-revealing error messages and the AccountNameValidator with negative tests are good.

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.

4 participants