如何在逻辑应用程序中从不同文件夹附加多个 blob?
您好,我在天蓝色逻辑应用程序中工作。我的 Blob 存储中有以下 Blob。
Predesign/guid/AdditionalDocument/somefile.ext
Predesign/guid/CalcOutput/somefile.ext
Predesign/guid/DataSheet/somefile.ext
下面的步骤是列出我已给出示例路径 Predesign/guid 的 blob(在实际实现中,我会将 guid 视为动态)。在 guid 内部,我有多个子文件夹,如上所述
然后我有 sendemail 活动来发送带有附件的电子邮件。当我运行代码时,出现以下错误
{
"status": 404,
"message": "Specified blob PreDesign/1e36d504-7876-41b1-89b3-83d2132fa7c4/AdditionalDocumets/ does not exist.\r\nclientRequestId: fcb3f5d4-aca2-4c8e-bb8d-543d31fa9cb3",
"error": {
"message": "PreDesign/1e36d504-7876-41b1-89b3-83d2132fa7c4/AdditionalDocumets/ does not exist."
},
"source": "azurewebsites.net"
}
3 个文件夹“附加文档”、“计算输出”和“数据表”也会出现相同的错误。所以基本上我无法从这些不同的文件夹中获取内容。有人可以帮我附加不同文件夹中的多个文档吗?任何帮助将不胜感激。谢谢
Hi I am working in azure logic app. I have below blobs in my blob storage.
Predesign/guid/AdditionalDocument/somefile.ext
Predesign/guid/CalcOutput/somefile.ext
Predesign/guid/DataSheet/somefile.ext
Below step is to list blobs i have given sample path Predesign/guid(in real implementation i will take guid as dynamic). Inside guid i have multiple subfolders as mentioned above
Then I have sendemail activity to send email with attachments. When I run my code I get below error
{
"status": 404,
"message": "Specified blob PreDesign/1e36d504-7876-41b1-89b3-83d2132fa7c4/AdditionalDocumets/ does not exist.\r\nclientRequestId: fcb3f5d4-aca2-4c8e-bb8d-543d31fa9cb3",
"error": {
"message": "PreDesign/1e36d504-7876-41b1-89b3-83d2132fa7c4/AdditionalDocumets/ does not exist."
},
"source": "azurewebsites.net"
}
Same error occurs for 3 folders Additional Documets, CalcOutput and Data sheet. So basically I am not able to get content from these different folders. Can someone help me to attach multiple documents from different folders? Any help would be appreciated. Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您收到此错误的原因可能是以下原因之一。
拼写错误的路径。
如果您提到的路径是手动写入的,请尝试使用打开的文件框指向正确的文件夹。因为我可以看到你一开始就提到了 Predesign,但是在提到它的时候
连接失败
您的逻辑应用连接器与存储帐户的连接可能出现故障。尝试创建与您的存储帐户的新连接。
假设如果文件夹结构如下
WAY-1
所示,您可以有 2 个
List blob
连接器并迭代它们。这是我的逻辑应用程序的屏幕截图供参考。输出
Directory1 中的 Blob 列表
Directory2 中的 Blob 列表
WAY-2
您可以在 foreach 中使用 foreach 循环。这是我的逻辑应用程序的屏幕截图。
输出:-
这是我的逻辑应用程序的代码视图,
当我们要迭代的文件夹很多时,这些方法可能有点笨拙。在这种情况下,最有效的方法是使用 azure 函数。有关详细信息,您可以参考 获取所有文件夹中的所有文件列表
You might be receiving this error probably because of one of the following reasons.
A misspelt path.
If the path that you are mentioning is manually written Please try pointing the right folder using the open file box. Because I can see you mention Predesign at first but while mentioning it
A connection failure
You might be having a connection failure to your storage account from your logic app connector. Try creating a new connection to your storage account.
Suppose if the folder structure looks like below
WAY-1
you can have 2
List blobs
connectors and iterate through the same. Here is the screenshot of my logic app for reference.output
List of Blobs in Directory1
List of Blobs in Directory2
WAY-2
You can use for each loop inside a for each. Here is the screenshot of my logic app.
output:-
Here is the code view of my logic app
These methods might be a bit clumsy when there are many folders that we want to iterate. In that case the most effective way is to use azure functions. For more information in this you can refer Get List of all files from all folder