1
votes

I have a logic app that used the Until action. The condition checks the status of an API call:

enter image description here

"Wait_Until_Cube_Processing_is_finished_": {
                "actions": {
                    "Get_Status_of_Model": {
                        "inputs": {
                            "authentication": {
                                "audience": "https://*.asazure.windows.net",
                                "clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
                                "secret": "OxxxxxxxxxxxxzskHxxxxxxxxxxxxxutjODXxxxxxx=",
                                "tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                                "type": "ActiveDirectoryOAuth"
                            },
                            "method": "GET",
                            "uri": "https://northeurope.asazure.windows.net/servers/ServerName/models/modelName/refreshes/@{body('Filter_array')[0].refreshId}"
                        },
                        "runAfter": {},
                        "type": "Http"
                    }
                },
                "expression": "@equals('status', 'succeeded')",
                "limit": {
                    "timeout": "PT1H"
                },
                "runAfter": {
                    "Filter_array": [
                        "Succeeded"
                    ]
                },
                "type": "Until"
            }
        },

The API returns such a status:

{
  "startTime": "2019-03-10T15:50:55.1278586Z",
  "type": "full",
  "status": "notStarted",
  "currentRefreshType": "full",
  "objects": [
    {
      "table": "Table1",
      "partition": "Partition_03",
      "status": "notStarted"
    }
  ]
}

My condition is not working. It runs one hour, and after one hour goes in the next step. BUT my http request recieve after 20 minutes the following state:

 {
    "refreshId": "dbxxxxxx-exxx-xxxx-xxx-3xxxxxxdaxxx",
    "startTime": "2019-03-10T15:50:55.48",
    "endTime": "2019-03-10T16:14:56.267",
    "status": "succeeded"
  }

Do you have any idea, why my Until action doesnt work?

1
It works now. Thank you for your hint - Kaja

1 Answers

2
votes

It's your condition expression problem. Your expression is "expression": "@equals('status', 'succeeded')". It means you compare string status with string succeeded, they will never be equal. That's why your loop always run into timeout PT1H . The timeout default value is PT1H,it's one hour.

So you should get the request body , then compare the state in the body with succeeded. The flow would be like this:

enter image description here

The response body is a array format, so if you want to get the state in my example, the expression is @body('HTTP_2')['properties']['state'] and below is my response body, you could refer to this expression.

enter image description here