Skip to content

Add azmcp sql db create and azmcp sql db delete commands and unit tests#434

Merged
ericshape merged 9 commits intomicrosoft:mainfrom
ericshape:sql_db_crud
Sep 17, 2025
Merged

Add azmcp sql db create and azmcp sql db delete commands and unit tests#434
ericshape merged 9 commits intomicrosoft:mainfrom
ericshape:sql_db_crud

Conversation

@ericshape
Copy link
Copy Markdown
Member

@ericshape ericshape commented Sep 14, 2025

What does this PR do?

Add azmcp sql db create and azmcp sql db delete commands and unit tests

GitHub issue number?

#126 #239 #309

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
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • 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
    • Updated command list in /docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • 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
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /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

@ericshape ericshape added this to the 2025-09 milestone Sep 14, 2025
@ericshape ericshape self-assigned this Sep 14, 2025
@ericshape ericshape marked this pull request as ready for review September 15, 2025 05:10
@ericshape ericshape requested a review from a team as a code owner September 15, 2025 05:10
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 SQL database create and delete functionality to the Azure MCP Server. The implementation includes comprehensive unit tests and live tests to ensure reliability of the new database management operations.

  • Adds azmcp sql db create command with configurable database parameters (SKU, collation, size, etc.)
  • Adds azmcp sql db delete command with idempotent behavior
  • Includes comprehensive unit and live test coverage for both operations

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
DatabaseCreateCommand.cs New command implementation for creating SQL databases with configurable options
DatabaseDeleteCommand.cs New command implementation for deleting SQL databases with idempotent behavior
DatabaseCreateOptions.cs Options class for database creation parameters
DatabaseDeleteOptions.cs Options class for database deletion (extends base options)
DatabaseCreateCommandTests.cs Comprehensive unit tests for database creation scenarios
DatabaseDeleteCommandTests.cs Comprehensive unit tests for database deletion scenarios
SqlService.cs Service implementation for create and delete database operations
ISqlService.cs Interface additions for new database operations
SqlOptionDefinitions.cs New option definitions for database configuration parameters
SqlSetup.cs Registration of new commands in the command hierarchy
SqlJsonContext.cs JSON serialization context updates for new result types
SqlCommandTests.cs Live tests for database operations
Documentation files Updated documentation with new command descriptions and examples
Comments suppressed due to low confidence (1)

tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs:470

  • This throw statement appears to be orphaned and doesn't belong to any catch block in the visible context. It should be removed or properly associated with exception handling logic.
            throw;

Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs Outdated
@joshfree joshfree moved this from Untriaged to Not Started in Azure MCP Server Sep 15, 2025
Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs Outdated
@github-project-automation github-project-automation Bot moved this from Not Started to In Progress in Azure MCP Server Sep 17, 2025
@ericshape
Copy link
Copy Markdown
Member Author

/azp run mcp - pullrequest - live

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Sql/src/Options/Database/DatabaseDeleteOptions.cs Outdated
@ericshape ericshape enabled auto-merge (squash) September 17, 2025 23:03
@ericshape ericshape merged commit cac8935 into microsoft:main Sep 17, 2025
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Sep 17, 2025
@ericshape ericshape deleted the sql_db_crud branch September 17, 2025 23:11
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Sep 27, 2025
… tests (microsoft#434)

* Add sql db create command

* add ending spaces

* add sql db delete commands

* update docs and changelog

* address comments and update option usage after revbase

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add azmcp sql db delete impl and test Add azmcp sql db create impl and test

6 participants