Created
December 4, 2017 14:11
-
-
Save CoditCompany/37dcfcf1613abafbbb5dea59bce877da to your computer and use it in GitHub Desktop.
CodeView of a LogicApp dynamically referring to the API Connection to be used, based on a value from a HTTP Header from the inbound request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$connections": { | |
"value": { | |
"FirstAPI": { | |
"connectionId": "/subscriptions/<subscriptionId>/resourceGroups/LogicApps_APIConn/providers/Microsoft.Web/connections/FirstAPI", | |
"connectionName": "FirstAPI", | |
"id": "/subscriptions/<subscriptionId>/providers/Microsoft.Web/locations/northeurope/managedApis/ftp" | |
}, | |
"SecondAPI": { | |
"connectionId": "/subscriptions/<subscriptionId>/resourceGroups/LogicApps_APIConn/providers/Microsoft.Web/connections/SecondAPI", | |
"connectionName": "SecondAPI", | |
"id": "/subscriptions/<subscriptionId>/providers/Microsoft.Web/locations/northeurope/managedApis/ftp" | |
} | |
} | |
}, | |
"definition": { | |
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
"actions": { | |
"Create_file": { | |
"inputs": { | |
"body": "@triggerBody()", | |
"host": { | |
"connection": { | |
"name": "@parameters('$connections')[triggerOutputs()['headers']['APIConnectionName']]['connectionId']" | |
} | |
}, | |
"method": "post", | |
"path": "/datasets/default/files", | |
"queries": { | |
"folderPath": "@{triggerOutputs()['headers']['Folder']}", | |
"name": "@{triggerOutputs()['headers']['FileName']}" | |
} | |
}, | |
"runAfter": {}, | |
"runtimeConfiguration": { | |
"contentTransfer": { | |
"transferMode": "Chunked" | |
} | |
}, | |
"type": "ApiConnection" | |
} | |
}, | |
"contentVersion": "1.0.0.0", | |
"outputs": {}, | |
"parameters": { | |
"$connections": { | |
"defaultValue": {}, | |
"type": "Object" | |
} | |
}, | |
"triggers": { | |
"manual": { | |
"inputs": { | |
"schema": {} | |
}, | |
"kind": "Http", | |
"type": "Request" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment