{ "definition": { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "actions": { "For_each": { "actions": { "Append_to_array_variable": { "inputs": { "name": "attachment", "value": { "ContentBytes": "@{base64(body('Get_blob_content_(V2)'))}", "Name": "@{substring(items('For_each'), add(lastIndexOf(items('For_each'),'/'), 1), sub(sub(length(items('For_each')),1), lastIndexOf(items('For_each'),'/')))}" } }, "runAfter": { "Get_blob_content_(V2)": [ "Succeeded" ] }, "type": "AppendToArrayVariable" }, "Get_blob_content_(V2)": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['azureblob_1']['connectionId']" } }, "method": "get", "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/files/@{encodeURIComponent(encodeURIComponent(items('For_each')))}/content", "queries": { "inferContentType": true } }, "metadata": { "JTJmdGVzdCUyZkNvZGVWaWV3LnR4dA==": "/test/CodeView.txt" }, "runAfter": {}, "type": "ApiConnection" } }, "foreach": "@triggerBody()?['path']", "runAfter": { "Initialize_variable": [ "Succeeded" ] }, "runtimeConfiguration": { "concurrency": { "repetitions": 1 } }, "type": "Foreach" }, "Initialize_variable": { "inputs": { "variables": [ { "name": "attachment", "type": "array" } ] }, "runAfter": {}, "type": "InitializeVariable" }, "Send_an_email_(V2)": { "inputs": { "body": { "Attachments": "@variables('attachment')", "Body": "
Test
", "Importance": "Normal", "Subject": "Test", "To": "mabargal@microsoft.com" }, "host": { "connection": { "name": "@parameters('$connections')['office365']['connectionId']" } }, "method": "post", "path": "/v2/Mail" }, "runAfter": { "For_each": [ "Succeeded" ] }, "type": "ApiConnection" } }, "contentVersion": "1.0.0.0", "outputs": {}, "parameters": { "$connections": { "defaultValue": {}, "type": "Object" } }, "triggers": { "manual": { "inputs": { "schema": { "properties": { "path": { "items": { "type": "string" }, "type": "array" } }, "type": "object" } }, "kind": "Http", "type": "Request" } } }, "parameters": { "$connections": { "value": { "azureblob_1": { "connectionId": "/subscriptions/{subscription ID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/connections/azureblob-1", "connectionName": "azureblob-1", "id": "/subscriptions/{subscription ID}/providers/Microsoft.Web/locations/northcentralus/managedApis/azureblob" }, "office365": { "connectionId": "/subscriptions/{subscription ID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/connections/office365", "connectionName": "office365", "id": "/subscriptions/{subscription ID}/providers/Microsoft.Web/locations/northcentralus/managedApis/office365" } } } } }