有没有一种方法可以使用逻辑应用程序将新的Blob创建为文件夹? [英] Is there a way to create a new blob as a folder using logic apps?
问题描述
我已经设置了一个逻辑应用程序,可以将FTP服务器上的新文件移动到我的azure存储容器中,该存储容器中包含我的文件的blob.我找到了一种使用存储资源管理器创建新文件夹的方法,但是有没有一种方法可以使用逻辑应用程序自动执行此操作?例如,如果在我的FTP中创建了一个新文件夹并将文件添加到其中,则我想创建一个blob文件夹并将这些文件移动到该blob中.
I've set up a logic app to move my new files on my FTP server to my azure storage container, which has blobs for my files. I found a way to create new folders using the storage explorer, but is there a way I can automate this using logic apps? For example, if a new folder is created in my FTP and files are added to it, I want to create a blob folder and move those files into that blob.
推荐答案
首先,Azure Blob存储不支持文件夹.只有您的存储帐户和一个包含blob的容器列表.
First of all, Azure blob storage doesn't support folders. There is only your storage account and a list of container containing blobs.
您可以做的是通过添加包含斜杠的名称来模拟一个目录. G.上传以下文件:
What you can do is to simulate a directory by adding a name that contains a slash, e. g. uploading the following file:
/myVirtualFolder/test.txt
将文件上传到所需的容器,诸如Storage Explorer这样的工具将解析斜线并将其显示为文件夹:
Will upload the file to your desired container and tools like storage explorer will parse the slashes and display them as a folder:
但是,如果您检查test.txt的元数据,您将看到实际的文件名是/myVirtualFolder/test.txt
:
But if you check the metadata for test.txt, you will see that the actual file name is /myVirtualFolder/test.txt
:
因此,您要做的就是通过将虚拟目录添加到其名称来将所有文件从目标目录上载到容器.您可以也不必先创建文件夹.
So all you have to do is to upload all your files from your target directory to the container by adding the virtual directory to its name. You can`t and don't have to create a folder first.
这篇关于有没有一种方法可以使用逻辑应用程序将新的Blob创建为文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!