Skip to content

Commit 1dfc8f1

Browse files
author
Maddie Clayton
authored
Merge branch 'preview' into testing
2 parents 65ebb9f + 51e918e commit 1dfc8f1

File tree

23 files changed

+2035
-325
lines changed

23 files changed

+2035
-325
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ Package
237237
launchSettings.json
238238
/src/StackAdmin/AzureRM/AzureRM.psm1
239239
/src/StackAdmin/AzureStack/AzureStack.psm1
240-
/tools/AzureRM.Netcore/AzureRM.Netcore.psm1
241240
/ModuleMappings.json
242241
/SolutionMappings.json
243242
/TestMappings.json
244243
/tools/Modules/tmp
244+
/tools/Az/Az.psm1

build.proj

Lines changed: 27 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4-
54
<!--
65
Available Targets:
76
@@ -68,7 +67,7 @@
6867
</PropertyGroup>
6968

7069
<PropertyGroup Condition="$(NetCore) == 'true' ">
71-
<Scope>NetCore</Scope>
70+
<Scope>Netcore</Scope>
7271
</PropertyGroup>
7372

7473
<!-- Set Skips -->
@@ -85,7 +84,6 @@
8584
<SkipDependencyAnalysis>true</SkipDependencyAnalysis>
8685
</PropertyGroup>
8786

88-
8987
<ItemGroup>
9088
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'" />
9189
<StackSolution Include="$(LibrarySourceFolder)\StackAdmin\Stack.sln" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
@@ -112,9 +110,9 @@
112110
<![CDATA[System.Environment.SetEnvironmentVariable(EnvName, EnvValue);]]>
113111
</Code>
114112
</Task>
115-
</UsingTask> <!--
116-
CI build related
117-
-->
113+
</UsingTask>
114+
115+
<!-- CI build related -->
118116
<PropertyGroup>
119117
<!--OnPremiseBuildTasks is not a good name, but CI server is using that, will update across soon-->
120118
<CIToolsPath>$(OnPremiseBuildTasks)</CIToolsPath>
@@ -201,11 +199,6 @@
201199
<!-- Restore packages for local build tasks-->
202200
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
203201
ContinueOnError="false" />
204-
<!-- Restore packages for repo tasks tasks-->
205-
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
206-
ContinueOnError="false" />
207-
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
208-
ContinueOnError="false" />
209202
<!--Restore the xunit runner needed to run unit tests-->
210203
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
211204
</Target>
@@ -282,60 +275,12 @@
282275
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"
283276
Condition="'$(CodeSign)' == 'false'"/>
284277

285-
<!-- Copying modules to be signed -->
286-
287-
<!-- AzureRM -->
288-
<Copy SourceFiles="$(LibraryToolsFolder)\AzureRM\AzureRM.psd1"
289-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
290-
ContinueOnError="false"
291-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
292-
<Copy SourceFiles="$(LibraryToolsFolder)\AzureRM\AzureRM.psm1"
293-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
294-
ContinueOnError="false"
295-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
296-
297-
<!-- Stack Specific -->
298-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psd1"
299-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
300-
ContinueOnError="false"
301-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
302-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psm1"
303-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
304-
ContinueOnError="false"
305-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
306-
307-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psd1"
308-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
309-
ContinueOnError="false"
310-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
311-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
312-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
313-
ContinueOnError="false"
314-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
315-
316-
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
278+
<CallTarget Targets="CodeSignBinaries" Condition="'$(CodeSign)' == 'true'" />
317279

318280
<Exec ContinueOnError="false"
319281
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\NewOutputTypeIndex.ps1 -OutputFile $(PackageDirectory)\outputtypes.json -BuildConfig $(Configuration) &quot;"
320282
Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'" />
321283

322-
<!-- AzureRM -->
323-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psd1"
324-
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
325-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psm1"
326-
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
327-
328-
<!-- Stack -->
329-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psd1"
330-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
331-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psm1"
332-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
333-
334-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psd1"
335-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
336-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psm1"
337-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
338-
339284
<Message Importance="high" Text="Running Static Analyser" />
340285
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
341286
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
@@ -346,14 +291,15 @@
346291
Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'" />
347292
</Target>
348293

349-
350-
351294
<!--
352295
Build .Net Core Cmdlets
353296
Fully self contained
354297
-->
355298
<Target Name="BuildNetCore">
356299
<Message Importance="high" Text="Building Cmdlets..." />
300+
<PropertyGroup>
301+
<Scope>Netcore</Scope>
302+
</PropertyGroup>
357303

358304
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;$ProgressPreference = 'SilentlyContinue';. $(LibraryToolsFolder)\CreateAliasMapping.ps1 &quot;"/>
359305

@@ -404,35 +350,23 @@
404350
<Delete Files="@(ExtraPsdFiles->'%(FullPath)')"/>
405351

406352
<!-- Update module manifests. -->
407-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope Netcore &quot; "
353+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot; "
354+
Condition="'$(CodeSign)' == 'false'"
408355
ContinueOnError="false" />
409356
<!-- Generate the Help -->
410357
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Set-Variable -Name ProgressPreference -Value 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
411358
Condition="'$(SkipHelp)' == 'false'"
412359
ContinueOnError="false"/>
413360

414-
<!-- Copying modules to be signed -->
415-
<Copy SourceFiles="$(LibraryToolsFolder)\Az\Az.psd1"
416-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
417-
ContinueOnError="false" />
418-
<Copy SourceFiles="$(LibraryToolsFolder)\Az\Az.psm1"
419-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
420-
ContinueOnError="false" />
421-
422361
<!-- Cleanup extraneous files. -->
423362
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
424-
425-
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
426-
427-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psd1" DestinationFolder="$(LibraryToolsFolder)\Az" />
428-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1" DestinationFolder="$(LibraryToolsFolder)\Az" />
363+
364+
<CallTarget Targets="CodeSignBinaries" Condition="'$(CodeSign)' == 'true'" />
429365
</Target>
430366

431-
432367
<!-- Do everything possible except Publish -->
433368
<Target Name="Full" DependsOnTargets="Clean;Build;Test" />
434369

435-
436370
<Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
437371
<Message Importance="high" Text="Building RepoTasks" />
438372
<MSBuild Projects="@(LocalBuildTasks)"
@@ -494,20 +428,18 @@
494428
ContinueOnError="false"
495429
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>
496430

497-
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"
498-
Condition="'$(Scope)' != 'Netcore'"/>
431+
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"/>
499432

500433
<!-- Copying shortcut to be signed -->
501434
<Copy SourceFiles="$(LibraryRoot)tools\Az\Az.psm1"
502-
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Netcore'" />
435+
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'Netcore'" />
503436
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
504437
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
505438
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psm1"
506439
DestinationFolder="$(StackPackageFolder)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
507440
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
508441
DestinationFolder="$(StackPackageFolder)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
509442

510-
511443
<!-- Azure -->
512444
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'">
513445
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1"/>
@@ -542,9 +474,17 @@
542474
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(StackPackageFolder)\$(Configuration) &quot;"
543475
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'"
544476
ContinueOnError="ErrorAndContinue" />
545-
</Target>
546-
547477

478+
<!-- Copy files back after signing -->
479+
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1"
480+
DestinationFolder="$(LibraryRoot)tools\Az" Condition="'$(Scope)' == 'Netcore'" />
481+
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psm1"
482+
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
483+
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psm1"
484+
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
485+
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psm1"
486+
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
487+
</Target>
548488

549489
<Target Name="BuildInstaller" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'">
550490
<Exec Command="$(PowerShellCommandPrefix) &quot;. Register-PSRepository -Name MSIcreationrepository -SourceLocation $(PackageDirectory) -InstallationPolicy Trusted &quot; "/>
@@ -553,8 +493,6 @@
553493
<CallTarget Targets="CodeSignInstaller" Condition=" '$(CodeSign)' == 'true'" />
554494
</Target>
555495

556-
557-
558496
<Target Name="CodeSignInstaller">
559497
<PropertyGroup>
560498
<!--public token associated with MSSharedLibKey.snk-->
@@ -586,8 +524,6 @@
586524
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" />
587525
</Target>
588526

589-
590-
591527
<!-- Run Validation -->
592528
<Target Name="DependencyAnalysis"
593529
Condition="'$(SkipDependencyAnalysis)' == 'false'">
@@ -612,8 +548,7 @@
612548
<OnError ExecuteTargets="StaticAnalysisErrorMessage"/>
613549
</Target>
614550

615-
616-
<Target Name="StaticAnalysisErrorMessage">
551+
<Target Name="StaticAnalysisErrorMessage">
617552
<Error Text="StaticAnalysis has failed. Please follow the instructions on this doc: https://github.com/Azure/azure-powershell/blob/preview/documentation/Debugging-StaticAnalysis-Errors.md"/>
618553
</Target>
619554

@@ -643,7 +578,7 @@
643578
ContinueOnError="false"/>
644579

645580
<CallTarget Targets="BuildInstaller" Condition="'$(Scope)' =='All'" />
646-
</Target>
581+
</Target>
647582

648583
<PropertyGroup>
649584
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
@@ -703,10 +638,7 @@
703638
DependsOnTargets="Clean;Build;Test;RunOneSDKCIT" />
704639

705640
<!-- Run live tests and record mocks -->
706-
<Target
707-
Name="RunLiveTests"
708-
DependsOnTargets="Clean;Build;LiveTestsFilter" />
709-
641+
<Target Name="RunLiveTests" DependsOnTargets="Clean;Build;LiveTestsFilter" />
710642

711643
<Target Name="LiveTestsFilter" DependsOnTargets="Build;BeforeRunTests">
712644
<Message Importance="high" Text="Running live tests..." />

src/ResourceManager/Insights/Commands.Insights/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Fixed issue #7267 (Autoscale area)
22+
- Issues with creating a new autoscale rule not properly setting enumerated parameters (would always set them to the default value).
2123

2224
* Fixed issue #7513 [Insights] Set-AzureRMDiagnosticSetting requires explicit specification of categories during creation of setting
2325
- Now the cmdlet does not require explicit indication of the categories to enable during creation, i.e. it works as it is documented
2426

2527
## Version 5.1.4
26-
2728
* Fixed issues #6833 and #7102 (Diagnostic Settings area)
2829
- Issues with the default name, i.e. "service", during creation and listing/getting of diagnostic settings
2930
- Issues creating diagnostic settings with categories

src/ResourceManager/Insights/Commands.Insights/TransitionalClasses/MetricTrigger.cs

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,47 @@ public class MetricTrigger : Monitor.Models.MetricTrigger
2525
/// <summary>
2626
/// Gets or sets the OperatorProperty of the Metric Trigger
2727
/// </summary>
28-
public new ComparisonOperationType OperatorProperty { get; set; }
28+
public new ComparisonOperationType OperatorProperty
29+
{
30+
get
31+
{
32+
return (ComparisonOperationType)System.Enum.Parse(typeof(ComparisonOperationType), base.OperatorProperty.ToString());
33+
}
34+
set
35+
{
36+
base.OperatorProperty = (Monitor.Models.ComparisonOperationType)System.Enum.Parse(typeof(Monitor.Models.ComparisonOperationType), value.ToString());
37+
}
38+
}
2939

3040
/// <summary>
3141
/// Gets or sets the Statistic of the Metric Trigger
3242
/// </summary>
33-
public new MetricStatisticType Statistic { get; set; }
43+
public new MetricStatisticType Statistic
44+
{
45+
get
46+
{
47+
return (MetricStatisticType)System.Enum.Parse(typeof(MetricStatisticType), base.Statistic.ToString());
48+
}
49+
set
50+
{
51+
base.Statistic = (Monitor.Models.MetricStatisticType)System.Enum.Parse(typeof(Monitor.Models.MetricStatisticType), value.ToString());
52+
}
53+
}
3454

3555
/// <summary>
3656
/// Gets or sets the TimeAggregation of the Metric Trigger
3757
/// </summary>
38-
public new TimeAggregationType TimeAggregation { get; set; }
58+
public new TimeAggregationType TimeAggregation
59+
{
60+
get
61+
{
62+
return (TimeAggregationType)System.Enum.Parse(typeof(TimeAggregationType), base.TimeAggregation.ToString());
63+
}
64+
set
65+
{
66+
base.TimeAggregation = (Monitor.Models.TimeAggregationType)System.Enum.Parse(typeof(Monitor.Models.TimeAggregationType), value.ToString());
67+
}
68+
}
3969

4070
/// <summary>
4171
/// Initializes a new instance of the MetricTrigger class.

src/ResourceManager/Insights/Commands.Insights/TransitionalClasses/ScaleAction.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,32 @@ public class ScaleAction : Monitor.Models.ScaleAction
2525
/// <summary>
2626
/// Gets or sets the ScaleType of the scale action
2727
/// </summary>
28-
public new ScaleType Type { get; set; }
28+
public new ScaleType Type
29+
{
30+
get
31+
{
32+
return (ScaleType)System.Enum.Parse(typeof(ScaleType), base.Type.ToString());
33+
}
34+
set
35+
{
36+
base.Type = (Monitor.Models.ScaleType)System.Enum.Parse(typeof(Monitor.Models.ScaleType), value.ToString());
37+
}
38+
}
2939

3040
/// <summary>
3141
/// Gets or sets the Direction of the scale action
3242
/// </summary>
33-
public new ScaleDirection Direction { get; set; }
43+
public new ScaleDirection Direction
44+
{
45+
get
46+
{
47+
return (ScaleDirection)System.Enum.Parse(typeof(ScaleDirection), base.Direction.ToString());
48+
}
49+
set
50+
{
51+
base.Direction = (Monitor.Models.ScaleDirection)System.Enum.Parse(typeof(Monitor.Models.ScaleDirection), value.ToString());
52+
}
53+
}
3454

3555
/// <summary>
3656
/// Initializes a new instance of the ScaleAction class.

src/ResourceManager/Insights/Commands.Insights/help/Get-AzureRmAlertRule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The output does not contain details about the rules because the *DetailedOutput*
4646

4747
### Example 2: Get an alert rule by name
4848
```
49-
PS C:\>Get-AzureRmAlertRule -ResourcGroup "Default-Web-CentralUS" -Name "myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8"
49+
PS C:\>Get-AzureRmAlertRule -ResourceGroup "Default-Web-CentralUS" -Name "myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8"
5050
```
5151

5252
This command gets the alert rule named myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8.

0 commit comments

Comments
 (0)