Skip to content

Commit 94acd74

Browse files
committed
Merge pull request #15 from Azure/dev
pull from dev branch of azure/azure-powershell
2 parents c6ed3e7 + ac3dfae commit 94acd74

File tree

90 files changed

+9245
-1338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+9245
-1338
lines changed

AzurePowershell.Test.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<StreamAnalyticsManagerTestDebug>.\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll</StreamAnalyticsManagerTestDebug>
1818
<BatchTestDebug>.\src\ResourceManager\Batch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll</BatchTestDebug>
1919
<WebsitesTestDebug>.\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll</WebsitesTestDebug>
20+
<RemoteAppTestDebug>.\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll</RemoteAppTestDebug>
2021
<ServiceManagementTestDebug>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Test.dll</ServiceManagementTestDebug>
2122
<ServiceManagementExtensionsTestDebug>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Extensions.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.Test.dll</ServiceManagementExtensionsTestDebug>
2223
<SqlDatabaseTestDebug>.\src\ServiceManagement\Sql\Commands.SqlDatabase.Test\bin\Debug\Microsoft.WindowsAzure.Commands.SqlDatabase.Test.dll</SqlDatabaseTestDebug>
@@ -44,6 +45,7 @@
4445
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
4546
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
4647
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
48+
<XUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
4749
<XUnitTests Include=".\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
4850
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
4951
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
@@ -93,6 +95,11 @@
9395
</Target>
9496

9597

98+
<Target Name="TestRemoteApp">
99+
<Xunit.Runner.MSBuild.xunit Assemblies="$(RemoteAppTestDebug)" Html="$(TestOutputDirectory)\RemoteAppTestDebug.xunit.dll.html" Verbose="false"
100+
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
101+
</Target>
102+
96103
<Target Name="TestWebsites">
97104
<Xunit.Runner.MSBuild.xunit Assemblies="$(WebsitesTestDebug)" Html="$(TestOutputDirectory)\WebsitesTestDebug.xunit.dll.html" Verbose="false"
98105
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).
44

5-
If you encounter any bugs with Microsoft Azure PowerShell please file an issue in the [Issues](https://github.com/WindowsAzure/azure-sdk-tools/issues) section of the project.
5+
If you encounter any bugs with Microsoft Azure PowerShell please file an issue in the [Issues](https://github.com/Azure/azure-powershell/issues) section of the project.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ For detail descriptions and examples of the cmdlets, type
139139
2. Open Microsoft Web Platform Installer and search for __Microsoft Azure PowerShell__.
140140
3. Install.
141141

142-
You can also find the standalone installers for all the versions at [Downloads](https://github.com/Azure/azure-sdk-tools/releases)
142+
You can also find the standalone installers for all the versions at [Downloads](https://github.com/Azure/azure-powershell/releases)
143143

144144
### Source Code
145145

146146
1. Download the source code from GitHub repo
147-
2. Follow the [Microsoft Azure PowerShell Developer Guide](https://github.com/Azure/azure-sdk-tools/wiki/Windows-Azure-PowerShell-Developer-Guide)
147+
2. Follow the [Microsoft Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/wiki/Microsoft-Azure-PowerShell-Developer-Guide)
148148

149149
### Supported PowerShell Versions
150150

@@ -290,8 +290,8 @@ Be sure to check out the [Microsoft Azure Developer Forums on Stack Overflow](ht
290290

291291
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).
292292

293-
If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-sdk-tools/issues) section of the project.
293+
If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-powershell/issues) section of the project.
294294

295295
# Learn More
296296

297-
* [Microsoft Azure Script Center](http://www.azure.microsoft.com/en-us/documentation/scripts/)
297+
* [Microsoft Azure Script Center](http://www.azure.microsoft.com/en-us/documentation/scripts/)

src/AzurePowershell.sln

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.31101.0MinimumVisualStudioVersion = 10.0.40219.1
3+
VisualStudioVersion = 12.0.31101.0
4+
MinimumVisualStudioVersion = 10.0.40219.1
45
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
56
ProjectSection(SolutionItems) = preProject
67
local.runsettings = local.runsettings
@@ -168,6 +169,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites.Test", "R
168169
EndProject
169170
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RemoteApp", "ServiceManagement\RemoteApp\Commands.RemoteApp\Commands.RemoteApp.csproj", "{492D2AF2-950B-4F2E-8079-8794305313FD}"
170171
EndProject
172+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RemoteApp.Test", "ServiceManagement\RemoteApp\Commands.RemoteApp.Test\Commands.RemoteApp.Test.csproj", "{CA82D500-1940-4068-A076-D7A8AD459FB0}"
173+
EndProject
171174
Global
172175
GlobalSection(SolutionConfigurationPlatforms) = preSolution
173176
Debug|Any CPU = Debug|Any CPU
@@ -406,19 +409,24 @@ Global
406409
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
407410
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
408411
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.Build.0 = Release|Any CPU
409-
{492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
410-
{492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
411-
{492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
412-
{492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.Build.0 = Release|Any CPU
413412
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
414413
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
415414
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
416415
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Release|Any CPU.Build.0 = Release|Any CPU
416+
{492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
417+
{492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
418+
{492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
419+
{492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.Build.0 = Release|Any CPU
420+
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
421+
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
422+
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
423+
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Release|Any CPU.Build.0 = Release|Any CPU
417424
EndGlobalSection
418425
GlobalSection(SolutionProperties) = preSolution
419426
HideSolutionNode = FALSE
420427
EndGlobalSection
421428
GlobalSection(NestedProjects) = preSolution
429+
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
422430
{37455286-D8A7-4E0C-8B4D-C517D20C641A} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
423431
{D6F470A6-7395-4B8B-9D29-44DF0EC8F624} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
424432
{A3965B66-5A3E-4B8C-9574-28E5958D4828} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
@@ -429,7 +437,6 @@ Global
429437
{4BC0E3D3-6EDD-43AA-8F15-DCFED8ACC93D} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
430438
{9D5A40CA-5594-4F5C-8230-7ADF7CC0558E} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
431439
{3B48A77B-5956-4A62-9081-92BA04B02B27} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
432-
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
433440
{4C2FE49A-09E1-4979-AD46-CD64FD04C8F7} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
434441
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
435442
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
@@ -448,5 +455,6 @@ Global
448455
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
449456
{469F20E0-9D40-41AD-94C3-B47AD15A4C00} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
450457
{13E031E4-8A43-4B87-9D72-D70180C31C11} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
458+
{CA82D500-1940-4068-A076-D7A8AD459FB0} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
451459
EndGlobalSection
452460
EndGlobal

src/Common/Commands.Common.Test/Mocks/MockCommandRuntime.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,18 @@ public void WriteError(ErrorRecord errorRecord)
102102

103103
public void WriteObject(object sendToPipeline, bool enumerateCollection)
104104
{
105-
OutputPipeline.Add(sendToPipeline);
105+
System.Collections.IEnumerable enumerable = LanguagePrimitives.GetEnumerable(sendToPipeline);
106+
if (enumerable != null && enumerateCollection)
107+
{
108+
foreach (object o in enumerable)
109+
{
110+
OutputPipeline.Add(o);
111+
}
112+
}
113+
else
114+
{
115+
OutputPipeline.Add(sendToPipeline);
116+
}
106117
}
107118

108119
public void WriteObject(object sendToPipeline)

src/ResourceManager/Insights/Commands.Insights.Test/Alerts/AddAlertRuleCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void AddAlertRuleCommandParametersProcessing()
7474
cmdlet.ResourceGroup = Utilities.ResourceGroup;
7575
cmdlet.Operator = ConditionOperator.GreaterThan;
7676
cmdlet.Threshold = 1;
77-
cmdlet.ResourceUri = "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/misitiooeltuyo";
77+
cmdlet.ResourceId = "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/misitiooeltuyo";
7878
cmdlet.MetricName = "Requests";
7979
cmdlet.TimeAggregationOperator = TimeAggregationOperator.Total;
8080
cmdlet.CustomEmails = new string[] {"[email protected],[email protected]"};
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections.Generic;
17+
using System.Management.Automation;
18+
using System.Net;
19+
using System.Threading;
20+
using System.Threading.Tasks;
21+
using Hyak.Common;
22+
using Microsoft.Azure.Commands.Insights.Autoscale;
23+
using Microsoft.Azure.Commands.Insights.OutputClasses;
24+
using Microsoft.Azure.Management.Insights;
25+
using Microsoft.Azure.Management.Insights.Models;
26+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
27+
using Moq;
28+
using Xunit;
29+
30+
namespace Microsoft.Azure.Commands.Insights.Test.Autoscale
31+
{
32+
public class AddAutoscaleSettingCommandTests
33+
{
34+
private readonly AddAutoscaleSettingCommand cmdlet;
35+
private readonly Mock<InsightsManagementClient> insightsManagementClientMock;
36+
private readonly Mock<IAutoscaleOperations> insightsAutoscaleOperationsMock;
37+
private Mock<ICommandRuntime> commandRuntimeMock;
38+
private AzureOperationResponse response;
39+
private string resourceGroup;
40+
private string settingName;
41+
private AutoscaleSettingCreateOrUpdateParameters createOrUpdatePrms;
42+
43+
public AddAutoscaleSettingCommandTests()
44+
{
45+
insightsAutoscaleOperationsMock = new Mock<IAutoscaleOperations>();
46+
insightsManagementClientMock = new Mock<InsightsManagementClient>();
47+
commandRuntimeMock = new Mock<ICommandRuntime>();
48+
cmdlet = new AddAutoscaleSettingCommand()
49+
{
50+
CommandRuntime = commandRuntimeMock.Object,
51+
InsightsManagementClient = insightsManagementClientMock.Object
52+
};
53+
54+
response = new AzureOperationResponse()
55+
{
56+
RequestId = Guid.NewGuid().ToString(),
57+
StatusCode = HttpStatusCode.OK,
58+
};
59+
60+
insightsAutoscaleOperationsMock.Setup(f => f.CreateOrUpdateSettingAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<AutoscaleSettingCreateOrUpdateParameters>(), It.IsAny<CancellationToken>()))
61+
.Returns(Task.FromResult<AzureOperationResponse>(response))
62+
.Callback((string resourceGrp, string settingNm, AutoscaleSettingCreateOrUpdateParameters createOrUpdateParams, CancellationToken t) =>
63+
{
64+
resourceGroup = resourceGrp;
65+
settingName = settingNm;
66+
createOrUpdatePrms = createOrUpdateParams;
67+
});
68+
69+
insightsManagementClientMock.SetupGet(f => f.AutoscaleOperations).Returns(this.insightsAutoscaleOperationsMock.Object);
70+
}
71+
72+
[Fact]
73+
[Trait(Category.AcceptanceType, Category.CheckIn)]
74+
public void AddAutoscaleSettingCommandParametersProcessing()
75+
{
76+
var spec = this.CreateCompleteSpec(location: "East US", name: "SettingName", profiles: null);
77+
var autoscaleRules = new List<ScaleRule> {this.CreateAutoscaleRule("IncommingReq")};
78+
var autoscaleProfile = new List<AutoscaleProfile> {this.CreateAutoscaleProfile(autoscaleRules: autoscaleRules, fixedDate: true)};
79+
80+
// Testing with a complete spec as parameter (Update semantics)
81+
// Add-AutoscaleSetting -SettingSpec <AutoscaleSettingResource> -ResourceGroup <String> [-DisableSetting [<SwitchParameter>]] [-AutoscaleProfiles <List[AutoscaleProfile]>] [-Profile <AzureProfile>] [<CommonParameters>]
82+
// Add-AutoscaleSetting -SettingSpec $spec -ResourceGroup $Utilities.ResourceGroup
83+
// A NOP
84+
cmdlet.SettingSpec = spec;
85+
cmdlet.ResourceGroup = Utilities.ResourceGroup;
86+
cmdlet.ExecuteCmdlet();
87+
88+
Assert.Equal(Utilities.ResourceGroup, this.resourceGroup);
89+
Assert.Equal("SettingName", this.settingName);
90+
Assert.NotNull(this.createOrUpdatePrms);
91+
92+
// Add-AutoscaleSetting -SettingSpec <AutoscaleSettingResource> -ResourceGroup <String> [-DisableSetting [<SwitchParameter>]] [-AutoscaleProfiles <List[AutoscaleProfile]>] [-Profile <AzureProfile>] [<CommonParameters>]
93+
// Add-AutoscaleSetting -SettingSpec $spec -ResourceGroup $Utilities.ResourceGroup -DisableSetting
94+
// Disable the setting
95+
cmdlet.DisableSetting = true;
96+
cmdlet.ExecuteCmdlet();
97+
98+
Assert.Equal(Utilities.ResourceGroup, this.resourceGroup);
99+
Assert.Equal("SettingName", this.settingName);
100+
Assert.NotNull(this.createOrUpdatePrms);
101+
102+
// Add-AutoscaleSetting -SettingSpec <AutoscaleSettingResource> -ResourceGroup <String> [-DisableSetting [<SwitchParameter>]] [-AutoscaleProfiles <List[AutoscaleProfile]>] [-Profile <AzureProfile>] [<CommonParameters>]
103+
// Adding a profile
104+
cmdlet.AutoscaleProfiles = autoscaleProfile;
105+
cmdlet.ExecuteCmdlet();
106+
107+
// Add-AutoscaleSetting -Location <String> -Name <String> -ResourceGroup <String> [-DisableSetting [<SwitchParameter>]] [-AutoscaleProfiles <List[AutoscaleProfile]>] -TargetResourceId <String> [-Profile <AzureProfile>] [<CommonParameters>]
108+
cmdlet.SettingSpec = null;
109+
cmdlet.Name = "SettingName";
110+
cmdlet.Location = "East US";
111+
cmdlet.ResourceGroup = Utilities.ResourceGroup;
112+
cmdlet.TargetResourceId = Utilities.ResourceUri;
113+
cmdlet.ExecuteCmdlet();
114+
}
115+
116+
private ScaleRule CreateAutoscaleRule(string metricName = null)
117+
{
118+
var autocaseRuleCmd = new NewAutoscaleRuleCommand
119+
{
120+
MetricName = metricName ?? "Requests",
121+
MetricResourceId = "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/misitiooeltuyo",
122+
Operator = ComparisonOperationType.GreaterThan,
123+
MetricStatistic = MetricStatisticType.Average,
124+
Threshold = 10,
125+
TimeGrain = TimeSpan.FromMinutes(1),
126+
ScaleActionCooldown = TimeSpan.FromMinutes(5),
127+
ScaleActionDirection = ScaleDirection.Increase,
128+
ScaleActionScaleType = ScaleType.ChangeCount,
129+
ScaleActionValue = "1"
130+
};
131+
132+
return autocaseRuleCmd.CreateSettingRule();
133+
}
134+
135+
private AutoscaleProfile CreateAutoscaleProfile(List<ScaleRule> autoscaleRules = null, bool fixedDate = true)
136+
{
137+
var autoscaleProfileCmd = new NewAutoscaleProfileCommandTests();
138+
139+
autoscaleProfileCmd.InitializeAutoscaleProfile(autoscaleRules);
140+
if (fixedDate)
141+
{
142+
autoscaleProfileCmd.InitializeForFixedDate();
143+
}
144+
else
145+
{
146+
autoscaleProfileCmd.InitializeForRecurrentSchedule();
147+
}
148+
149+
return autoscaleProfileCmd.Cmdlet.CreateSettingProfile();
150+
}
151+
152+
private AutoscaleSettingResource CreateCompleteSpec(string location, string name, List<AutoscaleProfile> profiles = null)
153+
{
154+
if (profiles == null)
155+
{
156+
profiles = new List<AutoscaleProfile>() { this.CreateAutoscaleProfile() };
157+
}
158+
159+
return new AutoscaleSettingResource
160+
{
161+
Location = location,
162+
Name = name,
163+
Properties = new AutoscaleSetting
164+
{
165+
Name = name,
166+
Enabled = true,
167+
Profiles = profiles,
168+
TargetResourceUri = Utilities.ResourceUri
169+
},
170+
Tags = new LazyDictionary<string, string>()
171+
};
172+
}
173+
}
174+
}

0 commit comments

Comments
 (0)