diff --git a/src/Accounts/Accounts/ChangeLog.md b/src/Accounts/Accounts/ChangeLog.md index af104e32ac1e..7d0906d40c67 100644 --- a/src/Accounts/Accounts/ChangeLog.md +++ b/src/Accounts/Accounts/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Updated the `Get-AzAccessToken` breaking change warning message. * Added Long Running Operation Support for Invoke-AzRest command. ## Version 3.0.5 diff --git a/src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs b/src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs index 1efc3d2f2c07..194ccea36cdc 100644 --- a/src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs +++ b/src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs @@ -29,7 +29,7 @@ namespace Microsoft.Azure.Commands.Profile { - [GenericBreakingChangeWithVersion("The Token property of the output type will be changed from String to SecureString. Add the [-AsSecureString] switch to avoid the impact of this upcoming breaking change.", "13.0.0", "4.0.0")] + [GenericBreakingChangeWithVersion("The Token property of the output type will be changed from String to SecureString. Add the [-AsSecureString] switch to avoid the impact of this upcoming breaking change.", "14.0.0", "4.0.0")] [Cmdlet(VerbsCommon.Get, AzureRMConstants.AzureRMPrefix + "AccessToken", DefaultParameterSetName = KnownResourceNameParameterSet)] [OutputType(typeof(PSAccessToken), typeof(PSSecureAccessToken))] public class GetAzureRmAccessTokenCommand : AzureRMCmdlet diff --git a/src/Accounts/Accounts/help/Az.Accounts.md b/src/Accounts/Accounts/help/Az.Accounts.md index bcb0f6b1b1a3..71fd45d1c8e0 100644 --- a/src/Accounts/Accounts/help/Az.Accounts.md +++ b/src/Accounts/Accounts/help/Az.Accounts.md @@ -60,7 +60,7 @@ Enables AzureRm prefix aliases for Az modules. Exports all the configs into a file so that it can be imported on another machine. ### [Get-AzAccessToken](Get-AzAccessToken.md) -Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. +Get secure access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. ### [Get-AzConfig](Get-AzConfig.md) Gets the configs of Azure PowerShell. diff --git a/src/Accounts/Accounts/help/Get-AzAccessToken.md b/src/Accounts/Accounts/help/Get-AzAccessToken.md index d9a1755d343f..ae05bf0e3660 100644 --- a/src/Accounts/Accounts/help/Get-AzAccessToken.md +++ b/src/Accounts/Accounts/help/Get-AzAccessToken.md @@ -8,7 +8,8 @@ schema: 2.0.0 # Get-AzAccessToken ## SYNOPSIS -Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. +Get secure raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. +> **_NOTE:_** The current default output token type is going to be changed from plain text `String` to `SecureString` for security. Please use `-AsSecureString` to migrate to the secure behaviour before the breaking change takes effects. ## SYNTAX @@ -31,21 +32,21 @@ Get access token ### Example 1 Get the access token for ARM endpoint ```powershell -Get-AzAccessToken +Get-AzAccessToken -AsSecureString ``` Get access token of current account for ResourceManager endpoint ### Example 2 Get the access token for Microsoft Graph endpoint ```powershell -Get-AzAccessToken -ResourceTypeName MSGraph +Get-AzAccessToken -AsSecureString -ResourceTypeName MSGraph ``` Get access token of Microsoft Graph endpoint for current account ### Example 3 Get the access token for Microsoft Graph endpoint ```powershell -Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" +Get-AzAccessToken -AsSecureString -ResourceUrl "https://graph.microsoft.com/" ``` Get access token of Microsoft Graph endpoint for current account @@ -54,6 +55,7 @@ Get access token of Microsoft Graph endpoint for current account ### -AsSecureString Specifiy to convert output token as a secure string. +Please always use the parameter for security purpose and to avoid the upcoming breaking chang and refer to [Frequently asked questions about Azure PowerShell](https://learn.microsoft.com/en-us/powershell/azure/faq) for how to convert from `SecureString` to plain text. ```yaml Type: System.Management.Automation.SwitchParameter @@ -137,8 +139,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS ### Microsoft.Azure.Commands.Profile.Models.PSAccessToken +The output type is going to be deprecate. ### Microsoft.Azure.Commands.Profile.Models.PSSecureAccessToken +Use `-AsSecureString` to get the token as `SecureString`. ## NOTES