azure - 如何使用 Azure 存储队列逻辑应用连接器设置队列消息的过期时间 (TTL)?

标签 azure azure-logic-apps azure-api-apps azure-storage-queues

在我的逻辑应用中,我看不到如何设置队列消息的 TTL 或过期日期。

Azure Put Message In Storage Queue Logic App Action

Settings for 'Put a message on a queue'

但是可以通过 UI 实现,所以我知道 API 可以做到这一点:

Azure portal: updateuser

我什至尝试将 messagettl 查询字符串参数“破解”到代码 View 中:

"actions": {
    "Put_a_message_on_a_queue": {
        "inputs": {
            "body": "@{base64(items('For_each'))}",
            "host": {
                "connection": {
                    "name": "@parameters('$connections')['azurequeues']['connectionId']"
                }
            },
            "method": "post",
            "path": "/@{encodeURIComponent('updateuser')}/messages?messagettl=3600"
        },
        "runAfter": {},
        "type": "ApiConnection"
    }
}

但是我收到一个错误:

{
 "message": "Unable to match incoming request to an operation."
}

最佳答案

我通过查看对 Azure 门户中的添加队列消息 UI 进行的 API 调用发现了这一点。它附加一个查询字符串参数 messagettl ,即 TTL 秒。

所以,我查看了架构 here并发现您可以将 "queries": {...} 对象传递给 HTTP 调用以添加消息。

最终代码查看 JSON:

"actions": {
    "Put_a_message_on_a_queue": {
        "inputs": {
            "body": "@{base64(items('For_each'))}",
            "host": {
                "connection": {
                    "name": "@parameters('$connections')['azurequeues']['connectionId']"
                }
            },
            "method": "post",
            "path": "/@{encodeURIComponent('updateuser')}/messages",
            "queries": {
                "messagettl": 3600
            }
        },
        "runAfter": {},
        "type": "ApiConnection"
    }
}

关于azure - 如何使用 Azure 存储队列逻辑应用连接器设置队列消息的过期时间 (TTL)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55497864/

相关文章:

azure - 如何从数组变量 [fileName 和 FileContent] 创建 zip 文件。使用azure函数或Azure逻辑应用程序(没有任何第三方服务)

c# - 在添加 Azure 逻辑应用程序中使用 (HttpTrigger – C#) 的 Azure 函数

python - 我在尝试通过适用于 python 的 azure api 在 azure 上创建现货实例时遇到 RDP 访问问题

java - 为什么 Spring Boot 中的 REST Controller 返回 HTTP 状态 404 – 未找到

Azure模拟器端口冲突,应用程序尝试连接到错误的端口

c# - 如何将图像从 Asp.net Core IFormFile 上传到 Azure Blob 存储?

azure - 如何在VPN中部署AKS(Azure容器服务)?

tomcat - azure : Java webrole

azure - 如何根据逻辑应用程序中的条件将主题名称作为参数传递?

azure - 是否可以匿名调用API App并自动将浏览器重定向到AD登录页面?