Skip to content

Commit bd0f934

Browse files
authored
opt-in error record config (#24607)
* optin error record config * update help markdown * suppress breaking change warning * Update Common.Netcore.Dependencies.targets * Update Clear-AzConfig.md * Update Get-AzConfig.md * Update Update-AzConfig.md * Update Clear-AzConfig.md * Update Get-AzConfig.md * Update Update-AzConfig.md
1 parent c66f93d commit bd0f934

File tree

10 files changed

+132
-92
lines changed

10 files changed

+132
-92
lines changed

src/Accounts/Accounts/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020

2121
## Upcoming Release
22+
* [Breaking Change] Removed config `DisableErrorRecordsPersistence` to disable writing error records, error recording is now opt-in
23+
* Added config `EnableErrorRecordsPersistence` to enable writing error records to file system
2224

2325
## Version 2.19.0
2426
> [!IMPORTANT]

src/Accounts/Accounts/help/Clear-AzConfig.md

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ Clears the values of configs that are set by the user.
1515
### ClearAll (Default)
1616
```
1717
Clear-AzConfig [-Force] [-PassThru] [-AppliesTo <String>] [-Scope <ConfigScope>]
18-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
18+
[-DefaultProfile <IAzureContextContainer>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
19+
[<CommonParameters>]
1920
```
2021

2122
### ClearByKey
2223
```
2324
Clear-AzConfig [-PassThru] [-AppliesTo <String>] [-Scope <ConfigScope>]
24-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [-CheckForUpgrade]
25-
[-DefaultSubscriptionForLogin] [-DisableErrorRecordsPersistence] [-DisableInstanceDiscovery]
26-
[-DisplayBreakingChangeWarning] [-DisplayRegionIdentified] [-DisplaySurveyMessage] [-EnableDataCollection]
27-
[-EnableLoginByWam] [<CommonParameters>]
25+
[-DefaultProfile <IAzureContextContainer>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
26+
[-CheckForUpgrade] [-DefaultSubscriptionForLogin] [-DisableInstanceDiscovery] [-DisplayBreakingChangeWarning]
27+
[-DisplayRegionIdentified] [-DisplaySecretsWarning] [-DisplaySurveyMessage] [-EnableDataCollection]
28+
[-EnableErrorRecordsPersistence] [-EnableLoginByWam] [<CommonParameters>]
2829
```
2930

3031
## DESCRIPTION
@@ -116,21 +117,6 @@ Accept pipeline input: False
116117
Accept wildcard characters: False
117118
```
118119
119-
### -DisableErrorRecordsPersistence
120-
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.
121-
122-
```yaml
123-
Type: System.Management.Automation.SwitchParameter
124-
Parameter Sets: ClearByKey
125-
Aliases:
126-
127-
Required: False
128-
Position: Named
129-
Default value: None
130-
Accept pipeline input: False
131-
Accept wildcard characters: False
132-
```
133-
134120
### -DisableInstanceDiscovery
135121
Set it to true to disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By setting this to true, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy.
136122
@@ -222,6 +208,21 @@ Accept pipeline input: False
222208
Accept wildcard characters: False
223209
```
224210
211+
### -EnableErrorRecordsPersistence
212+
When enabled, error records will be written to ~/.Azure/ErrorRecords.
213+
214+
```yaml
215+
Type: System.Management.Automation.SwitchParameter
216+
Parameter Sets: ClearByKey
217+
Aliases:
218+
219+
Required: False
220+
Position: Named
221+
Default value: None
222+
Accept pipeline input: False
223+
Accept wildcard characters: False
224+
```
225+
225226
### -EnableLoginByWam
226227
\[Preview\] When enabled, Web Account Manager (WAM) will be the default interactive login experience.
227228
It will fall back to using the browser if the platform does not support WAM.
@@ -270,6 +271,21 @@ Accept pipeline input: False
270271
Accept wildcard characters: False
271272
```
272273
274+
### -ProgressAction
275+
{{ Fill ProgressAction Description }}
276+
277+
```yaml
278+
Type: System.Management.Automation.ActionPreference
279+
Parameter Sets: (All)
280+
Aliases: proga
281+
282+
Required: False
283+
Position: Named
284+
Default value: None
285+
Accept pipeline input: False
286+
Accept wildcard characters: False
287+
```
288+
273289
### -Scope
274290
Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user.
275291
By default it is CurrentUser.

src/Accounts/Accounts/help/Get-AzConfig.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ Gets the configs of Azure PowerShell.
1414

1515
```
1616
Get-AzConfig [-AppliesTo <String>] [-Scope <ConfigScope>] [-DefaultProfile <IAzureContextContainer>]
17-
[-CheckForUpgrade] [-DefaultSubscriptionForLogin] [-DisableErrorRecordsPersistence]
18-
[-DisableInstanceDiscovery] [-DisplayBreakingChangeWarning] [-DisplayRegionIdentified] [-DisplaySurveyMessage]
19-
[-EnableDataCollection] [-EnableLoginByWam] [<CommonParameters>]
17+
[-ProgressAction <ActionPreference>] [-CheckForUpgrade] [-DefaultSubscriptionForLogin]
18+
[-DisableInstanceDiscovery] [-DisplayBreakingChangeWarning] [-DisplayRegionIdentified]
19+
[-DisplaySecretsWarning] [-DisplaySurveyMessage] [-EnableDataCollection] [-EnableErrorRecordsPersistence]
20+
[-EnableLoginByWam] [<CommonParameters>]
2021
```
2122

2223
## DESCRIPTION
@@ -127,21 +128,6 @@ Accept pipeline input: False
127128
Accept wildcard characters: False
128129
```
129130
130-
### -DisableErrorRecordsPersistence
131-
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.
132-
133-
```yaml
134-
Type: System.Management.Automation.SwitchParameter
135-
Parameter Sets: (All)
136-
Aliases:
137-
138-
Required: False
139-
Position: Named
140-
Default value: None
141-
Accept pipeline input: False
142-
Accept wildcard characters: False
143-
```
144-
145131
### -DisableInstanceDiscovery
146132
Set it to true to disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By setting this to true, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy.
147133
@@ -233,6 +219,21 @@ Accept pipeline input: False
233219
Accept wildcard characters: False
234220
```
235221
222+
### -EnableErrorRecordsPersistence
223+
When enabled, error records will be written to ~/.Azure/ErrorRecords.
224+
225+
```yaml
226+
Type: System.Management.Automation.SwitchParameter
227+
Parameter Sets: (All)
228+
Aliases:
229+
230+
Required: False
231+
Position: Named
232+
Default value: None
233+
Accept pipeline input: False
234+
Accept wildcard characters: False
235+
```
236+
236237
### -EnableLoginByWam
237238
\[Preview\] When enabled, Web Account Manager (WAM) will be the default interactive login experience.
238239
It will fall back to using the browser if the platform does not support WAM.
@@ -251,6 +252,21 @@ Accept pipeline input: False
251252
Accept wildcard characters: False
252253
```
253254
255+
### -ProgressAction
256+
{{ Fill ProgressAction Description }}
257+
258+
```yaml
259+
Type: System.Management.Automation.ActionPreference
260+
Parameter Sets: (All)
261+
Aliases: proga
262+
263+
Required: False
264+
Position: Named
265+
Default value: None
266+
Accept pipeline input: False
267+
Accept wildcard characters: False
268+
```
269+
254270
### -Scope
255271
Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user.
256272
By default it is CurrentUser.

src/Accounts/Accounts/help/Update-AzConfig.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Updates the configs of Azure PowerShell.
1414

1515
```
1616
Update-AzConfig [-AppliesTo <String>] [-Scope <ConfigScope>] [-DefaultProfile <IAzureContextContainer>]
17-
[-WhatIf] [-Confirm] [-CheckForUpgrade <Boolean>] [-DefaultSubscriptionForLogin <String>]
18-
[-DisableErrorRecordsPersistence <Boolean>] [-DisableInstanceDiscovery <Boolean>]
17+
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [-CheckForUpgrade <Boolean>]
18+
[-DefaultSubscriptionForLogin <String>] [-DisableInstanceDiscovery <Boolean>]
1919
[-DisplayBreakingChangeWarning <Boolean>] [-DisplayRegionIdentified <Boolean>]
20-
[-DisplaySurveyMessage <Boolean>] [-EnableDataCollection <Boolean>] [-EnableLoginByWam <Boolean>]
21-
[<CommonParameters>]
20+
[-DisplaySecretsWarning <Boolean>] [-DisplaySurveyMessage <Boolean>] [-EnableDataCollection <Boolean>]
21+
[-EnableErrorRecordsPersistence <Boolean>] [-EnableLoginByWam <Boolean>] [<CommonParameters>]
2222
```
2323

2424
## DESCRIPTION
@@ -153,21 +153,6 @@ Accept pipeline input: True (ByPropertyName)
153153
Accept wildcard characters: False
154154
```
155155
156-
### -DisableErrorRecordsPersistence
157-
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.
158-
159-
```yaml
160-
Type: System.Boolean
161-
Parameter Sets: (All)
162-
Aliases:
163-
164-
Required: False
165-
Position: Named
166-
Default value: None
167-
Accept pipeline input: True (ByPropertyName)
168-
Accept wildcard characters: False
169-
```
170-
171156
### -DisableInstanceDiscovery
172157
Set it to true to disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By setting this to true, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy.
173158
@@ -259,6 +244,21 @@ Accept pipeline input: True (ByPropertyName)
259244
Accept wildcard characters: False
260245
```
261246
247+
### -EnableErrorRecordsPersistence
248+
When enabled, error records will be written to ~/.Azure/ErrorRecords.
249+
250+
```yaml
251+
Type: System.Boolean
252+
Parameter Sets: (All)
253+
Aliases:
254+
255+
Required: False
256+
Position: Named
257+
Default value: None
258+
Accept pipeline input: True (ByPropertyName)
259+
Accept wildcard characters: False
260+
```
261+
262262
### -EnableLoginByWam
263263
\[Preview\] When enabled, Web Account Manager (WAM) will be the default interactive login experience.
264264
It will fall back to using the browser if the platform does not support WAM.
@@ -277,6 +277,21 @@ Accept pipeline input: True (ByPropertyName)
277277
Accept wildcard characters: False
278278
```
279279
280+
### -ProgressAction
281+
{{ Fill ProgressAction Description }}
282+
283+
```yaml
284+
Type: System.Management.Automation.ActionPreference
285+
Parameter Sets: (All)
286+
Aliases: proga
287+
288+
Required: False
289+
Position: Named
290+
Default value: None
291+
Accept pipeline input: False
292+
Accept wildcard characters: False
293+
```
294+
280295
### -Scope
281296
Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user.
282297
By default it is CurrentUser.

src/Accounts/Authentication/Config/ConfigInitializer.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ private void RegisterConfigs(IConfigManager configManager)
196196
true,
197197
null,
198198
new[] { AppliesTo.Az }));
199-
//Use DisableErrorRecordsPersistence as opt-out for now, will replace it with EnableErrorRecordsPersistence as opt-in at next major release (November 2023)
200199
configManager.RegisterConfig(new SimpleTypedConfig<bool>(
201-
ConfigKeys.DisableErrorRecordsPersistence,
202-
Resources.HelpMessageOfDisableErrorRecordsPersistence,
200+
ConfigKeys.EnableErrorRecordsPersistence,
201+
Resources.HelpMessageOfEnableErrorRecordsPersistence,
203202
false,
204-
string.Format("AzPS{0}", ConfigKeys.DisableErrorRecordsPersistence),
203+
string.Format("AzPS{0}", ConfigKeys.EnableErrorRecordsPersistence),
205204
new[] { AppliesTo.Az }));
206205
configManager.RegisterConfig(new SimpleTypedConfig<bool>(
207206
ConfigKeys.CheckForUpgrade,

src/Accounts/Authentication/Properties/Resources.Designer.cs

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Accounts/Authentication/Properties/Resources.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,6 @@
390390
<data name="HelpMessageOfDisplayRegionIdentified" xml:space="preserve">
391391
<value>When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs.</value>
392392
</data>
393-
<data name="HelpMessageOfDisableErrorRecordsPersistence" xml:space="preserve">
394-
<value>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.</value>
395-
</data>
396393
<data name="HelpMessageOfEnableErrorRecordsPersistence" xml:space="preserve">
397394
<value>When enabled, error records will be written to ~/.Azure/ErrorRecords.</value>
398395
</data>

src/shared/ConfigKeys.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ internal static class ConfigKeys
3232
public const string EnableLoginByWam = "EnableLoginByWam";
3333
public const string TestCoverageLocation = "TestCoverageLocation";
3434
public const string DisplayRegionIdentified = "DisplayRegionIdentified";
35-
//Use DisableErrorRecordsPersistence as opt-out for now, will replace it with EnableErrorRecordsPersistence as opt-in at next major release (November 2023)
36-
public const string DisableErrorRecordsPersistence = "DisableErrorRecordsPersistence";
3735
public const string EnableErrorRecordsPersistence = "EnableErrorRecordsPersistence";
3836
public const string DisableInstanceDiscovery = "DisableInstanceDiscovery";
3937
public const string CheckForUpgrade = "CheckForUpgrade";

tools/Common.Netcore.Dependencies.targets

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
<ItemGroup>
44
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24"/>
55
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.19"/>
6-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Aks" Version="1.3.92-preview"/>
7-
<PackageReference Include="Microsoft.Azure.PowerShell.Authentication.Abstractions" Version="1.3.92-preview"/>
8-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Authorization" Version="1.3.92-preview"/>
9-
<PackageReference Include="Microsoft.Azure.PowerShell.Common" Version="1.3.92-preview"/>
10-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Compute" Version="1.3.92-preview"/>
11-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Graph.Rbac" Version="1.3.92-preview"/>
12-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.KeyVault" Version="1.3.92-preview"/>
13-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Monitor" Version="1.3.92-preview"/>
14-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Network" Version="1.3.92-preview"/>
15-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.PolicyInsights" Version="1.3.92-preview"/>
16-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.ResourceManager" Version="1.3.92-preview"/>
17-
<PackageReference Include="Microsoft.Azure.PowerShell.Storage" Version="1.3.92-preview"/>
18-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Storage.Management" Version="1.3.92-preview"/>
19-
<PackageReference Include="Microsoft.Azure.PowerShell.Strategies" Version="1.3.92-preview"/>
20-
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Websites" Version="1.3.92-preview"/>
21-
<PackageReference Include="Microsoft.Azure.PowerShell.Common.Share" Version="1.3.92-preview"/>
6+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Aks" Version="1.3.93-preview"/>
7+
<PackageReference Include="Microsoft.Azure.PowerShell.Authentication.Abstractions" Version="1.3.93-preview"/>
8+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Authorization" Version="1.3.93-preview"/>
9+
<PackageReference Include="Microsoft.Azure.PowerShell.Common" Version="1.3.93-preview"/>
10+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Compute" Version="1.3.93-preview"/>
11+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Graph.Rbac" Version="1.3.93-preview"/>
12+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.KeyVault" Version="1.3.93-preview"/>
13+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Monitor" Version="1.3.93-preview"/>
14+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Network" Version="1.3.93-preview"/>
15+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.PolicyInsights" Version="1.3.93-preview"/>
16+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.ResourceManager" Version="1.3.93-preview"/>
17+
<PackageReference Include="Microsoft.Azure.PowerShell.Storage" Version="1.3.93-preview"/>
18+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Storage.Management" Version="1.3.93-preview"/>
19+
<PackageReference Include="Microsoft.Azure.PowerShell.Strategies" Version="1.3.93-preview"/>
20+
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Websites" Version="1.3.93-preview"/>
21+
<PackageReference Include="Microsoft.Azure.PowerShell.Common.Share" Version="1.3.93-preview"/>
2222
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
2323
</ItemGroup>
2424
<ItemGroup>
@@ -37,7 +37,7 @@
3737
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" PrivateAssets="All" />
3838
</ItemGroup>
3939
<PropertyGroup>
40-
<StorageToolsPath>$(NugetPackageRoot)\microsoft.azure.powershell.storage\1.3.92-preview\tools\</StorageToolsPath>
40+
<StorageToolsPath>$(NugetPackageRoot)\microsoft.azure.powershell.storage\1.3.93-preview\tools\</StorageToolsPath>
4141
</PropertyGroup>
4242
<ItemGroup Condition="'$(OmitJsonPackage)' != 'true'">
4343
<PackageReference Include="Newtonsoft.Json" Version="13.0.2"/>

0 commit comments

Comments
 (0)