locked
Azure PowerShell cmdlets and Azure Scheduler Storage Queue Error Action RRS feed

  • Question

  • Am I missing something?


    The following PowerShell cmdlets (0.8.10) have Error Action parameters which allow you specify storage queue values:

    New-AzureSchedulerHttpJob
    http://msdn.microsoft.com/en-us/library/dn722492.aspx

    Set-AzureSchedulerHttpJob
    New-AzureSchedulerStorageQueueJob
    Set-AzureSchedulerStorageQueueJob


    -ErrorActionStorageAccount
    -ErrorActionStorageQueue
    -ErrorActionQueueMessageBody
    -ErrorActionSASToken


    However, when trying to create/set an error action to use storage queue on an http job, there is no option to specify type storageQueue as referenced in the following article:

    http://msdn.microsoft.com/en-us/library/azure/dn528941.aspx

    There is no -ErrorActionType parameter.


    This command issues the following REST API call which fails as the type is http and not storageQueue.

        New-AzureSchedulerHttpJob -Location "North Europe" -JobCollectionName "test-collection" -JobName "test01" `
            -Method GET `
            -URI "http://bingggggg.com/" `
            -Frequency Minute -Interval 5 `
            -ErrorActionStorageAccount "teststorageaccout" `
            -ErrorActionStorageQueue "teststoragequeue" `
            -ErrorActionQueueMessageBody "Hello World" `
            -ErrorActionSASToken "?sv=2014-02-14&sig=XXXX&sp=a"

        {
          "action": {
            "type": "http",
            "errorAction": {
              "type": "http",
              "queueMessage": {
                "storageAccount": "teststorageaccout",
                "queueName": "teststoragequeue",
                "sasToken": "?sv=2014-02-14&sig=XXXX&sp=a",
                "message": "Hello World"
              }
            },
            "request": {
              "uri": "http://bingggggg.com/",
              "method": "GET",
              "headers": {}
            }
          },
          "recurrence": {
            "frequency": "minute",
            "interval": 5
          }
        }

    The response is:

        <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <Code>BadRequest</Code>
        <Message>The Http Action Request is either missing or malformed</Message></Error>


    Issuing a this PATCH request via the REST API correctly sets the error action to use a storage queue

        {
        "action":
        {
        "type": "http",
        "request":
        {
        "uri": "http://bingggggggx.com/",
        "method": "GET",
                    "headers": {}
        },
        "errorAction":
        {
                   "type": "storageQueue",
        "queueMessage":
        {
        "storageAccount": "teststorageaccout",
        "queueName": "teststoragequeue",
        "sasToken": "?sv=2014-02-14&sig=XXXX&sp=a",
        "message":
        "Hello World"
        }
                }
        }
        }
    • Edited by Andy J W Wednesday, October 29, 2014 3:21 PM
    Wednesday, October 29, 2014 3:12 PM

All replies

  • Hi,

    From the error message, It seems there is some issue in action request, please check it carefully then try again.

    Regards


    • Edited by Oliverfan Thursday, October 30, 2014 10:12 AM
    Thursday, October 30, 2014 10:11 AM
  • Hi Adian,

    Because the resulting json request (from using the cmdlets) sets the type of the errorAction to http. The errorAction node is missing the required entries for an http type job, namely:

    "request":
        {
        "uri": "http://bingggggggx.com/",
        "method": "GET",
                    "headers": {}
        },

    However, I would like to set the errorAction type to strorageQueue and not http.

    Many thanks for the response.


    • Edited by Andy J W Thursday, October 30, 2014 10:54 AM
    Thursday, October 30, 2014 10:49 AM