diff --git a/src/Accounts/Accounts/ChangeLog.md b/src/Accounts/Accounts/ChangeLog.md index ac500bea0d90..060ed63d073c 100644 --- a/src/Accounts/Accounts/ChangeLog.md +++ b/src/Accounts/Accounts/ChangeLog.md @@ -19,8 +19,8 @@ --> ## Upcoming Release +* Added config `DisableErrorRecordsPersistence` to disable writing error records to file system [#21732] * Updated Azure.Core to 1.34.0. -* Updated the reference of Azure PowerShell Common to 1.3.82-preview. ## 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..aeace1a64355 100644 --- a/src/Accounts/Accounts/help/Clear-AzConfig.md +++ b/src/Accounts/Accounts/help/Clear-AzConfig.md @@ -22,7 +22,8 @@ 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] [] ``` @@ -100,6 +101,21 @@ Accept pipeline input: False 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 in the next major release of Az around November 2023. + +```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. diff --git a/src/Accounts/Accounts/help/Get-AzConfig.md b/src/Accounts/Accounts/help/Get-AzConfig.md index 42fa0900ffdd..eeef3d4987b3 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] + [] ``` ## 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. 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 +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. diff --git a/src/Accounts/Accounts/help/Update-AzConfig.md b/src/Accounts/Accounts/help/Update-AzConfig.md index e49a9de5a443..fb911f158e97 100644 --- a/src/Accounts/Accounts/help/Update-AzConfig.md +++ b/src/Accounts/Accounts/help/Update-AzConfig.md @@ -14,7 +14,8 @@ Updates the configs of Azure PowerShell. ``` Update-AzConfig [-AppliesTo ] [-Scope ] [-DefaultProfile ] - [-WhatIf] [-Confirm] [-DefaultSubscriptionForLogin ] [-DisplayBreakingChangeWarning ] + [-WhatIf] [-Confirm] [-DefaultSubscriptionForLogin ] [-DisableErrorRecordsPersistence ] + [-DisplayBreakingChangeWarning ] [-DisplayRegionIdentified ] [-DisplaySurveyMessage ] [-EnableDataCollection ] [-EnableLoginByWam ] [] ``` @@ -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. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + +```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. diff --git a/src/Accounts/Authentication/Config/ConfigInitializer.cs b/src/Accounts/Authentication/Config/ConfigInitializer.cs index 5fc8c9a336e4..a64174e89a34 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, + string.Format("AzPS{0}", ConfigKeys.DisableErrorRecordsPersistence), + new[] { AppliesTo.Az })); #if DEBUG || TESTCOVERAGE configManager.RegisterConfig(new SimpleTypedConfig( ConfigKeys.EnableTestCoverage, @@ -210,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()); diff --git a/src/Accounts/Authentication/Properties/Resources.Designer.cs b/src/Accounts/Authentication/Properties/Resources.Designer.cs index c0df6d8292e9..110896eb50b5 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. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in around November 2023. + /// + 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..df0ffb226aaa 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. 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. + \ No newline at end of file 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"; } } diff --git a/tools/Common.Netcore.Dependencies.targets b/tools/Common.Netcore.Dependencies.targets index a61b6e23f422..2682944f68b8 100644 --- a/tools/Common.Netcore.Dependencies.targets +++ b/tools/Common.Netcore.Dependencies.targets @@ -3,22 +3,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -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