Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Pull Request Overview
This pull request removes support for Azure Database for MySQL single-server cmdlets and focuses exclusively on Azure Database for MySQL flexible servers. This is a breaking change that removes approximately 20+ legacy cmdlets and introduces several improvements for flexible server management.
Key changes:
- Removed all single-server cmdlets (e.g.,
Get-AzMySqlServer,New-AzMySqlServer,Update-AzMySqlConfiguration) - Retained and updated flexible server cmdlets
- Updated module dependencies, output types, and parameter types
- Added breaking change exception file with 102 documented breaking changes
- Updated help documentation and tests
Reviewed Changes
Copilot reviewed 138 out of 217 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/MySql/MySql/ChangeLog.md |
Added breaking change notice with reference link |
src/MySql/MySql/Az.MySql.psd1 |
Removed single-server cmdlets from exports; updated Az.Accounts dependency to 5.3.0 |
tools/StaticAnalysis/Exceptions/Az.MySql/BreakingChangeIssues.csv |
Added 102 breaking change exception entries documenting removed cmdlets and API changes |
| Multiple help files | Removed documentation for single-server cmdlets; updated output types for flexible server cmdlets |
| Test files | Removed tests for single-server cmdlets; updated flexible server test scenarios |
src/MySql/MySql.Autorest/test/utils.ps1 |
Simplified test setup; improved password handling |
Various .md files |
Updated parameter types from enums to strings; removed "To construct" notes for InputObject parameters |
| @@ -18,6 +18,7 @@ | |||
| - Additional information about change #1 | |||
| --> | |||
| ## Upcoming Release | |||
| * Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249). | |||
There was a problem hiding this comment.
The changelog entry is too vague for users. It should explicitly state that single-server cmdlets have been removed and list the major breaking changes. Users need to understand what specific cmdlets are no longer available and what alternatives they should use. Consider adding bullet points listing the removed cmdlet categories (e.g., "Removed single-server cmdlets: Get-AzMySqlServer, New-AzMySqlServer, Update-AzMySqlConfiguration, etc.") and guidance to migrate to flexible server cmdlets.
src/MySql/MySql.Autorest/test/Test-AzMySqlFlexibleServerConnect.Tests.ps1
Show resolved
Hide resolved
|
To the author of the pull request, |
8f1485f to
4770c2d
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| @@ -8,7 +8,7 @@ schema: 2.0.0 | |||
| # New-AzMySqlFlexibleServerDatabase | |||
|
|
|||
| ## SYNOPSIS | |||
| Creates a new database or updates an existing database. | |||
| Create a new database or create an existing database. | |||
There was a problem hiding this comment.
The SYNOPSIS has a grammatical error. "Create a new database or create an existing database" should be "Create a new database or update an existing database" (or just "Creates a new database or updates an existing database").
| @@ -27,7 +48,7 @@ New-AzMySqlFlexibleServerDatabase -InputObject <IMySqlIdentity> [-Charset <Strin | |||
| ``` | |||
|
|
|||
| ## DESCRIPTION | |||
| Creates a new database or updates an existing database. | |||
| Create a new database or create an existing database. | |||
There was a problem hiding this comment.
The DESCRIPTION has the same grammatical error as the SYNOPSIS. "Create a new database or create an existing database" should be "Creates a new database or updates an existing database".
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 138 out of 217 changed files in this pull request and generated 11 comments.
Comments suppressed due to low confidence (1)
src/MySql/MySql.Autorest/custom/Update-AzMySqlFlexibleServer.ps1:82
Update-AzMySqlFlexibleServerno longer normalizes-HighAvailabilityinto the internal field used byNew-AzMySqlFlexibleServer(HighAvailabilityMode). This introduces inconsistent request shaping between create and update paths. Please confirm what the generated internal cmdlet expects and keep the mapping consistent across both cmdlets.
[Parameter(HelpMessage = 'Enable or disable high availability feature. Default value is Disabled. Default: Disabled.')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.PSArgumentCompleterAttribute("Disabled", "ZoneRedundant", "SameZone")]
[Validateset('ZoneRedundant', 'SameZone', 'Disabled')]
[Alias('HaEnabled')]
[System.String]
${HighAvailability},
[Parameter(HelpMessage='Backup retention days for the server. Day count is between 7 and 35.')]
| # Create the test Vnet | ||
| write-host "Deploy Vnet template" | ||
| New-AzDeployment -Mode Incremental -TemplateFile .\test\deployment-templates\virtual-network\template.json -TemplateParameterFile .\test\deployment-templates\virtual-network\parameters.json -Name vn -ResourceGroupName $resourceGroup | ||
|
|
||
| Install-Module -Name SimplySQL -Scope CurrentUser -Force |
There was a problem hiding this comment.
New-AzDeployment uses Windows-style relative paths (.\test\...). These test helpers are typically run under PowerShell on multiple OSes; prefer Join-Path (or Resolve-Path) to build the template paths so the script works cross-platform.
| ## Upcoming Release | ||
| * Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249). | ||
|
|
There was a problem hiding this comment.
The changelog entry is too vague for users (it doesn’t say what actually changed in Az.MySql), and the link text "here" is non-descriptive. Please describe the user-visible impact (e.g., migration to AutoRest v4, cmdlet/parameter changes) and, when applicable, reference the related breaking-change announcement PRs/issues (e.g., [#28788], [#29120]).
|
|
||
| ## SYNOPSIS | ||
| Creates a new database or updates an existing database. | ||
| Create a new database or create an existing database. | ||
|
|
There was a problem hiding this comment.
The synopsis/description "Create a new database or create an existing database" is incorrect and confusing (it implies creating an existing resource). This should describe the actual behavior (create or update an existing database) in user-facing terms.
| Creates a new MySQL flexible server. | ||
|
|
||
| ### [New-AzMySqlFlexibleServerDatabase](New-AzMySqlFlexibleServerDatabase.md) | ||
| Creates a new database or updates an existing database. | ||
| Create a new database or create an existing database. | ||
|
|
There was a problem hiding this comment.
The cmdlet description for New-AzMySqlFlexibleServerDatabase reads "Create a new database or create an existing database", which is grammatically incorrect and misleading. Update it to reflect the real behavior (create or update an existing database).
| Write-Host $PSBoundParameters | ||
| $Server = Az.MySql.private\Get-AzMySqlFlexibleServer_GetViaIdentity @PSBoundParameters | ||
| } | ||
| else { | ||
| $SubscriptionId = (Get-AzContext).Subscription.Id | ||
| $PSBoundParameters['SubscriptionId'] = $SubscriptionId | ||
| Write-Host $PSBoundParameters |
There was a problem hiding this comment.
Write-Host $PSBoundParameters adds noisy output and can inadvertently expose values passed to the cmdlet. Prefer Write-Verbose (or remove entirely) and avoid printing the full bound-parameter hashtable.
| Write-Host $PSBoundParameters | |
| $Server = Az.MySql.private\Get-AzMySqlFlexibleServer_GetViaIdentity @PSBoundParameters | |
| } | |
| else { | |
| $SubscriptionId = (Get-AzContext).Subscription.Id | |
| $PSBoundParameters['SubscriptionId'] = $SubscriptionId | |
| Write-Host $PSBoundParameters | |
| Write-Verbose "Resolving MySQL flexible server using the provided input object." | |
| $Server = Az.MySql.private\Get-AzMySqlFlexibleServer_GetViaIdentity @PSBoundParameters | |
| } | |
| else { | |
| $SubscriptionId = (Get-AzContext).Subscription.Id | |
| $PSBoundParameters['SubscriptionId'] = $SubscriptionId | |
| Write-Verbose "Resolving MySQL flexible server using the provided parameters and current subscription context." |
| $flexibleServerName = 'mysql-flexible-test-400' | ||
|
|
||
| Describe 'Test-AzMySqlFlexibleServerConnect' -Tag 'LiveOnly' { | ||
| It 'Create' { | ||
| New-AzMySqlFlexibleServer -Name $flexibleServerName -ResourceGroupName $env.resourceGroup -AdministratorUserName mysql_test -AdministratorLoginPassword ($env.password | ConvertTo-SecureString -AsPlainText -Force) -Location $env.location -SkuTier GeneralPurpose -Sku Standard_D2ads_v5 -PublicAccess All | ||
| } | ||
|
|
There was a problem hiding this comment.
The test uses a hard-coded server name (mysql-flexible-test-400). This can cause collisions across parallel runs or repeated local executions and may leave orphaned resources if the test fails mid-run. Prefer generating a unique name (e.g., from $env/random suffix) and ensure cleanup runs in AfterAll/finally so resources are deleted even on failure.
| try { | ||
| if ($PSBoundParameters.ContainsKey('StorageInMb')) { | ||
| $PSBoundParameters.StorageSizeGb = [Math]::floor($PSBoundParameters['StorageInMb'] / 1024) | ||
| $gb = [int]([Math]::Ceiling($PSBoundParameters['StorageInMb'] / 1024)) |
There was a problem hiding this comment.
Update-AzMySqlFlexibleServer now rounds StorageInMb up with Ceiling, while New-AzMySqlFlexibleServer still rounds down with Floor. This makes -StorageInMb behave differently between create vs update for non-1024-aligned values. Please align the conversion logic (and document the rounding behavior) to avoid surprising users.
| $gb = [int]([Math]::Ceiling($PSBoundParameters['StorageInMb'] / 1024)) | |
| # Keep StorageInMb to StorageSizeGb conversion consistent with New-AzMySqlFlexibleServer. | |
| # When the input is not a multiple of 1024 MB, round down to the nearest whole GB. | |
| $gb = [int]([Math]::Floor($PSBoundParameters['StorageInMb'] / 1024)) |
|
|
||
| [Parameter(HelpMessage='The tier of the particular SKU. Accepted values: Burstable, GeneralPurpose, Memory Optimized. Default: Burstable.')] | ||
| [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier])] | ||
| [Microsoft.Azure.PowerShell.Cmdlets.MySql.PSArgumentCompleterAttribute("Burstable", "GeneralPurpose", "MemoryOptimized")] |
There was a problem hiding this comment.
-SkuTier is now a plain System.String with only an argument completer, which removes the input validation that New-AzMySqlFlexibleServer provides via ValidateSet. Consider adding a ValidateSet('Burstable','GeneralPurpose','MemoryOptimized') here as well so invalid tier values are caught early and behavior is consistent across cmdlets.
| [Microsoft.Azure.PowerShell.Cmdlets.MySql.PSArgumentCompleterAttribute("Burstable", "GeneralPurpose", "MemoryOptimized")] | |
| [Microsoft.Azure.PowerShell.Cmdlets.MySql.PSArgumentCompleterAttribute("Burstable", "GeneralPurpose", "MemoryOptimized")] | |
| [ValidateSet('Burstable', 'GeneralPurpose', 'MemoryOptimized')] |
| # Create the test Vnet | ||
| write-host "Deploy Vnet template" | ||
| New-AzDeployment -Mode Incremental -TemplateFile .\test\deployment-templates\virtual-network\template.json -TemplateParameterFile .\test\deployment-templates\virtual-network\parameters.json -Name vn -ResourceGroupName $resourceGroup | ||
|
|
||
| Install-Module -Name SimplySQL -Scope CurrentUser -Force | ||
|
|
||
| write-host "New-AzMySqlServer -Name $serverName -ResourceGroupName $resourceGroup -Location $location -AdministratorUserName mysql_test -AdministratorLoginPassword $password -Sku $Sku" | ||
| New-AzMySqlServer -Name $serverName -ResourceGroupName $resourceGroup -Location $location -AdministratorUserName mysql_test -AdministratorLoginPassword $password -Sku $Sku | ||
| } | ||
| write-host "New-AzMySqlFlexibleServer -Name $flexibleServerName -ResourceGroupName $resourceGroup -AdministratorUserName mysql_test -AdministratorLoginPassword $password -PublicAccess none -Location $location -SkuTier GeneralPurpose -Sku Standard_D2ads_v5" | ||
| New-AzMySqlFlexibleServer -Name $flexibleServerName -ResourceGroupName $resourceGroup -AdministratorUserName mysql_test -AdministratorLoginPassword ($password | ConvertTo-SecureString -AsPlainText -Force) -PublicAccess none -Location $location -SkuTier GeneralPurpose -Sku Standard_D2ads_v5 |
There was a problem hiding this comment.
setupEnv now always deploys the VNet template and runs Install-Module SimplySQL. Installing modules at test/runtime can be slow and requires PSGallery connectivity; and always deploying infra can increase test cost/time unexpectedly. Consider gating these steps (e.g., only for record/live, or only if the module/template isn’t already present) and avoid Install-Module in automated runs.
| Describe 'Test-AzMySqlFlexibleServerConnect' -Tag 'LiveOnly' { | ||
| It 'Create' { | ||
| New-AzMySqlFlexibleServer -Name $flexibleServerName -ResourceGroupName $env.resourceGroup -AdministratorUserName mysql_test -AdministratorLoginPassword ($env.password | ConvertTo-SecureString -AsPlainText -Force) -Location $env.location -SkuTier GeneralPurpose -Sku Standard_D2ads_v5 -PublicAccess All | ||
| } | ||
|
|
||
| It 'Test' { | ||
| { | ||
| Test-AzMySqlFlexibleServerConnect -ResourceGroupName $env.resourceGroup -ServerName $flexibleServerName -AdministratorLoginPassword ($env.password | ConvertTo-SecureString -AsPlainText -Force) | ||
| } | Should -Not -Throw |
There was a problem hiding this comment.
These LiveOnly tests rely on SimplySQL being installed, but the test file no longer installs it (and the cmdlet currently exits if SimplySQL is missing). To reduce flakiness for live runs, consider installing SimplySQL in a BeforeAll/setup step for this suite (or explicitly skipping with a clear message when the dependency isn’t available).
Description
Preannouncement PR:
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.