Skip to content

Add azmcp sql server create/delete/show commands and unit tests#312

Merged
ericshape merged 17 commits intomicrosoft:mainfrom
ericshape:sql_server_crud
Sep 15, 2025
Merged

Add azmcp sql server create/delete/show commands and unit tests#312
ericshape merged 17 commits intomicrosoft:mainfrom
ericshape:sql_server_crud

Conversation

@ericshape
Copy link
Copy Markdown
Member

@ericshape ericshape commented Sep 4, 2025

What does this PR do?

Add azmcp sql server create/delete/show commands and unit tests

  • azmcp sql server create
  • azmcp sql server delete
  • azmcp sql server show

GitHub issue number?

#239

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 CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
    • Spelling check passes: .\eng\common\spelling\Invoke-Cspell.ps1
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated README.md documentation
    • Updated command list in /docs/azmcp-commands.md
    • Updated test prompts in /docs/e2eTestPrompts.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
  • 👉 For Community (non-Azure 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 4, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in Azure MCP Server Sep 4, 2025
@ericshape ericshape linked an issue Sep 4, 2025 that may be closed by this pull request
@ericshape ericshape self-assigned this Sep 4, 2025
@ericshape ericshape moved this from Untriaged to In Progress in Azure MCP Server Sep 4, 2025
@ericshape ericshape marked this pull request as ready for review September 13, 2025 23:58
@ericshape ericshape requested a review from a team as a code owner September 13, 2025 23:58
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 comprehensive SQL server management capabilities to the Azure MCP Tools, implementing create, show, and delete commands for Azure SQL servers along with their corresponding unit tests.

  • Implements three new SQL server commands: create, delete, and show operations
  • Adds comprehensive unit tests covering various scenarios including validation, error handling, and edge cases
  • Updates documentation and command listings to reflect the new functionality

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
SqlSetup.cs Registers the new server commands in the command hierarchy
ISqlService.cs Adds interface definitions for server CRUD operations
SqlService.cs Implements server create, show, and delete functionality using Azure ARM clients
SqlOptionDefinitions.cs Defines command-line options for server operations
ServerCreateCommand.cs Command implementation for creating SQL servers
ServerDeleteCommand.cs Command implementation for deleting SQL servers with safety warnings
ServerShowCommand.cs Command implementation for retrieving server details
Models/SqlServer.cs Data model representing SQL server properties
Various test files Comprehensive unit tests for all three commands
Documentation files Updates to README, command documentation, and test prompts

@microsoft microsoft deleted a comment from Copilot AI Sep 14, 2025
ericshape and others added 4 commits September 13, 2025 17:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jongio
Copy link
Copy Markdown
Contributor

jongio commented Sep 15, 2025

/azp run mcp - pullrequest - live

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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

@ericshape ericshape enabled auto-merge (squash) September 15, 2025 18:11
@ericshape
Copy link
Copy Markdown
Member Author

@xiangyan99 I have resloved all comments, can I have a re-approval from your side to merge? Thanks~

@ericshape ericshape merged commit c7bc3b8 into microsoft:main Sep 15, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure MCP Server Sep 15, 2025
@ericshape ericshape deleted the sql_server_crud branch September 17, 2025 23:11
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Sep 27, 2025
…crosoft#312)

* add sql server create/delete/show command impl

* fix spell issue

* add docs to the md files

* Add live tests for SQL server create, show, and delete

* fix live test

* address commends and rebase

* fix server crud live test

* delete live test due to test sub id cannot get resource

* Update CHANGELOG.md

* Update docs/azmcp-commands.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* address comment

* fix the build error

* update tool metadata info

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

5 participants