0
votes

I've set up the pipeline and it works (I followed this documentation https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-ftp), it downloads the zip file and loads it to the blob storage.

https://i.stack.imgur.com/Sm3Ex.png

create blob

however the resulted zip file is corrupted. it has a slightly different size than the original file.

zip file corrupted

I set the infer content type to YES. Also tried this setting to no but didn't change result.

infer content type

I tried with hardcoded and dynamic naming.

dynamic name

1

1 Answers

0
votes

Thank you KetanChawda-MSFT. Posting your suggestion as an answer to help community members.

This Logic App code works well after downloading the .zip file from blob storage and it opened properly:

{
    "$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"
            }
        }
    }
}

You can refer to download payload of file at http connector to blob storage and Azure Logic Apps: files get corrupted when sent via http