In the end I was able to solve the issue by adding a compose step before the condition and after the steps which will get me the content of the BLOB-file. The compose get's the content of the blob-file which I then can validate against the CustomerId I want. This topic got me in the right direction for my solution.
UPDATE:
The final logic app looks like this;
Which is begin created with the following logic app code;
{
"$connections": {
"value": {
"azureblob": {
"connectionId": "<snip>",
"connectionName": "azureblob",
"id": "<snip>"
},
"slack": {
"connectionId": "<snip>",
"connectionName": "slack",
"id": "<snip>"
}
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Compose": {
"inputs": "@base64ToString(body('Get_blob_content').$content)",
"runAfter": {
"Get_blob_content": [
"Succeeded"
]
},
"type": "Compose"
},
"Condition_2": {
"actions": {
"Condition_3": {
"actions": {
"Delete_blob_3": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "delete",
"path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(triggerBody()?['Id']))}"
},
"runAfter": {},
"type": "ApiConnection"
}
},
"else": {
"actions": {
"Copy_blob_2": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "post",
"path": "/datasets/default/copyFile",
"queries": {
"destination": "/<some-blob-container>/@{triggerBody()?['Name']}",
"overwrite": false,
"queryParametersSingleEncoded": true,
"source": "@triggerBody()?['Path']"
}
},
"runAfter": {
"Post_message_2": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"Delete_blob_4": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "delete",
"path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(triggerBody()?['Id']))}"
},
"runAfter": {
"Copy_blob_2": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"Post_message_2": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['slack']['connectionId']"
}
},
"method": "post",
"path": "/chat.postMessage",
"queries": {
"channel": "<snip>",
"text": "<some-message>"
}
},
"runAfter": {},
"type": "ApiConnection"
}
}
},
"expression": {
"or": [
{
"equals": [
"@outputs('HTTP_2')['statusCode']",
200
]
},
{
"equals": [
"@outputs('HTTP_2')['statusCode']",
202
]
}
]
},
"runAfter": {
"HTTP_2": [
"Succeeded",
"Failed"
]
},
"type": "If"
},
"HTTP_2": {
"inputs": {
"authentication": {
"password": "<some-password>",
"type": "Basic",
"username": "<some-username>"
},
"body": "@outputs('Compose')",
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"uri": "<some-url>"
},
"runAfter": {},
"type": "Http"
}
},
"else": {
"actions": {
"Condition_4": {
"actions": {
"Delete_blob_5": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "delete",
"path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(triggerBody()?['Id']))}"
},
"runAfter": {},
"type": "ApiConnection"
}
},
"else": {
"actions": {
"Copy_blob_3": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "post",
"path": "/datasets/default/copyFile",
"queries": {
"destination": "/<some-blob-container>/@{triggerBody()?['Name']}",
"overwrite": false,
"queryParametersSingleEncoded": true,
"source": "@triggerBody()?['Path']"
}
},
"runAfter": {
"Post_message_3": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"Delete_blob_6": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "delete",
"path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(triggerBody()?['Id']))}"
},
"runAfter": {
"Copy_blob_3": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"Post_message_3": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['slack']['connectionId']"
}
},
"method": "post",
"path": "/chat.postMessage",
"queries": {
"channel": "<snip>",
"text": "<some-message>"
}
},
"runAfter": {},
"type": "ApiConnection"
}
}
},
"expression": {
"or": [
{
"equals": [
"@outputs('HTTP_3')['statusCode']",
200
]
},
{
"equals": [
"@outputs('HTTP_3')['statusCode']",
202
]
}
]
},
"runAfter": {
"HTTP_3": [
"Succeeded"
]
},
"type": "If"
},
"HTTP_3": {
"inputs": {
"authentication": {
"password": "<some-password>",
"type": "Basic",
"username": "<some-username>"
},
"body": "@outputs('Compose')",
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"uri": "<some-url>"
},
"runAfter": {},
"type": "Http"
}
}
},
"expression": {
"and": [
{
"contains": [
"@outputs('Compose')",
"\"CustomerId\":\"00000000-0000-0000-0000-000000000000\""
]
}
]
},
"runAfter": {
"Compose": [
"Succeeded"
]
},
"type": "If"
},
"Get_blob_content": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(triggerBody()?['Path']))}/content",
"queries": {
"inferContentType": true
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"When_a_blob_is_added_or_modified_(properties_only)": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/triggers/batch/onupdatedfile",
"queries": {
"folderId": "<some-generated-folderid>",
"maxFileCount": 100
}
},
"metadata": {
"<some-generated-folderid>": "/<some-blob-container>"
},
"recurrence": {
"frequency": "Minute",
"interval": 1
},
"splitOn": "@triggerBody()",
"type": "ApiConnection"
}
}
}
}