-
Notifications
You must be signed in to change notification settings - Fork 271
Add azmcp sql server firewall-rule create and delete commands and unit tests
#121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/azp run azure - mcp |
|
No pipelines are associated with this pull request. |
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This reverts commit 1504bd8.
This reverts commit 8e25827.
… 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 <[email protected]> * remove explict reference Co-authored-by: Copilot <[email protected]> * remove explict reference Co-authored-by: Copilot <[email protected]> * Revert "remove explict reference" This reverts commit 1504bd8. * Revert "remove explict reference" This reverts commit 8e25827. --------- Co-authored-by: Copilot <[email protected]>
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