azure - 如何使用逻辑应用程序中的 API 管理操作将正文参数传递给 API Post 操作?

标签 azure azure-logic-apps

我有一个 azure 的函数,当我从 postman 调用它时,它运行良好。我试图从逻辑应用程序中调用与收到 HTTP 请求时相同的内容。但是,我无法在 APIM 中传递原始内容,因为它没有给我相同的选项。它让我只添加订阅 key 。 我的 Azure APIM 仅接受文件名和订阅 key 。

非常感谢这方面的任何帮助。

postman :(我添加了 header - 内容类型,接受:使用)

标题: 内容类型 : 接受: Ocp-Apim-订阅 key

正文: { “名字”:“奥拉夫” }

<小时/>

Azure 逻辑应用程序:(使用 Peek 代码);

{ “输入”:{ “方法”:“帖子”, “标题”:{ “接受”:“应用程序/json”, “内容类型”:“文本/csv” }, “路径模板”:{ "模板": "/scg-liquidTransformer-functionApp/liquidtransformer/{liquidtransformfilename}", “参数”: { "liquidtransformfilename": "@{encodeURIComponent('xmlsample.liquid')}" } }, “API”:{ “id”:“/订阅/XXXXXXXXXXXXXXXXXXXXX/resourceGroups/scg-mel-dev-arg-liquidtransformer/providers/Microsoft.ApiManagement/service/scg-liquidTransformer-functionApp-apimservice/apis/scg-liquidtransformer-functionapp” }, “订阅 key ”:“XXXXXXXXXXXXXXXXXXXXXXXX” } }

我需要发送 body {} 作为 azure 函数中的参数输入 enter image description here .

谢谢, 保罗。

enter image description here

最佳答案

您需要在APIM中进行配置,请引用以下步骤:

1. 转到您的 APIM,找到您的 API 并单击“铅笔”图标。 enter image description here

2. 在下一页中,单击“请求”选项卡,然后单击“添加表示”添加“application/json”。 enter image description here

3.然后点击“新定义enter image description here

4.输入请求体的json样本,它会在“Payload”框中自动生成schema。 enter image description here

5. 点击“保存”,然后返回逻辑应用并添加 APIM api。您会发现有一个字段“名称”供您选择。 enter image description here

关于azure - 如何使用逻辑应用程序中的 API 管理操作将正文参数传递给 API Post 操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65696387/

相关文章:

azure - 如何从逻辑应用程序中的操作获取错误消息

android - Twilio SMS 正文不会连接 Azure 逻辑应用程序中的 URL 参数

azure - 生成有效的 oauth2 token 以访问 PowerBI API 时出现问题

performance - Azure Web 角色与 SQL Azure 和应用程序性能之间的延迟

c# - Fabric 异常 : The primary or stateless instance for the partition

c# - Azure 发布 :a runtime component is missing:/base/x64/IISConfigurator. exe

azure - 获得未经授权的访问以将数据从 blob 移动到共享点

c# - 在 Azure 逻辑应用中转换 XML,将 C# 程序集 (.DLL) 文件上传到 Azure 集成帐户并在 XSLT 中使用它(映射)

azure - 有没有办法在执行 Azure 逻辑应用程序的后续步骤之前完成 "wait" "Azure Data Factory"执行任务

python - 使用 Databricks 处理大量 JSON (~12TB)