azure - 通过 Azure 逻辑应用从 Azure 容器中上次修改的文件夹中获取 Blob 内容

标签 azure azure-storage azure-blob-storage azure-logic-apps

我有一个 Azure 逻辑应用,它定期从我的 Azure 存储帐户获取 blob 内容。但是,我的 blob 存储在子目录中。 例如。 MyContainer > 发票 > 20200101 > Invoice1.csv

每个月我的第三个子目录“20200101”都会更改为“20200201”、“20200301”等等。 我需要我的逻辑应用程序返回在我的容器中创建的最新文件夹的 blob 内容。 对此有什么建议吗?

谢谢!!

最佳答案

对于此要求,请参阅下面我的逻辑应用:

1.列出 /mycontainer/Invoice/ 下的所有文件夹。 enter image description here

2.初始化两个Integer类型的变量,一个名为maxNum,另一个名为numberFormatOfNameenter image description here

3. 使用“For every”循环上面“List blob”中的。在“For every”循环中,首先使用表达式 int(replace(items('For_each')?['Name'], '/', '')) 设置 numberFormatOfName >。然后添加一个“If”条件来判断numberFormatOfName是否大于maxNum。如果为 true,则使用 numberFormatOfName 设置 maxNum 的值。 enter image description here

4. 在“Foreach”循环之后,使用另一个“List blob”列出最新(最大数量)文件夹中的所有 blob。下面屏幕截图中的表达式是string(variables('maxNum'))enter image description here

如果您不想列出 blob,但想要获取 blob 内容。你可以像下面这样做: enter image description here

================================更新========= =====================

运行逻辑应用程序,我得到的结果如下图所示:

enter image description here

我在 Blob 存储中的 /mycontainer/Invoice 下创建了三个文件夹 202001012020020220200303。三个csv文件的内容分别是111,111222,222333,333。逻辑应用响应第三个 csv 文件内容 333,333

================================更新2========= ===================

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

关于azure - 通过 Azure 逻辑应用从 Azure 容器中上次修改的文件夹中获取 Blob 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64495562/

相关文章:

azure - 什么是 Azure Redis 缓存?

mongodb - 在 Azure 中运行 MongoDB

azure - 如何限制Azure表存储日志的大小?

apache-spark - 如何从独立的 Spark 集群访问 azure block 文件系统 (abfss)

azure - 通过ARM模板创建.NET 5 Function App后为"Service Unavailable"

ios - 在 azure-storage-ios SDK 中初始化 AZSCloudStorageAccount 时出现未指定错误

Azure 身份 : Trying to get GetUserDelegationKey to work with an application Service Principal

node.js - 使用 Node 转换来自 Azure 表存储的响应

c# - 编码 UI C# - 如何将捕获的图像上传到 Azure 存储容器

c# - 从 azure blob 存储文件生成 Zip 文件