Skip to content

Migrate Key Vault tools to new tool design#3080

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

Migrate Key Vault tools to new tool design#3080
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateKeyVaultToolsToNewDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates Key Vault 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 14:42
@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

This pull request migrates the Azure Key Vault toolset to the newer option-binding design (options declared via [Option] attributes and bound through the shared binder), updating commands, options, and tests accordingly.

Changes:

  • Refactors Key Vault commands to use the SubscriptionCommand<TOptions, TResult> pattern and ISubscriptionResolver, removing manual RegisterOptions / BindOptions logic.
  • Replaces legacy Key Vault option definitions with attribute-based option POCOs, and introduces strongly-typed response models (*Details) registered in the Key Vault JSON source-gen context.
  • Updates Key Vault unit tests to use the subscription-aware test base and new result model shapes.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Kusto/src/Azure.Mcp.Tools.Kusto.csproj Updates core project reference path and removes System.CommandLine package reference.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretGetCommandTests.cs Moves to subscription-aware test base.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretCreateCommandTests.cs Moves to subscription-aware test base and updates deserialization target type.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyGetCommandTests.cs Moves to subscription-aware test base.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyCreateCommandTests.cs Moves to subscription-aware test base and updates deserialization target type / validation assertions.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateImportCommandTests.cs Moves to subscription-aware test base and removes env-dependent skip logic.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateGetCommandTests.cs Moves to subscription-aware test base.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateCreateCommandTests.cs Moves to subscription-aware test base and updates validation assertions.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Admin/AdminSettingsGetCommandTests.cs Updates validation scenarios and removes env-var subscription handling.
tools/Azure.Mcp.Tools.KeyVault/src/Services/KeyVaultService.cs Simplifies construction and uses TenantService for HTTP client creation and cloud selection.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Secret/SecretGetOptions.cs Converts to attribute-based options (Secret), sealed type.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Secret/SecretCreateOptions.cs Converts to attribute-based options with required members (Secret, Value).
tools/Azure.Mcp.Tools.KeyVault/src/Options/KeyVaultOptionDescriptions.cs Adds shared option description constants for Key Vault-specific options.
tools/Azure.Mcp.Tools.KeyVault/src/Options/KeyVaultOptionDefinitions.cs Removes legacy System.CommandLine option definitions.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Key/KeyGetOptions.cs Converts to attribute-based options (Key, IncludeManaged).
tools/Azure.Mcp.Tools.KeyVault/src/Options/Key/KeyCreateOptions.cs Converts to attribute-based options with required members (Key, KeyType).
tools/Azure.Mcp.Tools.KeyVault/src/Options/Certificate/CertificateImportOptions.cs Converts to attribute-based options with required members (Certificate, CertificateData).
tools/Azure.Mcp.Tools.KeyVault/src/Options/Certificate/CertificateGetOptions.cs Converts to attribute-based options (Certificate).
tools/Azure.Mcp.Tools.KeyVault/src/Options/Certificate/CertificateCreateOptions.cs Converts to attribute-based options with required member (Certificate).
tools/Azure.Mcp.Tools.KeyVault/src/Options/BaseKeyVaultOptions.cs Replaces inheritance-based options with explicit [Option] / [OptionContainer] properties and ISubscriptionOption.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Admin/AdminSettingsGetOptions.cs Removes now-unnecessary options type.
tools/Azure.Mcp.Tools.KeyVault/src/Models/SecretDetails.cs Introduces response model for secret details.
tools/Azure.Mcp.Tools.KeyVault/src/Models/KeyDetails.cs Introduces response model for key details.
tools/Azure.Mcp.Tools.KeyVault/src/Models/CertificateDetails.cs Introduces response model for certificate details.
tools/Azure.Mcp.Tools.KeyVault/src/GlobalUsings.cs Removes global System.CommandLine using.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs Migrates to new command base and new result model types.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretCreateCommand.cs Migrates to new command base and returns SecretDetails.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/KeyVaultJsonContext.cs Updates source-gen registrations to new model/result types.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs Migrates to new command base and new result model types.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyCreateCommand.cs Migrates to new command base and returns KeyDetails.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateImportCommand.cs Migrates to new command base and returns CertificateDetails.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs Migrates to new command base and new result model types.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateCreateCommand.cs Migrates to new command base and returns CertificateDetails.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Admin/AdminSettingsGetCommand.cs Migrates to new command base and new options binding.
tools/Azure.Mcp.Tools.KeyVault/src/Azure.Mcp.Tools.KeyVault.csproj Updates core project reference path and removes System.CommandLine package reference.
servers/Azure.Mcp.Server/changelog-entries/1784299285211.yaml Adds breaking-change note for Key Vault parameter removals.

Comment thread tools/Azure.Mcp.Tools.Kusto/src/Azure.Mcp.Tools.Kusto.csproj
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