0

This is my logic app action -

"actions": {
  "Call_API": {
    "runAfter": {},
    "type": "Http",
    "inputs": {
      "headers": {                 
        "Ocp-Apim-Subscription-Key": "[parameters('key')]"
      },
      "method": "GET",
      "queries": {                     
        "$filter": "(addressnumber eq '[parameters('add_number')]')"
      },
      "retryPolicy": {
        "type": "none"
      },
      "uri": "[parameters('url')]"
    }
  }
}

I have passed all the parameter values into parameter file. After deployment it is working fine for Ocp-Apim-Subscription-Key and uri but for $filter it is showing like same string as it is instead of parameter value add_number. why my sytax is wrong?

output coming -

"actions": {
  "Call_API": {
    "runAfter": {},
    "type": "Http",
    "inputs": {
    "headers": {                 
      "Ocp-Apim-Subscription-Key": "ce34s3cdfq3q43efwe"
    },
    "method": "GET",
    "queries": {                     
      "$filter": "(addressnumber eq '[parameters('add_number')]')"
    },
    "retryPolicy": {
      "type": "none"
    },
    "uri": "http://demo.com/api"
    }
  }
}

for $filter i was expecting output like "$filter": "(addressnumber eq '123')"

ZetaPR
  • 964
  • 7
  • 32
Neo
  • 15,491
  • 59
  • 215
  • 405

2 Answers2

0

Since you are using ARM Parameters here, you should probably have something like this instead

"$filter": "[concat('(addressnumber eq ''', parameters('add_number'), ''')')]"
PramodValavala
  • 6,026
  • 1
  • 11
  • 30
0

In simple cases the proposed ARM concat method works fine, but it easily gets very confusing if you have more complex expressions.

The other option is to use Logic App parameters instead, and set that value in ARM template. The bonus with this approach is that you can also set the parameter value without running ARM deployment by updating the Logic App parameter value from command line.

Link to docs: https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-azure-resource-manager-templates-overview#workflow-definition-and-parameters