From e46e1f7f221b88ba47e2bf7828910fdcabf143b0 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 8 Aug 2023 15:51:36 +0800 Subject: [PATCH 1/7] disable error records persistence --- src/Accounts/Accounts/ChangeLog.md | 2 +- src/Accounts/Accounts/help/Clear-AzConfig.md | 65 ++++++++++++++++++- src/Accounts/Accounts/help/Get-AzConfig.md | 65 ++++++++++++++++++- src/Accounts/Accounts/help/Update-AzConfig.md | 65 ++++++++++++++++++- .../Config/ConfigInitializer.cs | 7 ++ .../Properties/Resources.Designer.cs | 18 +++++ .../Authentication/Properties/Resources.resx | 6 ++ 7 files changed, 221 insertions(+), 7 deletions(-) diff --git a/src/Accounts/Accounts/ChangeLog.md b/src/Accounts/Accounts/ChangeLog.md index 7cc0e906d96e..a52e52adb1c0 100644 --- a/src/Accounts/Accounts/ChangeLog.md +++ b/src/Accounts/Accounts/ChangeLog.md @@ -19,7 +19,7 @@ --> ## Upcoming Release -* Updated the reference of Azure PowerShell Common to 1.3.82-preview. +* Added config `DisableErrorRecordsPersistence` to disable writing error records to file system [#21732] ## Version 2.12.5 * Changed output stream from debug stream to warning stream for `CmdletPreviewAttribute` diff --git a/src/Accounts/Accounts/help/Clear-AzConfig.md b/src/Accounts/Accounts/help/Clear-AzConfig.md index 64a69e3963c6..0e529fc58c47 100644 --- a/src/Accounts/Accounts/help/Clear-AzConfig.md +++ b/src/Accounts/Accounts/help/Clear-AzConfig.md @@ -22,8 +22,9 @@ Clear-AzConfig [-Force] [-PassThru] [-AppliesTo ] [-Scope ] ``` Clear-AzConfig [-PassThru] [-AppliesTo ] [-Scope ] [-DefaultProfile ] [-WhatIf] [-Confirm] [-DefaultSubscriptionForLogin] - [-DisplayBreakingChangeWarning] [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableLoginByWam] - [] + [-DisableErrorRecordsPersistence] [-DisplayBreakingChangeWarning] [-DisplayRegionIdentified] + [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableLoginByWam] [-EnableTestCoverage] + [-TestCoverageLocation] [] ``` ## DESCRIPTION @@ -100,6 +101,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DisableErrorRecordsPersistence +When disabled, error records will not be written to ~/.Azure/ErrorRecords + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ClearByKey +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DisplayBreakingChangeWarning Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. @@ -115,6 +131,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DisplayRegionIdentified +When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ClearByKey +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DisplaySurveyMessage When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. @@ -164,6 +195,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -EnableTestCoverage +When enabled, the test framework will generate data during test run as a preliminary for the test coverage calculation + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ClearByKey +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Force Do not ask for confirmation when clearing all configs. @@ -211,6 +257,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -TestCoverageLocation +Only takes effect when EnableTestCoverage equals to TRUE. Use this config to redirect the test coverage data location. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ClearByKey +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Accounts/Accounts/help/Get-AzConfig.md b/src/Accounts/Accounts/help/Get-AzConfig.md index 42fa0900ffdd..aeb2e8a6798b 100644 --- a/src/Accounts/Accounts/help/Get-AzConfig.md +++ b/src/Accounts/Accounts/help/Get-AzConfig.md @@ -14,8 +14,9 @@ Gets the configs of Azure PowerShell. ``` Get-AzConfig [-AppliesTo ] [-Scope ] [-DefaultProfile ] - [-DefaultSubscriptionForLogin] [-DisplayBreakingChangeWarning] [-DisplaySurveyMessage] [-EnableDataCollection] - [-EnableLoginByWam] [] + [-DefaultSubscriptionForLogin] [-DisableErrorRecordsPersistence] [-DisplayBreakingChangeWarning] + [-DisplayRegionIdentified] [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableLoginByWam] + [-EnableTestCoverage] [-TestCoverageLocation] [] ``` ## DESCRIPTION @@ -111,6 +112,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DisableErrorRecordsPersistence +When disabled, error records will not be written to ~/.Azure/ErrorRecords + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DisplayBreakingChangeWarning Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. @@ -126,6 +142,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DisplayRegionIdentified +When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DisplaySurveyMessage When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. @@ -175,6 +206,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -EnableTestCoverage +When enabled, the test framework will generate data during test run as a preliminary for the test coverage calculation + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Scope Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. @@ -192,6 +238,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -TestCoverageLocation +Only takes effect when EnableTestCoverage equals to TRUE. Use this config to redirect the test coverage data location. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Accounts/Accounts/help/Update-AzConfig.md b/src/Accounts/Accounts/help/Update-AzConfig.md index e49a9de5a443..64de3c338f2a 100644 --- a/src/Accounts/Accounts/help/Update-AzConfig.md +++ b/src/Accounts/Accounts/help/Update-AzConfig.md @@ -14,9 +14,10 @@ Updates the configs of Azure PowerShell. ``` Update-AzConfig [-AppliesTo ] [-Scope ] [-DefaultProfile ] - [-WhatIf] [-Confirm] [-DefaultSubscriptionForLogin ] [-DisplayBreakingChangeWarning ] + [-WhatIf] [-Confirm] [-DefaultSubscriptionForLogin ] [-DisableErrorRecordsPersistence ] + [-DisplayBreakingChangeWarning ] [-DisplayRegionIdentified ] [-DisplaySurveyMessage ] [-EnableDataCollection ] [-EnableLoginByWam ] - [] + [-EnableTestCoverage ] [-TestCoverageLocation ] [] ``` ## DESCRIPTION @@ -123,6 +124,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -DisableErrorRecordsPersistence +When disabled, error records will not be written to ~/.Azure/ErrorRecords + +```yaml +Type: System.Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DisplayBreakingChangeWarning Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. @@ -138,6 +154,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -DisplayRegionIdentified +When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + +```yaml +Type: System.Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DisplaySurveyMessage When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. @@ -187,6 +218,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -EnableTestCoverage +When enabled, the test framework will generate data during test run as a preliminary for the test coverage calculation + +```yaml +Type: System.Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Scope Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. @@ -204,6 +250,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -TestCoverageLocation +Only takes effect when EnableTestCoverage equals to TRUE. Use this config to redirect the test coverage data location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Accounts/Authentication/Config/ConfigInitializer.cs b/src/Accounts/Authentication/Config/ConfigInitializer.cs index 5fc8c9a336e4..4e3a2495723f 100644 --- a/src/Accounts/Authentication/Config/ConfigInitializer.cs +++ b/src/Accounts/Authentication/Config/ConfigInitializer.cs @@ -196,6 +196,13 @@ private void RegisterConfigs(IConfigManager configManager) true, null, new[] { AppliesTo.Az })); + //Use DisableErrorRecordsPersistence as opt-out for now, will replace it with EnableErrorRecordsPersistence as opt-in at next major release (November 2023) + configManager.RegisterConfig(new SimpleTypedConfig( + ConfigKeys.DisableErrorRecordsPersistence, + Resources.HelpMessageOfDisableErrorRecordsPersistence, + false, + ConfigKeys.DisableErrorRecordsPersistence, + new[] { AppliesTo.Az })); #if DEBUG || TESTCOVERAGE configManager.RegisterConfig(new SimpleTypedConfig( ConfigKeys.EnableTestCoverage, diff --git a/src/Accounts/Authentication/Properties/Resources.Designer.cs b/src/Accounts/Authentication/Properties/Resources.Designer.cs index c0df6d8292e9..a85fae89814f 100644 --- a/src/Accounts/Authentication/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication/Properties/Resources.Designer.cs @@ -285,6 +285,15 @@ public static string HelpMessageOfDefaultSubscriptionForLogin { } } + /// + /// Looks up a localized string similar to When disabled, error records will not be written to ~/.Azure/ErrorRecords. + /// + public static string HelpMessageOfDisableErrorRecordsPersistence { + get { + return ResourceManager.GetString("HelpMessageOfDisableErrorRecordsPersistence", resourceCulture); + } + } + /// /// Looks up a localized string similar to Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release.. /// @@ -312,6 +321,15 @@ public static string HelpMessageOfEnableDataCollection { } } + /// + /// Looks up a localized string similar to When enabled, error records will be written to ~/.Azure/ErrorRecords. + /// + public static string HelpMessageOfEnableErrorRecordsPersistence { + get { + return ResourceManager.GetString("HelpMessageOfEnableErrorRecordsPersistence", resourceCulture); + } + } + /// /// Looks up a localized string similar to When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell.. /// diff --git a/src/Accounts/Authentication/Properties/Resources.resx b/src/Accounts/Authentication/Properties/Resources.resx index dd3f071ba90a..6b3f1a592edb 100644 --- a/src/Accounts/Authentication/Properties/Resources.resx +++ b/src/Accounts/Authentication/Properties/Resources.resx @@ -390,4 +390,10 @@ When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + When disabled, error records will not be written to ~/.Azure/ErrorRecords + + + When enabled, error records will be written to ~/.Azure/ErrorRecords + \ No newline at end of file From 5e04bad70cea252ca375f78e052ede96e6dc7de0 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 8 Aug 2023 16:10:09 +0800 Subject: [PATCH 2/7] add keys --- src/shared/ConfigKeys.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/ConfigKeys.cs b/src/shared/ConfigKeys.cs index 000623396d78..afbaf5745c8f 100644 --- a/src/shared/ConfigKeys.cs +++ b/src/shared/ConfigKeys.cs @@ -32,5 +32,8 @@ internal static class ConfigKeys public const string EnableLoginByWam = "EnableLoginByWam"; public const string TestCoverageLocation = "TestCoverageLocation"; public const string DisplayRegionIdentified = "DisplayRegionIdentified"; + //Use DisableErrorRecordsPersistence as opt-out for now, will replace it with EnableErrorRecordsPersistence as opt-in at next major release (November 2023) + public const string DisableErrorRecordsPersistence = "DisableErrorRecordsPersistence"; + public const string EnableErrorRecordsPersistence = "EnableErrorRecordsPersistence"; } } From 2c3565cc170bf1b0864dcb303e77eccaff395c23 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 8 Aug 2023 18:59:43 +0800 Subject: [PATCH 3/7] upgrade common version --- tools/Common.Netcore.Dependencies.targets | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/Common.Netcore.Dependencies.targets b/tools/Common.Netcore.Dependencies.targets index 841d8f91db5e..2682944f68b8 100644 --- a/tools/Common.Netcore.Dependencies.targets +++ b/tools/Common.Netcore.Dependencies.targets @@ -3,26 +3,26 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + @@ -37,9 +37,9 @@ - $(NugetPackageRoot)\microsoft.azure.powershell.storage\1.3.82-preview\tools\ + $(NugetPackageRoot)\microsoft.azure.powershell.storage\1.3.83-preview\tools\ - + \ No newline at end of file From 7e719f954969423c19d4e51d992e707fa844d50c Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Fri, 11 Aug 2023 14:28:48 +0800 Subject: [PATCH 4/7] polish help message for 'DisableErrorRecordsPersistence' --- src/Accounts/Accounts/help/Clear-AzConfig.md | 2 +- src/Accounts/Accounts/help/Get-AzConfig.md | 2 +- src/Accounts/Accounts/help/Update-AzConfig.md | 2 +- src/Accounts/Authentication/Properties/Resources.Designer.cs | 2 +- src/Accounts/Authentication/Properties/Resources.resx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Accounts/Accounts/help/Clear-AzConfig.md b/src/Accounts/Accounts/help/Clear-AzConfig.md index 0e529fc58c47..22265fbfb1f5 100644 --- a/src/Accounts/Accounts/help/Clear-AzConfig.md +++ b/src/Accounts/Accounts/help/Clear-AzConfig.md @@ -102,7 +102,7 @@ Accept wildcard characters: False ``` ### -DisableErrorRecordsPersistence -When disabled, error records will not be written to ~/.Azure/ErrorRecords +When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/src/Accounts/Accounts/help/Get-AzConfig.md b/src/Accounts/Accounts/help/Get-AzConfig.md index aeb2e8a6798b..6423ee66dcbd 100644 --- a/src/Accounts/Accounts/help/Get-AzConfig.md +++ b/src/Accounts/Accounts/help/Get-AzConfig.md @@ -113,7 +113,7 @@ Accept wildcard characters: False ``` ### -DisableErrorRecordsPersistence -When disabled, error records will not be written to ~/.Azure/ErrorRecords +When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/src/Accounts/Accounts/help/Update-AzConfig.md b/src/Accounts/Accounts/help/Update-AzConfig.md index 64de3c338f2a..f9450bba8dcc 100644 --- a/src/Accounts/Accounts/help/Update-AzConfig.md +++ b/src/Accounts/Accounts/help/Update-AzConfig.md @@ -125,7 +125,7 @@ Accept wildcard characters: False ``` ### -DisableErrorRecordsPersistence -When disabled, error records will not be written to ~/.Azure/ErrorRecords +When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 ```yaml Type: System.Boolean diff --git a/src/Accounts/Authentication/Properties/Resources.Designer.cs b/src/Accounts/Authentication/Properties/Resources.Designer.cs index a85fae89814f..110896eb50b5 100644 --- a/src/Accounts/Authentication/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication/Properties/Resources.Designer.cs @@ -286,7 +286,7 @@ public static string HelpMessageOfDefaultSubscriptionForLogin { } /// - /// Looks up a localized string similar to When disabled, error records will not be written to ~/.Azure/ErrorRecords. + /// Looks up a localized string similar to When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023. /// public static string HelpMessageOfDisableErrorRecordsPersistence { get { diff --git a/src/Accounts/Authentication/Properties/Resources.resx b/src/Accounts/Authentication/Properties/Resources.resx index 6b3f1a592edb..b6a5703018c2 100644 --- a/src/Accounts/Authentication/Properties/Resources.resx +++ b/src/Accounts/Authentication/Properties/Resources.resx @@ -391,7 +391,7 @@ When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. - When disabled, error records will not be written to ~/.Azure/ErrorRecords + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 When enabled, error records will be written to ~/.Azure/ErrorRecords From 00e8da16e08409497a4f47420e968b1bd4ed2547 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Wed, 16 Aug 2023 10:28:52 +0800 Subject: [PATCH 5/7] Update src/Accounts/Authentication/Properties/Resources.resx Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com> --- src/Accounts/Authentication/Properties/Resources.resx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Accounts/Authentication/Properties/Resources.resx b/src/Accounts/Authentication/Properties/Resources.resx index b6a5703018c2..df0ffb226aaa 100644 --- a/src/Accounts/Authentication/Properties/Resources.resx +++ b/src/Accounts/Authentication/Properties/Resources.resx @@ -391,9 +391,9 @@ When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. - When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. - When enabled, error records will be written to ~/.Azure/ErrorRecords + When enabled, error records will be written to ~/.Azure/ErrorRecords. \ No newline at end of file From 10512bc8a3369f121d6a4e8aee9edc4ada773c2e Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Wed, 16 Aug 2023 10:56:16 +0800 Subject: [PATCH 6/7] remove debug parameters for get/clear/update config --- src/Accounts/Accounts/help/Clear-AzConfig.md | 36 ++----------------- src/Accounts/Accounts/help/Get-AzConfig.md | 34 ++---------------- src/Accounts/Accounts/help/Update-AzConfig.md | 34 ++---------------- .../Config/ConfigInitializer.cs | 1 - 4 files changed, 7 insertions(+), 98 deletions(-) diff --git a/src/Accounts/Accounts/help/Clear-AzConfig.md b/src/Accounts/Accounts/help/Clear-AzConfig.md index 22265fbfb1f5..aeace1a64355 100644 --- a/src/Accounts/Accounts/help/Clear-AzConfig.md +++ b/src/Accounts/Accounts/help/Clear-AzConfig.md @@ -23,8 +23,8 @@ Clear-AzConfig [-Force] [-PassThru] [-AppliesTo ] [-Scope ] Clear-AzConfig [-PassThru] [-AppliesTo ] [-Scope ] [-DefaultProfile ] [-WhatIf] [-Confirm] [-DefaultSubscriptionForLogin] [-DisableErrorRecordsPersistence] [-DisplayBreakingChangeWarning] [-DisplayRegionIdentified] - [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableLoginByWam] [-EnableTestCoverage] - [-TestCoverageLocation] [] + [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableLoginByWam] + [] ``` ## DESCRIPTION @@ -102,7 +102,7 @@ Accept wildcard characters: False ``` ### -DisableErrorRecordsPersistence -When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 +When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. ```yaml Type: System.Management.Automation.SwitchParameter @@ -195,21 +195,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -EnableTestCoverage -When enabled, the test framework will generate data during test run as a preliminary for the test coverage calculation - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: ClearByKey -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Force Do not ask for confirmation when clearing all configs. @@ -257,21 +242,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -TestCoverageLocation -Only takes effect when EnableTestCoverage equals to TRUE. Use this config to redirect the test coverage data location. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: ClearByKey -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Accounts/Accounts/help/Get-AzConfig.md b/src/Accounts/Accounts/help/Get-AzConfig.md index 6423ee66dcbd..eeef3d4987b3 100644 --- a/src/Accounts/Accounts/help/Get-AzConfig.md +++ b/src/Accounts/Accounts/help/Get-AzConfig.md @@ -16,7 +16,7 @@ Gets the configs of Azure PowerShell. Get-AzConfig [-AppliesTo ] [-Scope ] [-DefaultProfile ] [-DefaultSubscriptionForLogin] [-DisableErrorRecordsPersistence] [-DisplayBreakingChangeWarning] [-DisplayRegionIdentified] [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableLoginByWam] - [-EnableTestCoverage] [-TestCoverageLocation] [] + [] ``` ## DESCRIPTION @@ -113,7 +113,7 @@ Accept wildcard characters: False ``` ### -DisableErrorRecordsPersistence -When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 +When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. ```yaml Type: System.Management.Automation.SwitchParameter @@ -206,21 +206,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -EnableTestCoverage -When enabled, the test framework will generate data during test run as a preliminary for the test coverage calculation - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Scope Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. @@ -238,21 +223,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -TestCoverageLocation -Only takes effect when EnableTestCoverage equals to TRUE. Use this config to redirect the test coverage data location. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Accounts/Accounts/help/Update-AzConfig.md b/src/Accounts/Accounts/help/Update-AzConfig.md index f9450bba8dcc..fb911f158e97 100644 --- a/src/Accounts/Accounts/help/Update-AzConfig.md +++ b/src/Accounts/Accounts/help/Update-AzConfig.md @@ -17,7 +17,7 @@ Update-AzConfig [-AppliesTo ] [-Scope ] [-DefaultProfile ] [-DisableErrorRecordsPersistence ] [-DisplayBreakingChangeWarning ] [-DisplayRegionIdentified ] [-DisplaySurveyMessage ] [-EnableDataCollection ] [-EnableLoginByWam ] - [-EnableTestCoverage ] [-TestCoverageLocation ] [] + [] ``` ## DESCRIPTION @@ -125,7 +125,7 @@ Accept wildcard characters: False ``` ### -DisableErrorRecordsPersistence -When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023 +When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. ```yaml Type: System.Boolean @@ -218,21 +218,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -EnableTestCoverage -When enabled, the test framework will generate data during test run as a preliminary for the test coverage calculation - -```yaml -Type: System.Boolean -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -Scope Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. @@ -250,21 +235,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -TestCoverageLocation -Only takes effect when EnableTestCoverage equals to TRUE. Use this config to redirect the test coverage data location. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Accounts/Authentication/Config/ConfigInitializer.cs b/src/Accounts/Authentication/Config/ConfigInitializer.cs index 4e3a2495723f..84177d060eb0 100644 --- a/src/Accounts/Authentication/Config/ConfigInitializer.cs +++ b/src/Accounts/Authentication/Config/ConfigInitializer.cs @@ -217,7 +217,6 @@ private void RegisterConfigs(IConfigManager configManager) ConfigKeys.TestCoverageLocation, new[] { AppliesTo.Az })); #endif - configManager.RegisterConfig(new EnableLoginByWamConfig()); configManager.RegisterConfig(new EnableInterceptSurveyConfig()); configManager.RegisterConfig(new DisplayBreakingChangeWarningsConfig()); From d94ec8aa56b679857bef877a66ab85677019d3c1 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Wed, 16 Aug 2023 11:01:50 +0800 Subject: [PATCH 7/7] update environment variable name to AzPSDisableErrorRecordsPersistence --- src/Accounts/Authentication/Config/ConfigInitializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Accounts/Authentication/Config/ConfigInitializer.cs b/src/Accounts/Authentication/Config/ConfigInitializer.cs index 84177d060eb0..a64174e89a34 100644 --- a/src/Accounts/Authentication/Config/ConfigInitializer.cs +++ b/src/Accounts/Authentication/Config/ConfigInitializer.cs @@ -201,7 +201,7 @@ private void RegisterConfigs(IConfigManager configManager) ConfigKeys.DisableErrorRecordsPersistence, Resources.HelpMessageOfDisableErrorRecordsPersistence, false, - ConfigKeys.DisableErrorRecordsPersistence, + string.Format("AzPS{0}", ConfigKeys.DisableErrorRecordsPersistence), new[] { AppliesTo.Az })); #if DEBUG || TESTCOVERAGE configManager.RegisterConfig(new SimpleTypedConfig(