Add azmcp sql server firewall-rule create and delete commands and unit tests#121
Merged
ericshape merged 16 commits intomicrosoft:mainfrom Sep 4, 2025
ericshape:main
Merged
Add azmcp sql server firewall-rule create and delete commands and unit tests#121ericshape merged 16 commits intomicrosoft:mainfrom ericshape:main
azmcp sql server firewall-rule create and delete commands and unit tests#121ericshape merged 16 commits intomicrosoft:mainfrom
ericshape:main
Conversation
Member
Author
|
/azp run azure - mcp |
|
No pipelines are associated with this pull request. |
Member
Author
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was
linked to
issues
Sep 3, 2025
Member
Author
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds SQL server firewall rule create and delete commands to the Azure MCP Server, allowing users to manage IP access controls for their Azure SQL servers programmatically through the MCP interface.
- Implements
azmcp sql server firewall-rule createanddeletecommands with comprehensive validation - Adds complete unit test suites for both commands covering various scenarios and error conditions
- Integrates live tests to verify functionality against actual Azure resources
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| FirewallRuleCreateCommand.cs | Implements the create command with IP range validation and error handling |
| FirewallRuleDeleteCommand.cs | Implements the delete command with idempotent behavior |
| FirewallRuleCreateCommandTests.cs | Comprehensive unit tests for the create command |
| FirewallRuleDeleteCommandTests.cs | Comprehensive unit tests for the delete command |
| SqlService.cs | Adds service layer methods for creating and deleting firewall rules |
| ISqlService.cs | Interface definitions for the new firewall rule operations |
| SqlCommandTests.cs | Live integration tests for the new commands |
| SqlSetup.cs | Registers the new commands with the command system |
| Various option/model files | Supporting infrastructure for command parameters and data models |
Comments suppressed due to low confidence (1)
tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs:1
- The variable name
sqlDatabaseis misleading since it's of typeSqlDatabaseData?. Consider renaming tosqlDatabaseDatato better reflect its actual type.
// Copyright (c) Microsoft Corporation.
joshfree
approved these changes
Sep 4, 2025
colbytimm
pushed a commit
to colbytimm/microsoft-mcp
that referenced
this pull request
Sep 27, 2025
… unit tests (microsoft#121) * Add SQL Server firewall rule create and delete commands and unit tests * fix format issue * Delete Azure.Mcp.Tools.Sql.UnitTests.sln.DotSettings.user * Move SqlSetup to AOT compatibility exception section. * fix AOT issue * add docs and update firewall-rule-name in the parameter list * Update CHANGELOG.md * fix failed live test * add delete unit test * add delete firewall rule unit test * remove blank line Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove explict reference Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove explict reference Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Revert "remove explict reference" This reverts commit 1504bd8. * Revert "remove explict reference" This reverts commit 8e25827. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add SQL Server firewall rule create and delete commands and unit tests
azmcp sql server firewall-rule createazmcp sql server firewall-rule deleteGitHub issue number?
#225 #240
Pre-merge Checklist
CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies).\eng\common\spelling\Invoke-Cspell.ps1README.mddocumentation/docs/azmcp-commands.md/docs/e2eTestPrompts.mdToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptscrypto mining, spam, data exfiltration, etc.)/azp run azure - mcpto run Live Test Pipeline