In my Mule 4 application I Azure Storage connector to successfully upload a blob to my Azure container:
However this adds the file into the root directory of "my-container".
I want to add the file to my-container/examples
- i.e. the examples folder inside my-container.
How can I do this within Mule 4?
Connector XML (edit):
<azure-storage:upload-blob doc:name="Upload Json" doc:id="63fa613e-b355-4b6f-9f81-4ddd8dd40998" config-ref="azure_storage_config">
<azure-storage:storblob container="my-container" fileStream="#[payload]" fileName="file.json"/>
</azure-storage:upload-blob>
There is actually only a single layer of containers. What you see as folders in Azure are only "virtual" folders which are created by actually naming the objects in hierarchical manner.
In other words, all the objects are stored inside the container directly and when you create a file in a folder, what you are actually doing is creating the file with the name folder/filename
So, you can create the "virtual" folder by passing the filename like examples/file.json
in the connector
<azure-storage:upload-blob doc:name="Upload Json" doc:id="63fa613e-b355-4b6f-9f81-4ddd8dd40998" config-ref="azure_storage_config">
<azure-storage:storblob container="my-container" fileStream="#[payload]" fileName="examples/file.json"/>
</azure-storage:upload-blob>