I am currently running a console application to update auto scaling on my azure subscription however I am running into issues with day and night profiles.
I am have two profiles that run for night and day for weekdays. I threw it together to play around with the api but I am getting wierd results.
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);
Now when I load the profile into the cloud this shows up two profile but both of them are the exact same in every way. I am wondering if it is because my days are overlapping. I though this was possible since you can set day and night hours manually through the portal. Am I missing something like a switch or a setting.