locked
Error using SchedulerClient RRS feed

  • Question

  • Using azure management portal I've managed to add a CloudService (North europe), Made a new queue and added Scheduler Job Collection (North Europe). This Job Collection uses storage queue I've made before. This is OK. I've made a simple console app that using azure SDK connects to my resource provider. GetResourceProviderProperties is returning what I am expecting.  When I try to use SchedulerClient for instance to list all my Jobs or to Create a new one I always get an error of this kind: 

    "

    Microsoft.WindowsAzure.CloudException was unhandled
      HResult=-2146233088
      Message=NotFound: Cannot find job collection 'MYJOBCOLLECTION' under subscription 'MySUBSCRIPTIONGUID' and cloud service 'MYCLOUDSERVICE'. 
      Source=Microsoft.WindowsAzure.Management.Scheduler
      ErrorCode=NotFound
      ErrorMessage=Cannot find job collection 'MYJOBCOLLECTRION' under subscription 'MySubscriptionID' and cloud service 'MyCloudservice'. 
      StackTrace:
           at Microsoft.WindowsAzure.Scheduler.JobOperationsExtensions.Create(IJobOperations operations, JobCreateParameters parameters)
           at DirecoryServices.AzureScheduler.Program.Main(String[] args) in c:\XXXXX\AzureScheduler\Program.cs:line 68
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: 

    "

    I am using latest SDK and latest package for Auzre.managment,Scheduler etc....

    What are the possible causes of this issue? Any advice? 

    Code bellow:

    {
                var publishSettingsFilePath = @"c:\Temp\SaopDS_credentials.publishsettings";
                var subscriptionName = "Windows Azure  MSDN - Visual Studio Premium";
                var credentials = CertificateCloudCredentialsFactory.FromPublishSettingsFile(publishSettingsFilePathsubscriptionName);
                
     
                var schedulerServiceClient = new SchedulerManagementClient(credentials);
     
                var result2 = schedulerServiceClient.GetResourceProviderProperties();
                foreach (var prop in result2.Properties)
                {
                    Console.WriteLine(prop.Key + ": " + prop.Value);
                }
                Console.ReadLine();
     
                var storageAccount = new CloudStorageAccount(new StorageCredentials("XXX""dsdsdsA=="), true);
                var queueClient = storageAccount.CreateCloudQueueClient();
                var queue = queueClient.GetQueueReference("scheduler");
                queue.CreateIfNotExists();
     
                var perm = new QueuePermissions();
                var policy = new SharedAccessQueuePolicy { SharedAccessExpiryTime = DateTime.UtcNowPermissions = SharedAccessQueuePermissions.Add };
                policy.SharedAccessStartTime = DateTime.UtcNow;
                perm.SharedAccessPolicies.Add("policy"policy);
     
                queue.SetPermissions(perm);
                var sas = queue.GetSharedAccessSignature(new SharedAccessQueuePolicy(), "policy");
     
                var schedulerClient = new SchedulerClient(credentials"cs2""SchedulerJob3");
     
                var result = schedulerClient.Jobs.Create(new JobCreateParameters()
                {
                    Action = new JobAction()
                    {
                        Type = JobActionType.StorageQueue,
                        QueueMessage = new JobQueueMessage()
                        {
                            Message = "TEST MESSAGE",
                            QueueName = "scheduler",
                            SasToken = sas,
                            StorageAccountName = "XXXX"
                        }
                    },
                    StartTime = DateTime.UtcNow,
                    Recurrence = new JobRecurrence()
                    {
                        Frequency = JobRecurrenceFrequency.Minute,
                        Interval = 1,
                        Count = 2
                    }
                });
     
                Console.WriteLine(result.RequestId);
                Console.WriteLine(result.StatusCode);
                Console.ReadLine();
            }


    • Edited by MilosC Tuesday, January 28, 2014 9:14 PM
    Tuesday, January 28, 2014 9:14 PM

Answers

  • Miloš, I'd encourage you to look at the plan behind it. There have been known issues if you don't select a free plan. 
    • Proposed as answer by AnzeVodovnik Wednesday, January 29, 2014 3:25 PM
    • Marked as answer by MilosC Wednesday, January 29, 2014 8:00 PM
    Wednesday, January 29, 2014 10:08 AM

All replies

  • Miloš, I'd encourage you to look at the plan behind it. There have been known issues if you don't select a free plan. 
    • Proposed as answer by AnzeVodovnik Wednesday, January 29, 2014 3:25 PM
    • Marked as answer by MilosC Wednesday, January 29, 2014 8:00 PM
    Wednesday, January 29, 2014 10:08 AM
  • Looks like you are right. Changing JobCollectionPlan from Standard to Free made it work. Strange.

    Thanks 

    Wednesday, January 29, 2014 12:21 PM