How to fetch the child items within a folder located on azure blob
I am trying to fetch child items of a folder for recursive deletion, so my expectation is to delete the folders within the folder, like if folder A has subfolder B with file b and another subfolder AB has subfolder D, then deleting all items from directory A with file a.txt and subfolder B and its contents b.txt and subfolder AB and its contents, on selection of deletion activity iteratively,
but after I filter the folder items that need to be deleted, which gives me the output
{
"ItemsCount": 1,
"FilteredItemsCount": 1,
"Value": [
{
"name": "Feb25_Test_del - Copy",
"type": "Folder"
}
]
}
I have provided a for each loop activity with items to loop on as
@activity('FilterFolders').output.value
within the foreach I gave a get metadata activity to fetch the child items of the folder
where the dataset correctly points to the folder on the container, which is parameterized to take the folder name as input
p / bp/ @dataset.folderName
and in the Dataset properties the foldername is provided as
@concat('/',item().name)
and field list as Child items which gave error
Field 'childItems' failed with error: 'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot navigate through the provided data source. Make sure the provided data source is a directory that can do navigation.,Source=Microsoft.DataTransfer.ClientLibrary,'.
set variable activity, in for each loop, before getMetadata, which succeeded with output as
"name": "FolderName", "value": "/Feb25_Test_del - Copy" for pipeline expression builder
@concat('/',item().name)