简体   繁体   English

天蓝色逻辑应用程序是否可以从传入的 http 请求接收文件?

[英]Is it possible for azure logic app to receive a file from incoming http request?

I wanted to know if its possible to perform a file upload request to azure logic app's HTTP listener?我想知道是否可以对 Azure 逻辑应用程序的 HTTP 侦听器执行文件上传请求?
I am not looking for built-in HTTP trigger which makes an HTTP call to the specified URL OR built-in HTTP action which makes an HTTP call to the specified URL我不是在寻找对指定 URL 进行 HTTP 调用的内置 HTTP 触发器或对指定 URL 进行 HTTP 调用的内置 HTTP 操作

Yes - the following template will store a file which was passed in the HTTP body to a Logic App as a blob into an Azure Storage container named "data".是 - 以下模板会将在 HTTP 正文中传递给逻辑应用的文件作为 blob 存储到名为“数据”的 Azure 存储容器中。 You don't have to store it in an Azure Storage account of course, you can do with the HTTP body whatever you want.当然,您不必将其存储在 Azure 存储帐户中,您可以随心所欲地使用 HTTP 正文。

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Uploads_a_Blob_to_Azure_Storage": {
                "inputs": {
                    "parameters": {
                        "blobName": "@guid()",
                        "containerName": "data",
                        "content": "@triggerBody()"
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "AzureBlob",
                        "operationId": "uploadBlob",
                        "serviceProviderId": "/serviceProviders/AzureBlob"
                    }
                },
                "runAfter": {},
                "type": "ServiceProvider"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "manual": {
                "inputs": {},
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "kind": "Stateless"
}

Call with打电话给

curl -X POST -H "Content-Type:application/octet-stream" --data-binary "@<path to your file>" "https://<logicappname>.azurewebsites.net:443/api/fileupload/triggers/manual/invoke?api-version=2020-05-01-preview[...]"

One of the workarounds is through postman.解决方法之一是通过邮递员。 Here is my logic app for your reference这是我的逻辑应用程序供您参考

在此处输入图像描述

postman request :-邮递员要求:-

在此处输入图像描述

Here is the output :-这是输出:-

在此处输入图像描述

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM