-
Notifications
You must be signed in to change notification settings - Fork 4k
Get-AccessToken's Breaking Change #27706
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
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
a3818bd
to
cb3b0da
Compare
c02e2b4
to
aeb3b6a
Compare
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 updates the Get-AzAccessToken cmdlet to change its default output type from a plain text token (PSAccessToken) to a secure string token (PSSecureAccessToken) while introducing an environment variable to allow a plain text override for backward compatibility.
- Updated the breaking change record in BreakingChangeIssues.csv.
- Modified cmdlet output logic in GetAzureRmAccessToken.cs to conditionally return a plain text token based on an environment variable.
- Updated documentation, changelog, and tests to reflect the change.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tools/StaticAnalysis/Exceptions/Az.Accounts/BreakingChangeIssues.csv | Added entry for Get-AzAccessToken output type change. |
src/Accounts/Authentication/Constants.cs | Introduced a new constant for the plain text output override. |
src/Accounts/Accounts/help/Get-AzAccessToken.md | Revised help text to reflect that the output is now secure by default. |
src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs | Changed logic to return a secure token unless overridden by an environment variable. |
src/Accounts/Accounts/ChangeLog.md | Documented the breaking change in the changelog. |
src/Accounts/Accounts.Test/AccessTokenCmdletTest.cs | Updated tests for plain text output when the environment variable is set. |
Comments suppressed due to low confidence (1)
src/Accounts/Accounts.Test/AccessTokenCmdletTest.cs:88
- The test covers the plain text output branch but does not verify the default secure token branch. Consider adding a test case for when the environment variable is unset to ensure the cmdlet returns a PSSecureAccessToken as expected.
Environment.SetEnvironmentVariable(Constants.AzPsOutputPlainTextAccessToken, bool.TrueString);
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.
Overall it looks good w minor coomments
Co-authored-by: Yeming Liu <[email protected]>
Co-authored-by: Yeming Liu <[email protected]>
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 implements a breaking change for Get-AzAccessToken by changing its default output from plain text to SecureString while retaining an option (via an environment variable) to return plain text if necessary.
- Updated breaking change records in the CSV file.
- Added a new constant for the environment variable to control output type.
- Modified the cmdlet implementation to conditionally output plain text or SecureString and updated documentation and tests accordingly.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tools/StaticAnalysis/Exceptions/Az.Accounts/BreakingChangeIssues.csv | Updated breaking change record for Get-AzAccessToken. |
src/Accounts/Authentication/Constants.cs | Added constant for the environment variable controlling output type. |
src/Accounts/Accounts/help/Get-AzAccessToken.md | Revised help documentation to reflect the breaking change and new parameter behavior. |
src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs | Adjusted cmdlet implementation to output SecureString by default with a plain text fallback. |
src/Accounts/Accounts/ChangeLog.md | Noted the breaking change in the changelog. |
src/Accounts/Accounts.Test/AccessTokenCmdletTest.cs | Added test coverage to verify plain text output when the environment variable is set. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Description
Change the default output access token of Get-AzAccessToken from plain text to

SecureString
.If
AZUREPS_OUTPUT_PLAINTEXT_AZACCESSTOKEN
is set to true, returns plain text token. The feature is to avoid breaking change in Az.FunctionsMandatory 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.