File tree Expand file tree Collapse file tree 6 files changed +19
-10
lines changed
Resources.Test/Formatters Expand file tree Collapse file tree 6 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ public class ChangeTypeComparer : IComparer<ChangeType>
26
26
[ ChangeType . Create ] = 1 ,
27
27
[ ChangeType . Deploy ] = 2 ,
28
28
[ ChangeType . Modify ] = 3 ,
29
- [ ChangeType . Ignore ] = 4 ,
30
- [ ChangeType . NoChange ] = 5 ,
29
+ [ ChangeType . NoChange ] = 4 ,
30
+ [ ChangeType . Ignore ] = 5 ,
31
31
} ;
32
32
33
33
public int Compare ( ChangeType first , ChangeType second )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Formatters
18
18
using System ;
19
19
using System . Collections . Generic ;
20
20
21
- public class PSResourceManagerErrorFormatter
21
+ public static class PSResourceManagerErrorFormatter
22
22
{
23
23
public static string Format ( PSResourceManagerError error )
24
24
{
Original file line number Diff line number Diff line change 37
37
using Microsoft . Azure . Management . ResourceManager . Models ;
38
38
using Microsoft . Rest . Azure ;
39
39
using Microsoft . Rest . Azure . OData ;
40
+ using Microsoft . WindowsAzure . Commands . Common ;
40
41
using Microsoft . WindowsAzure . Commands . Utilities . Common ;
42
+ using Newtonsoft . Json ;
41
43
using Newtonsoft . Json . Linq ;
42
44
using ProjectResources = Microsoft . Azure . Commands . ResourceManager . Cmdlets . Properties . Resources ;
43
45
using ProvisioningState = Microsoft . Azure . Commands . ResourceManager . Cmdlets . Entities . ProvisioningState ;
@@ -451,8 +453,10 @@ private Deployment CreateBasicDeployment(PSDeploymentCmdletParameters parameters
451
453
}
452
454
else
453
455
{
454
- string parametersContent = parameters . TemplateParameterObject != null
455
- ? PSJsonSerializer . Serialize ( parameters . TemplateParameterObject )
456
+ // ToDictionary is needed for extracting value from a secure string. Do not remove it.
457
+ Dictionary < string , object > parametersDictionary = parameters . TemplateParameterObject ? . ToDictionary ( false ) ;
458
+ string parametersContent = parametersDictionary != null
459
+ ? PSJsonSerializer . Serialize ( parametersDictionary )
456
460
: null ;
457
461
deployment . Properties . Parameters = ! string . IsNullOrEmpty ( parametersContent )
458
462
? JObject . Parse ( parametersContent )
Original file line number Diff line number Diff line change 8
8
using Commands . Common . Authentication . Abstractions ;
9
9
using Management . ResourceManager . Models ;
10
10
using Microsoft . Azure . Commands . ResourceManager . Cmdlets . Json ;
11
+ using Microsoft . WindowsAzure . Commands . Common ;
11
12
using Newtonsoft . Json . Linq ;
12
13
13
14
public class PSDeploymentWhatIfCmdletParameters
@@ -105,8 +106,10 @@ public DeploymentWhatIf ToDeploymentWhatIf()
105
106
}
106
107
else
107
108
{
108
- string parametersContent = this . TemplateParametersObject != null
109
- ? PSJsonSerializer . Serialize ( this . TemplateParametersObject )
109
+ // ToDictionary is needed for extracting value from a secure string. Do not remove it.
110
+ Dictionary < string , object > parametersDictionary = this . TemplateParametersObject ? . ToDictionary ( false ) ;
111
+ string parametersContent = parametersDictionary != null
112
+ ? PSJsonSerializer . Serialize ( parametersDictionary )
110
113
: null ;
111
114
properties . Parameters = ! string . IsNullOrEmpty ( parametersContent )
112
115
? JObject . Parse ( parametersContent )
Original file line number Diff line number Diff line change @@ -273,9 +273,9 @@ public void Format_ResourceIdOnly_SortsAndGroupsByShortResourceId()
273
273
- p5/foo
274
274
- p6/foo{ Color . Reset } { Color . Green }
275
275
+ p2/foo{ Color . Reset } { Color . Blue }
276
- ! p4/foo{ Color . Reset } { Color . Gray }
277
- * p1 /foo{ Color . Reset } { Color . Reset }
278
- = p3 /foo
276
+ ! p4/foo{ Color . Reset } { Color . Reset }
277
+ = p3 /foo{ Color . Reset } { Color . Gray }
278
+ * p1 /foo
279
279
{ Color . Reset }
280
280
"
281
281
. Replace ( "\r \n " , Environment . NewLine ) ;
Original file line number Diff line number Diff line change 19
19
-->
20
20
## Upcoming Release
21
21
* Added breaking change attribute to ` SubscriptionId ` parameter of ` Get-AzResourceGroupDeploymentOperation ` .
22
+ * Updated ARM template What-If cmdlets to show "Ignore" resource changes last.
23
+ * Fixed an issue where dynamic secure string parameters for deployment cmdlets are not correctly serialized.
22
24
23
25
## Version 2.5.0
24
26
* Updated ` Get-AzPolicyAlias ` response to include information indicating whether the alias is modifiable by Azure Policy.
You can’t perform that action at this time.
0 commit comments