none
download payload of file at http connector to blob storage

    Question

  • I have a URL that points to a ZIP file and I want to have a logic app that takes that ZIP file and downloads it to a blob.

    I've created an HTTP action with GET as the method and validated the URL is accurate and the payload (a ZIP file) downloads as expected when I browse to the URL.  No other data is in the HTTP action.

    I've created an Azure blob storage action that I've confirmed can receive data.

    I cannot seem to figure out the syntax to actually connect the HTTP action to download the approximately 3MB ZIP file to the Azure blob storage.  I've tried every combination of dynamic inputs but something isn't working.  Help please!

    Saturday, January 12, 2019 12:55 AM

Answers

  • Please elaborate on what's not working?

    Are you not getting anything back from the HTTP Get Action?

    Is the .zip file corrupted once places in the Blob Storage?

    I have just tried myself with a public available .zip file, and it worked fine. I downloaded the .zip file from my blob storage afterwards and it opened perfectly.

    here is the Logic App code, with my subscriptionId and resource group name changed to "bla":

    {
        "$connections": {
            "value": {
                "azureblob": {
                    "connectionId": "/subscriptions/bla/resourceGroups/bla/providers/Microsoft.Web/connections/azureblob-2",
                    "connectionName": "azureblob-2",
                    "id": "/subscriptions/bla/providers/Microsoft.Web/locations/westeurope/managedApis/azureblob"
                }
            }
        },
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Create_blob": {
                    "inputs": {
                        "body": "@body('HTTP')",
                        "host": {
                            "connection": {
                                "name": "@parameters('$connections')['azureblob']['connectionId']"
                            }
                        },
                        "method": "post",
                        "path": "/datasets/default/files",
                        "queries": {
                            "folderPath": "/zipfiles",
                            "name": "@{guid()}.zip",
                            "queryParametersSingleEncoded": true
                        }
                    },
                    "runAfter": {
                        "HTTP": [
                            "Succeeded"
                        ]
                    },
                    "runtimeConfiguration": {
                        "contentTransfer": {
                            "transferMode": "Chunked"
                        }
                    },
                    "type": "ApiConnection"
                },
                "HTTP": {
                    "inputs": {
                        "method": "GET",
                        "uri": "https://www.dynaexamples.com/introduction/examples-manual/ls-dyna_example.zip/@@download/file/ls-dyna_example.zip"
                    },
                    "runAfter": {},
                    "type": "Http"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {
                "$connections": {
                    "defaultValue": {},
                    "type": "Object"
                }
            },
            "triggers": {
                "Recurrence": {
                    "recurrence": {
                        "frequency": "Minute",
                        "interval": 3
                    },
                    "type": "Recurrence"
                }
            }
        }
    }

    Morten la Cour

    Saturday, January 12, 2019 7:28 AM

All replies

  • Please elaborate on what's not working?

    Are you not getting anything back from the HTTP Get Action?

    Is the .zip file corrupted once places in the Blob Storage?

    I have just tried myself with a public available .zip file, and it worked fine. I downloaded the .zip file from my blob storage afterwards and it opened perfectly.

    here is the Logic App code, with my subscriptionId and resource group name changed to "bla":

    {
        "$connections": {
            "value": {
                "azureblob": {
                    "connectionId": "/subscriptions/bla/resourceGroups/bla/providers/Microsoft.Web/connections/azureblob-2",
                    "connectionName": "azureblob-2",
                    "id": "/subscriptions/bla/providers/Microsoft.Web/locations/westeurope/managedApis/azureblob"
                }
            }
        },
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Create_blob": {
                    "inputs": {
                        "body": "@body('HTTP')",
                        "host": {
                            "connection": {
                                "name": "@parameters('$connections')['azureblob']['connectionId']"
                            }
                        },
                        "method": "post",
                        "path": "/datasets/default/files",
                        "queries": {
                            "folderPath": "/zipfiles",
                            "name": "@{guid()}.zip",
                            "queryParametersSingleEncoded": true
                        }
                    },
                    "runAfter": {
                        "HTTP": [
                            "Succeeded"
                        ]
                    },
                    "runtimeConfiguration": {
                        "contentTransfer": {
                            "transferMode": "Chunked"
                        }
                    },
                    "type": "ApiConnection"
                },
                "HTTP": {
                    "inputs": {
                        "method": "GET",
                        "uri": "https://www.dynaexamples.com/introduction/examples-manual/ls-dyna_example.zip/@@download/file/ls-dyna_example.zip"
                    },
                    "runAfter": {},
                    "type": "Http"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {
                "$connections": {
                    "defaultValue": {},
                    "type": "Object"
                }
            },
            "triggers": {
                "Recurrence": {
                    "recurrence": {
                        "frequency": "Minute",
                        "interval": 3
                    },
                    "type": "Recurrence"
                }
            }
        }
    }

    Morten la Cour

    Saturday, January 12, 2019 7:28 AM
  • Cool, I'm comparing your example to mine and seeing what falls out, I'm sure it's something obvious, I'll post back shortly
    Monday, January 14, 2019 4:26 PM
  • just like a thought, it was a silly miss.  I didn't have ".zip" as part of the file name, I assumed it would add the type on its own.  Thanks!
    Monday, January 14, 2019 4:42 PM