azure-table-storage - 我可以使用 azure 逻辑应用程序删除旧的 azure 表行吗?

标签 azure-table-storage azure-logic-apps

我有一个天蓝色的表,其中包含大量的日志信息。现在我正在寻找删除旧记录(比如 X 天前)的方法。

Azure逻辑应用提供重复函数,并具有内置例程来删除Azure表中的实体。听起来真的很棒,但是,我很快就陷入了困境。这个删除实体功能需要Partition key和Row key。但是,由于我想根据 TimeStamp 字段删除行,似乎我无法使用这个。 enter image description here

好吧,我尝试先检索旧条目并循环遍历每一行,然后逐一删除它们。 (复制粘贴此tutorial)

所以我尝试创建一个过滤器查询来首先检索旧条目:

@less(item()?['TimeStamp'].addDays(utcNow(), -7))

但是,azure 说我的表达式无效。所以我猜上面的表达式是针对 blob 的,而不是针对 azure 表的?

谁能给我一些指导吗?

最佳答案

在逻辑应用中,获取实体操作支持添加过滤查询,因此添加它并使用如下查询表达式Timestamp ge datetime'2019-05 -20T01:32Z'。然后删除您获得的实体。

enter image description here

enter image description here

这里是关于Timestamp Property的描述,下面是我的结果页面。

enter image description here

更新: 您可以使用表达式 addDays(utcNow(),-41) 来过滤数据,但是您需要添加 '' 否则它将无法被识别。

enter image description here

这是过滤结果。

enter image description here

关于azure-table-storage - 我可以使用 azure 逻辑应用程序删除旧的 azure 表行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56344904/

相关文章:

c# - 表服务上下文: Can't cast to unsupported type 'DateTimeOffset' exception when serializing

c# - 无法对 Azure 存储表查询 lambda 内的字符串属性使用基于字符串的方法

特定表的 Azure SAS token

azure - 如何从数组中的嵌套对象中提取数据

Azure 逻辑应用程序,解析 JSON,但可能为 null

azure - 自动部署 JSON 映射

azure - 如何在 Terraform 中设置 Azure 逻辑应用的身份验证策略?

Azure 表存储 (400) 错误请求

sql - Windows Azure SQL 数据库中用户定义的 CLR 数据类型

azure - 为什么 Azure Runbook Webhook URI 的 URI 为空