title: In Azure Scheduler, how to programmatically create recurring monthly job?
body: <p>I've been able to successfully schedule jobs in Azure Scheduler using <a href="https://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Scheduler/" rel="nofollow">Microsoft Azure Scheduler Management Library</a> for all intervals except <strong>monthly on a specific day of the week</strong>. For example, I need to schedule a recurring job that runs every 1 month on the first Thursday of the month. The Azure Scheduler portal allows for this but I can't figure out how to code this using the Azure library.</p>
  
  <p>Below is the latest code I've tried. Azure Scheduler ends up creating a monthly recurring job (viewed in the Azure portal) but it doesn't show any selections for day-of-week (they're all unchecked) so the code did not work.</p>
  
  <p>I searched exhaustively online for documentation or examples for using the scheduler library for this scenario but came up empty. I am seeking a working code example for this monthly recurrence.</p>
  
  <pre><code>var monthlyOccurrence = new List&lt;JobScheduleMonthlyOccurrence&gt;();
  monthlyOccurrence.Add(new JobScheduleMonthlyOccurrence() { Day = JobScheduleDay.Thursday, Occurrence = 1 });
  
  JobCreateOrUpdateResponse jobResp = schedClient.Jobs.CreateOrUpdate("testRecurrenceIssue", new JobCreateOrUpdateParameters
  {
      Action = new JobAction
      {
          Request = new JobHttpRequest { Uri = new Uri("http://www.myservice.com"), Method = "GET" },
      },
      Recurrence = new JobRecurrence
      {
          Frequency = JobRecurrenceFrequency.Month,
          Interval = 1,
          EndTime = new DateTime(2014, 12, 31),
          Schedule = new JobRecurrenceSchedule
          {
              Days = null,
              Hours = null,
              Minutes = null,
              MonthDays = null,
              MonthlyOccurrences = monthlyOccurrence,
              Months = null
          }
      }
  });
  </code></pre>
  
  <p>Note that I've been able to schedule a monthly recurrence for specific days of the month, such as "run monthly on days 1, 14, 21, and 28" but can't figure out how to code the specific day of week scenario I mentioned above. Thanks for your help!</p>