Skip to content

Conversation

ShawnXxy
Copy link
Contributor

Description

Fix #26760

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 07:58
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

@Copilot 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 enhances the Test-AzMySqlFlexibleServerConnect cmdlet by adding a -Timeout parameter and switching to use a PSCredential object for connections. It also updates help and docs, bumps module metadata and versions, and records the changes in the changelog.

  • Added -Timeout parameter to support long-running queries and updated cmdlet logic to respect it.
  • Switched connection calls to use a PSCredential object instead of raw username/password.
  • Updated help markdown, autogenerated docs, ChangeLog, version, and project metadata.

Reviewed Changes

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

Show a summary per file
File Description
src/MySql/MySql/help/Test-AzMySqlFlexibleServerConnect.md Updated help examples and added -Timeout parameter docs.
src/MySql/MySql/help/New-AzMySqlFlexibleServer.md Modified example to use a literal password.
src/MySql/MySql/ChangeLog.md Recorded new upcoming release entries.
src/MySql/MySql/Az.MySql.psd1 Bumped required Az.Accounts version and generation date.
src/MySql/MySql.sln Updated project GUIDs and solution configuration.
src/MySql/MySql.Autorest/docs/Test-AzMySqlFlexibleServerConnect.md Added -Timeout parameter to autogenerated docs.
src/MySql/MySql.Autorest/custom/Test-AzMySqlFlexibleServerConnect.ps1 Implemented Timeout param, created PSCredential, updated connection logic.
src/MySql/MySql.Autorest/Properties/AssemblyInfo.cs Bumped module version to 1.4.0.
Comments suppressed due to low confidence (3)

src/MySql/MySql.Autorest/custom/Test-AzMySqlFlexibleServerConnect.ps1:44

  • The newly added Timeout parameter and its handling logic are not covered by any tests. Please add unit or integration tests that validate timeout behavior (both when provided and when omitted).
        [Parameter(HelpMessage = 'The timeout in seconds for query execution. Valid range is 1-31536000 seconds.')]

src/MySql/MySql.Autorest/custom/Test-AzMySqlFlexibleServerConnect.ps1:158

  • It looks like $Password is not defined in this function. The cmdlet parameter for the secure string is AdministratorLoginPassword. You should use that directly when creating the PSCredential, for example:
$Credential = New-Object System.Management.Automation.PSCredential($AdministratorUserName, $AdministratorLoginPassword)
        $SecurePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force

src/MySql/MySql/help/New-AzMySqlFlexibleServer.md:32

  • [nitpick] Hardcoding a sample password ("1234") in the example can be confusing and insecure. Please revert to a placeholder (e.g., <YourPassword>) to guide users to supply their own credentials.
$password = ConvertTo-SecureString -String "1234" -Force -AsPlainText

@YanaXu
Copy link
Contributor

YanaXu commented Jun 30, 2025

/azp run azure-powershell - security-tools

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@YanaXu YanaXu merged commit a1c22d2 into Azure:main Jun 30, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc]: Test-AzMySqlFlexibleServerConnect Fails after 30 second

2 participants