New-AzureSchedulerStorageQueueJob

Creates a scheduler job that has a Storage action.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

New-AzureSchedulerStorageQueueJob
   -Location <String>
   -JobCollectionName <String>
   -JobName <String>
   -StorageQueueAccount <String>
   -StorageQueueName <String>
   -SASToken <String>
   [-StorageQueueMessage <String>]
   [-StartTime <DateTime>]
   [-Interval <Int32>]
   [-Frequency <String>]
   [-EndTime <DateTime>]
   [-ExecutionCount <Int32>]
   [-JobState <String>]
   [-ErrorActionMethod <String>]
   [-ErrorActionURI <Uri>]
   [-ErrorActionRequestBody <String>]
   [-ErrorActionHeaders <Hashtable>]
   [-ErrorActionStorageAccount <String>]
   [-ErrorActionStorageQueue <String>]
   [-ErrorActionSASToken <String>]
   [-ErrorActionQueueMessageBody <String>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
New-AzureSchedulerStorageQueueJob
   [-StorageQueueMessage <String>]
   [-Interval <Int32>]
   [-Frequency <String>]
   [-EndTime <DateTime>]
   [-ExecutionCount <Int32>]
   [-JobState <String>]
   [-ErrorActionHeaders <Hashtable>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module. To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version.

The New-AzureSchedulerStorageQueueJob cmdlet creates a scheduler job that has an Azure Storage action.

Examples

Example 1: Create a Storage job that runs once

PS C:\> New-AzureSchedulerStorageQueueJob -JobCollectionName "JobCollection01" -JobName "Job01" -Location "North Central US" -StorageQueueAccount "ContosoStorageAccount" -StorageQueueName "ContosoStorageQueue" -SASToken "?sv=2012-02-12&si=samplePolicy%2F30%2F2014%206%3A37%3A36%20PM&sig=vLQEbSfZbTFh7q3YrzlxBeL%2BjiYKp0gE6lMJ0a5Nb4M%3D"

This command creates a scheduler Storage job as part of the collection named JobCollection01. The command specifies the Storage account, queue name, and SAS token. The job runs once, immediately.

Example 2: Create a Storage job that runs a specified number of times

PS C:\> New-AzureSchedulerStorageQueueJob -JobCollectionName "JobCollection01" -JobName "Job12" -Location "North Central US"-StorageQueueAccount "ContosoStorageAccount" -StorageQueueName "ContosoStorageQueue" -SASToken "?sv=2012-02-12&si=samplePolicy%2F30%2F2014%206%3A37%3A36%20PM&sig=vLQEbSfZbTFh7q3YrzlxBeL%2BjiYKp0gE6lMJ0a5Nb4M%3D" -ExecutionCount 20 -Frequency "Hour" -Interval 2

This command creates a scheduler Storage job as part of the collection named JobCollection01. The command specifies the Storage account, queue name, and SAS token. The job runs 20 times in total, twice every hour.

Parameters

-EndTime

Specifies a time, as a DateTime object, for the scheduler to stop initiating the job. To obtain a DateTime object, use the Get-Date cmdlet. For more information, type Get-Help Get-Date.

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ErrorActionHeaders

Specifies headers as a hash table.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ErrorActionMethod

Specifies the method for HTTP and HTTPS action types. Valid values are:

  • GET
  • PUT
  • POST
  • HEAD
  • DELETE
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ErrorActionQueueMessageBody

Specifies the body for Storage job actions.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ErrorActionRequestBody

Specifies the body for PUT and POST job actions.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ErrorActionSASToken

Specifies the Shared Access Signature (SAS) token for the Storage queue.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ErrorActionStorageAccount

Specifies the name of the Storage account.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ErrorActionStorageQueue

Specifies the name of the Storage queue.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ErrorActionURI

Specifies the URI for the error job action.

Type:Uri
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExecutionCount

Specifies the number occurrences of a job that run. By default, a job recurs indefinitely.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Frequency

Specifies the maximum frequency for this scheduler job.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Interval

Specifies the interval of recurrence at the frequency specified by using the Frequency parameter.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobCollectionName

Specifies the name of the collection to contain the scheduler job.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-JobName

Specifies the name for the scheduler job.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-JobState

Specifies the state for the scheduler job.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Location

Specifies the name of the location that hosts the cloud service. Valid values are:

  • Anywhere Asia
  • Anywhere Europe
  • Anywhere US
  • East Asia
  • East US
  • North Central US
  • North Europe
  • South Central US
  • Southeast Asia
  • West Europe
  • West US
Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SASToken

Specifies the SAS token for the Storage queue.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StartTime

Specifies a time, as a DateTime object, for the job to start.

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageQueueAccount

Specifies the Storage account name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StorageQueueMessage

Specifies the queue message for Storage job.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageQueueName

Specifies the name of the Storage queue.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False