Skip to content

{MySQL} Update advanced threat protection payload structure to use pr… - #34016

Open
ShawnX (ShawnXxy) wants to merge 1 commit into
Azure:devfrom
ShawnXxy:fix/mysql-advanced-threat-protection-payload
Open

{MySQL} Update advanced threat protection payload structure to use pr…#34016
ShawnX (ShawnXxy) wants to merge 1 commit into
Azure:devfrom
ShawnXxy:fix/mysql-advanced-threat-protection-payload

Conversation

@ShawnXxy

@ShawnXxy ShawnX (ShawnXxy) commented Sep 1, 2026

Copy link
Copy Markdown

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

…operties object

Related command

az mysql flexible-server advanced-threat-protection-setting update --state

Description

Addressing #33836.

The issue was introduced in #33774 when payload structure changed but ATP command still passes a flat dictionary

{"state": "Enabled"}

The new b2 SDK schema-serialized that dictionary into the required ARM shape:

{"properties": {"state": "Enabled"}}

Testing Guide

azdev test test_mysql_custom --series
az mysql flexible-server advanced-threat-protection-setting update -g xxxxx -n xxxxxx --state Enabled --debug

This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI lite review requested due to automatic review settings September 1, 2026 14:21
@ShawnXxy
ShawnX (ShawnXxy) requested a review from a team as a code owner September 1, 2026 14:21
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 1, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution ShawnX (@ShawnXxy)! We will review the pull request and get back to you soon.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Auto-Assign Auto assign by bot label Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes az mysql flexible-server advanced-threat-protection-setting update --state by updating the request payload to match the newer ARM/SDK shape (nesting state under properties), addressing the regression reported in #33836.

Changes:

  • Update ATP “update” custom command to send {"properties": {"state": ...}} instead of a flat dict.
  • Add a unit test validating the payload shape passed to the SDK client for ATP update.

Reviewed changes

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

File Description
src/azure-cli/azure/cli/command_modules/mysql/custom.py Adjusts ATP update parameters to use the required properties.state structure for the PATCH body.
src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_custom.py Adds a focused unit test to ensure the custom update function passes the nested properties payload.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

MySQL

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

Labels

Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants