Skip to content

Fix to create and update sql db with correct sku parameters when provided#925

Merged
joshfree merged 4 commits intomainfrom
operationprompts
Oct 23, 2025
Merged

Fix to create and update sql db with correct sku parameters when provided#925
joshfree merged 4 commits intomainfrom
operationprompts

Conversation

@achyuth-ms
Copy link
Copy Markdown
Member

@achyuth-ms achyuth-ms commented Oct 22, 2025

What does this PR do?

Fix to create and update sql db with correct sku parameters when provided by user
Commands:
azmcp sql database create
azmcp sql database update

GitHub issue number?

#856

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
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/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
    • 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 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

Copilot AI review requested due to automatic review settings October 22, 2025 18:31
@achyuth-ms achyuth-ms changed the title Fix to create and update sql db with correct sku parameters when provided by user Fix to create and update sql db with correct sku parameters when provided Oct 22, 2025
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 fixes SKU parameter handling in SQL database create and update commands to correctly use user-provided SKU values. The fix addresses issue #856 by ensuring that when users specify SKU parameters (name, tier, capacity), they are properly applied instead of being overridden by existing database values during updates.

Key changes:

  • Modified SKU parameter binding to use proper option names instead of constant strings
  • Updated SKU handling logic in UpdateDatabaseAsync to reset conflicting properties when SKU name changes
  • Added comprehensive unit tests covering various SKU tier transitions (Basic, Standard, Premium)

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SqlOptionDefinitions.cs Changed ZoneRedundant option type from bool to bool? to support nullable values
DatabaseCreateCommand.cs Fixed option binding to use .Name property from option definitions instead of string constants
DatabaseUpdateCommand.cs Fixed option binding to use .Name property from option definitions instead of string constants
SqlService.cs Updated SKU update logic to properly reset tier/capacity/family/size when SKU name changes, and added logging for SKU configuration
DatabaseCreateCommandTests.cs Added tests for database creation with null, Basic, Standard, and Premium SKU values
DatabaseUpdateCommandTests.cs Added tests for authorization failures and various SKU tier update scenarios

Comment thread tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs
@achyuth-ms
Copy link
Copy Markdown
Member Author

image image

@achyuth-ms
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/Options/SqlOptionDefinitions.cs
@ericshape
Copy link
Copy Markdown
Member

it seems all the pipeline passed.

Comment thread servers/Azure.Mcp.Server/CHANGELOG.md Outdated
Copy link
Copy Markdown
Member

@ericshape ericshape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase and ask MCP reviewer to review

Copy link
Copy Markdown
Member

@ericshape ericshape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve for rebase

@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure MCP Server Oct 23, 2025
@joshfree joshfree merged commit d9cc31b into main Oct 23, 2025
22 checks passed
@joshfree joshfree deleted the operationprompts branch October 23, 2025 00:25
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Oct 23, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The azmcp_sql_db_update tool returns success but the SQL database SKU is not changed

4 participants