-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Improving Test-AzMySqlFlexibleServerConnect #28039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…SqlFlexibleServerConnect function
…nd update documentation
…imeout for Test-AzMySqlFlexibleServerConnect
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this 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 isAdministratorLoginPassword
. 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
/azp run azure-powershell - security-tools |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Fix #26760
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.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.