File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
ResourceManager/Formatters
Resources.Test/Formatters Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -176,18 +176,18 @@ private void FormatResourceChanges(IList<PSWhatIfChange> resourceChanges)
176
176
return ;
177
177
}
178
178
179
- int scopeCount = resourceChanges . Select ( rc => rc . Scope ) . Distinct ( ) . Count ( ) ;
179
+ int scopeCount = resourceChanges . Select ( rc => rc . Scope . ToUpperInvariant ( ) ) . Distinct ( ) . Count ( ) ;
180
180
181
181
this . Builder
182
182
. AppendLine ( )
183
183
. Append ( "The deployment will update the following " )
184
184
. AppendLine ( scopeCount == 1 ? "scope:" : "scopes:" ) ;
185
185
186
186
resourceChanges
187
- . OrderBy ( rc => rc . Scope )
188
- . GroupBy ( rc => rc . Scope )
187
+ . OrderBy ( rc => rc . Scope . ToUpperInvariant ( ) )
188
+ . GroupBy ( rc => rc . Scope . ToUpperInvariant ( ) )
189
189
. ToDictionary ( g => g . Key , g => g . ToList ( ) )
190
- . ForEach ( kvp => FormatResourceChangesInScope ( kvp . Key , kvp . Value ) ) ;
190
+ . ForEach ( kvp => FormatResourceChangesInScope ( kvp . Value [ 0 ] . Scope , kvp . Value ) ) ;
191
191
}
192
192
193
193
private void FormatResourceChangesInScope ( string scope , IList < PSWhatIfChange > resourceChanges )
Original file line number Diff line number Diff line change @@ -173,12 +173,12 @@ public void Format_NonEmptyResourceChanges_SortsAndGroupsByScopeAndChangeType()
173
173
{
174
174
new WhatIfChange
175
175
{
176
- ResourceId = "/subscriptions /00000000-0000-0000-0000-000000000001/resourceGroups/rg1 /providers/p1/foo1" ,
176
+ ResourceId = "/Subscriptions /00000000-0000-0000-0000-000000000001/resourceGroups/RG1 /providers/p1/foo1" ,
177
177
ChangeType = ChangeType . Create
178
178
} ,
179
179
new WhatIfChange
180
180
{
181
- ResourceId = "/subscriptions /00000000-0000-0000-0000-000000000001/resourceGroups/rg1/providers/p2/bar" ,
181
+ ResourceId = "/Subscriptions /00000000-0000-0000-0000-000000000001/resourceGroups/rg1/providers/p2/bar" ,
182
182
ChangeType = ChangeType . Create
183
183
} ,
184
184
new WhatIfChange
@@ -188,7 +188,7 @@ public void Format_NonEmptyResourceChanges_SortsAndGroupsByScopeAndChangeType()
188
188
} ,
189
189
new WhatIfChange
190
190
{
191
- ResourceId = "/subscriptions /00000000-0000-0000-0000-000000000002/providers/p3/foobar1" ,
191
+ ResourceId = "/SUBSCRIPTIONS /00000000-0000-0000-0000-000000000002/providers/p3/foobar1" ,
192
192
ChangeType = ChangeType . Ignore
193
193
} ,
194
194
new WhatIfChange
@@ -204,7 +204,7 @@ public void Format_NonEmptyResourceChanges_SortsAndGroupsByScopeAndChangeType()
204
204
} ;
205
205
206
206
string changesInfo = $@ "
207
- Scope: /subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/rg1
207
+ Scope: /subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/RG1
208
208
{ Color . Green }
209
209
+ p1/foo1
210
210
+ p2/bar
Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Upcoming Release
21
+ * Fixed an issue where What-If shows two resource group scopes with different casing
21
22
* Updated ` Export-AzResourceGroup ` to use the SDK.
22
23
23
24
## Version 3.0.0
You can’t perform that action at this time.
0 commit comments