[MySQL] Fix az mysql flexible-server list-skus returning empty list for all regions#33747
az mysql flexible-server list-skus returning empty list for all regions#33747Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
az mysql flexible-server list-skus returning empty list for all regions
Live test results —
|
Live test results —
|
|
@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33747 (review) and push a fix. Posted by agent-assist (autonomous bug-fix pipeline). |
There was a problem hiding this comment.
Live Test Failure — Action Required
The live test run for this PR failed. All CI checks passed, but azdev test --live reported failures.
Failing test
test_mysql_flexible_server_byok_mgmt in test_mysql_scenario.py
Error
ex = CLIError(GraphError('/me request is only valid with delegated authentication flow.'))
azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception CLIError during execution and fails the command.
The test is calling a Microsoft Graph /me endpoint, which only works with delegated (interactive user) authentication — not with a service principal. In the live-test environment, authentication is always service-principal (OIDC), so any code path that calls /me will fail.
What to investigate
- Review whether the changes to
test_mysql_scenario.pymodified or introducedtest_mysql_flexible_server_byok_mgmtin a way that now triggers this Graph/mecall. - If the BYOK test calls
az ad signed-in-user showor similar Graph API commands, those need to be mocked/skipped or replaced with service-principal-compatible alternatives (e.g.az ad sp show). - The test ran twice across two commits and failed identically both times, confirming this is a repeatable issue.
Live test run: https://github.com/Azure/issue-sentinel/actions/runs/29560619868
Please fix the test so that test_mysql_flexible_server_byok_mgmt passes under service-principal authentication, or skip the Graph-dependent assertion in live mode.
Posted by agent-assist (autonomous bug-fix pipeline).
Fixed in commits fix: BYOK test — |
Live test results —
|
There was a problem hiding this comment.
Live test still failing on latest commit
The live-test workflow (azdev test --live --series test_mysql_scenario) still fails on head SHA 4aea9bace9725f52e19003da001ced71c9418de1, even after the last fix attempt:
Run: https://github.com/Azure/issue-sentinel/actions/runs/29563427899
ex = CLIError(GraphError('/me request is only valid with delegated authentication flow.'))
def _handle_main_exception(ex, *args, **kwargs):
...
> raise CliExecutionError(ex)
E azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception CLIError during execution and fails the command.
azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError
self = <azure.cli.command_modules.mysql.tests.latest.test_mysql_scenario.FlexibleServerMgmtScenarioTest testMethod=test_mysql_flexible_server_byok_mgmt>
CI checks on this PR are otherwise green (no failed checks, nothing pending), so this is purely the live-test failure.
It looks like the previous fix (catching CliExecutionError around az ad signed-in-user show in _test_flexible_server_byok_mgmt) is not actually preventing the exception from propagating — the same GraphError('/me request is only valid with delegated authentication flow.') is still raised and still fails the test under service-principal (federated OIDC) auth used by the live-test runner.
Please:
- Re-check exactly where
az ad signed-in-user show(or the equivalent/meGraph call) is invoked insrc/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_scenario.pyfor thetest_mysql_flexible_server_byok_mgmttest, and confirm thetry/except CliExecutionErrorfallback actually wraps that call site (not a different one). - Confirm the fallback path (
az account show+az ad sp show --id <clientId>) correctly resolves the caller's object ID when running under a service principal, and that it's actually reached — add logging/tracing if needed to verify. - Re-run the test locally against a service-principal-authenticated CLI session (not a user login) to reproduce before pushing another fix, since this environment always runs under federated OIDC / service principal auth, not delegated user auth.
Push a fix so test_mysql_flexible_server_byok_mgmt passes under service-principal authentication.
Posted by agent-assist (autonomous bug-fix pipeline).
|
@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33747 (review) and push a fix. Posted by agent-assist (autonomous bug-fix pipeline). |
…th fallback in BYOK test
The previous fix used Fixed in the latest commit by changing |
…/me SP auth fallback
|
MySQL |
There was a problem hiding this comment.
Automated review — CI + live-test summary
CI: ✅ all 18 checks passed (0 failed, 0 pending).
Live test (azdev test --live -- test_mysql_scenario): 2 passed, 1 failed.
The single failure is not a code defect — it's an environment/auth issue in
the live-test harness:
azure.cli.core.azclierror.AuthenticationError: AADSTS700024: Client assertion
is not within its valid time range. Current time: 2026-07-17T08:43:11Z,
assertion valid from 2026-07-17T07:47:44Z, expiry time of assertion
2026-07-17T07:52:44Z.
The overall live-test run took ~52 minutes (3116.83s), well past the
5-minute validity window of the service-principal client assertion used to
authenticate test calls — the credential simply expired mid-run before
reaching the third scenario. This is an infrastructure token-lifetime issue
in the test runner, unrelated to the change in this PR (mysql list-skus
fix). No action needed on the PR itself.
Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29564194447
Posted by agent-assist (autonomous bug-fix pipeline).
az mysql flexible-server list-skusreturned[]for every region because the bundled SDK used an API version (2024-10-01-preview) for the/capabilitiesendpoint that now returns{"value":[]}.Related command
az mysql flexible-server list-skusDescription
/capabilities?api-version=2024-10-01-preview→ empty response.azure-mgmt-mysqlflexibleservers==1.1.0b2(already insetup.py) usesapi-version=2025-06-01-previewwhich returns actual data._transformers.py):len(result) > 1→len(result) >= 1. The old condition silently returned an empty table for any region with exactly one availability zone.test_mysql_scenario.py): Addedlength(@) > \0`check tolist-skus` assertion so an empty response fails the test rather than passing silently.Testing Guide
History Notes
[MySQL]
az mysql flexible-server list-skus: Fix command returning empty list for all regionsThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.