我目前正在运行一个控制台应用程序来更新我的 azure 订阅上的自动缩放,但是我遇到了日夜配置文件的问题。
我有两个配置文件,在工作日白天和晚上运行。我把它放在一起玩api,但我得到了奇怪的结果。
var weekDayProfile = new AutoscaleProfile
{
Capacity = new ScaleCapacity
{
Default = settings.Default.ToString(),
Maximum = settings.Maximum.ToString(),
Minimum = settings.Minimum.ToString()
},
Name = "Day",
Recurrence = new Recurrence
{
Frequency = RecurrenceFrequency.Week,
Schedule = new RecurrentSchedule
{
Days = new List<String> { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" },
Hours = { 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 },
Minutes = new List<int> { 0 },
TimeZone = "Central Standard Time"
}
},
Rules = GenerateScaleRules(cloudServiceName, roleName, isProduction, settings)
};
settings.SetProfileSettings(ProfileEnum.NonProdWeekNight);
var weekNightProfile = new AutoscaleProfile
{
Capacity = new ScaleCapacity
{
Default = settings.Default.ToString(),
Maximum = settings.Maximum.ToString(),
Minimum = settings.Minimum.ToString()
},
Name = "Night",
Recurrence = new Recurrence
{
Frequency = RecurrenceFrequency.Week,
Schedule = new RecurrentSchedule
{
Days = new List<String> { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" },
Hours = {0, 1, 2, 3, 4, 5, 6, 7, 21, 22, 23},
Minutes = new List<int> { 0 },
TimeZone = "Central Standard Time"
}
},
Rules = GenerateScaleRules(cloudServiceName, roleName, isProduction, settings)
};
settings.SetProfileSettings(ProfileEnum.NonProdWeekEnd);
现在,当我将配置文件加载到云中时,这会显示两个配置文件,但它们在各个方面都完全相同。我想知道是不是因为我的日子是重叠的。我认为这是可能的,因为您可以通过门户手动设置白天和黑夜时间。我是否缺少开关或设置之类的东西。