Skip to content

Commit 9c73459

Browse files
committed
FW: New-AutoscaleProfile fails to specify a profile that is always active
1 parent 5aaa288 commit 9c73459

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ResourceManager/Insights/Commands.Insights/Autoscale/NewAutoscaleProfileCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using System.Management.Automation;
1818
using Microsoft.Azure.Commands.ResourceManager.Common;
1919
using Microsoft.Azure.Management.Insights.Models;
20-
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2120

2221
namespace Microsoft.Azure.Commands.Insights.Autoscale
2322
{
@@ -157,9 +156,10 @@ public AutoscaleProfile CreateSettingProfile()
157156
Maximum = this.MaximumCapacity,
158157
},
159158

160-
// Premise: Fixed date schedule and recurrence are mutually exclusive
159+
// NOTE: "always" is specify by a null value in the FixedDate value with null ScheduledDays(Minutes, Seconds)
160+
// Premise: Fixed date schedule and recurrence are mutually exclusive, but they can both be missing so that the rule is always enabled.
161161
// Assuming dates are validated by the server
162-
FixedDate = this.ScheduleDays == null
162+
FixedDate = this.ScheduleDays == null && (this.StartTimeWindow != default(DateTime) || this.EndTimeWindow != default(DateTime))
163163
? new TimeWindow()
164164
{
165165
Start = this.StartTimeWindow,

0 commit comments

Comments
 (0)