You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Logic App:如何移除队列消息原始输入中的双引号?

解决Azure Logic App向队列发送base64消息时添加多余双引号的问题

问题原因

你在向队列添加消息的步骤中,使用了@string(outputs('Compose_2'))传递base64编码后的内容。但base64()函数返回的结果本身就是字符串类型,再次调用string()函数会触发Logic Apps的字符串序列化逻辑,自动给内容包裹一层双引号,导致下游管道解析异常。

修复方案

直接将Add_a_message_to_queue步骤中的message参数值改为@outputs('Compose_2'),去掉多余的string()转换。

修改后的队列消息添加步骤代码

"Add_a_message_to_queue": {
    "inputs": {
        "parameters": {
            "message": "@outputs('Compose_2')",
            "queueName": "queueName"
        },
        "serviceProviderConfiguration": {
            "connectionName": "connectionName",
            "operationId": "operationId",
            "serviceProviderId": "serviceProviderId"
        }
    },
    "runAfter": {
        "Compose_2": [
            "Succeeded"
        ]
    },
    "type": "ServiceProvider"
}

验证逻辑

  1. Compose步骤生成原始JSON对象
  2. Compose_2通过@base64(outputs('Compose'))将JSON对象编码为base64字符串(此时输出已是纯字符串,无额外引号)
  3. 队列消息步骤直接使用该base64字符串作为消息内容,不会触发额外的序列化包裹

内容的提问来源于stack exchange,提问作者Jason Hoehn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 12:10:39