如何使OpenAPI正确地用于Logic Apps自定义连接器的文件输入和文件输出? [英] How to get OpenAPI to work correctly for file input and file output for Logic Apps custom connector?

查看:106
本文介绍了如何使OpenAPI正确地用于Logic Apps自定义连接器的文件输入和文件输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将此OpenAPI规范作为自定义连接器导入逻辑应用程序:

I imported this OpenAPI spec as a custom connector into logic apps:

https://api.cloudmersive.com/swagger/api/image

https://api.cloudmersive.com/swagger/api/image

我正在尝试使用/ image / face / crop / first

I am trying to use /image/face/crop/first

它将文件作为输入,并生成一个文件作为输出。 我想从Azure存储中取出文件,将它们裁剪到面部,然后将它们存储回Azure存储。

It takes a file as input, and produces a file as output.  I want to take files in from Azure Storage, crop them to the face, and then store them back into Azure Storage.

简单,对吧? 不幸的是它没有用,因为面部裁剪第一次操作的输出并不是我在表达式生成器中创建Blob中选择的一个药丸。

Simple, right?  Unfortunately it's not working because the output of the face crop first operation does not appear as a pill for me to select in Create Blob in the Expression Builder.

有没有人对如何有任何想法让这个工作? 据我所知,它是Azure Logic应用程序中的一个错误,以及它如何处理来自OpenAPI 2.0规范的文件响应。

Does anyone have any ideas on how to get this working?  As far as I can tell it is a bug in Azure Logic apps and how it handles file responses from OpenAPI 2.0 specs.

推荐答案

Hello
bragac2

我尝试了以下方法,它对我有用:

I tried with the below approach and it worked for me:

1。获取Blob内容操作:此步骤将从blob获取图像以进行裁剪。

2。将图像裁剪为面(正方形):将图像文件框中的上一个操作中的文件内容作为输入传递。

3。创建Blob:选择用于存储输出图像的输出容器+
B lob名称 =一些随机名称和 Blob内容应该是上一步的输出,如下所示:

1. Get Blob content Action : This step will get the image from the blob to crop.
2. Crop image to face (square) : Passing the file content from the previous Action as a input here in imageFile textbox.
3. Create Blob: Choose the output container to store the output image + Blob name = some random name and Blob Content should be the output of the previous step as shown below:

@base64ToBinary(body('Crop_image_to_face_(square)')?['


content'])
content'])

CodeView:

{
    "


connections":{
" value":{
" azureblob":{
" connectionId":" / subscriptions /< SubscriptionId> / resourceGroups /< ResourceGroup> /providers/Microsoft.Web/connections/azureblob" ;,
" connectionName" ;:"azureblob",
&q uot; id":" / subscriptions /< SubscriptionId> /providers/Microsoft.Web/locations/southeastasia/managedApis/azureblob"
},
" Mytestconnector":{
" connectionId":" / subscriptions /< SubscriptionId> / resourceGroups /< ResourceGroup> /providers/Microsoft.Web/connections/ Mytestconnector",
" connectionName":" Mytestconnector",
" id":" / subscriptions /< SubscriptionId> / resourceGroups /< ResourceGroup> /providers/Microsoft.Web/customApis / Mytestconnector"
}
}
},
" definition":{
"
connections": { "value": { "azureblob": { "connectionId": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.Web/connections/azureblob", "connectionName": "azureblob", "id": "/subscriptions/<SubscriptionId>/providers/Microsoft.Web/locations/southeastasia/managedApis/azureblob" }, "Mytestconnector": { "connectionId": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.Web/connections/Mytestconnector", "connectionName": "Mytestconnector", "id": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.Web/customApis/Mytestconnector" } } }, "definition": { "


这篇关于如何使OpenAPI正确地用于Logic Apps自定义连接器的文件输入和文件输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆