Is there a way to create a new blob as a folder using logic apps?

霸气de小男生 提交于 2020-01-03 17:29:07

问题


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.


回答1:


First of all, Azure blob storage doesn't support folders. There is only your storage account and a list of container containing blobs.

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

Will upload the file to your desired container and tools like storage explorer will parse the slashes and display them as a folder:

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.



来源:https://stackoverflow.com/questions/48831953/is-there-a-way-to-create-a-new-blob-as-a-folder-using-logic-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!