Search code examples
azureazure-data-factory

Datafactory activity output field has hyphen


I am trying to get ouput data from activity, but the field I am interesting in has an hyphen 'x-ms-approximate-messages-count':

        "Response": "",
    "ADFWebActivityResponseHeaders": {
        "x-ms-request-id": "2cae82dd-0003-005e-4344-5b880f000000",
        "x-ms-version": "2019-10-10",
        "x-ms-approximate-messages-count": "2",
        "Cache-Control": "no-cache",
        "Date": "Thu, 16 Jul 2020 07:39:31 GMT",
        "Server": "Windows-Azure-Queue/1.0;Microsoft-HTTPAPI/2.0"
    },
   ...
}

So my "If condition" activity is not good:

@equals( activity('size').output.x-ms-approximate-messages-count,0)

Error in Datafactory is:

  "code": "BadRequest",
  "message": "ErrorCode=InvalidTemplate, ErrorMessage=The expression 'equals( activity('QueueSize').output.x-ms-approximate-messages-count,0)' is not valid: the string character 'm' at position '39' is not expected.\"",

So I understand character '-' was a problem for accessing that field.

How can I access that field?


Solution

  • Please try like this:

    @equals( activity('size').output['x-ms-approximate-messages-count'],0)
    

    Hope this can help you:).