【问题标题】:Azure Logic App - FTP connection download zip file to blob storage - output zip file corruptedAzure 逻辑应用 - FTP 连接下载 zip 文件到 Blob 存储 - 输出 zip 文件损坏
【发布时间】:2021-08-11 18:53:11
【问题描述】:

我已经设置了管道并且它可以工作(我遵循了这个文档https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-ftp),它会下载 zip 文件并将其加载到 blob 存储中。

但是生成的 zip 文件已损坏。它的大小与原始文件略有不同。

我将推断内容类型设置为“是”。也试过这个设置为 no 但没有改变结果。

我尝试使用硬编码和动态命名。

【问题讨论】:

    标签: ftp azure-logic-apps zipfile


    【解决方案1】:

    谢谢KetanChawda-MSFT。发布您的建议作为帮助社区成员的答案。

    从 blob 存储下载 .zip 文件后,此逻辑应用代码运行良好并正常打开:

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

    可以参考download payload of file at http connector to blob storageAzure Logic Apps: files get corrupted when sent via http

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-09
      • 2018-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-09
      • 1970-01-01
      相关资源
      最近更新 更多