Share via


Easiest way to delete ALL files (blobs??) in a container from logic app

Question

Friday, December 29, 2017 4:01 PM

Is there a way with a delete blob operation to delete all files in a logic app?  Something like *.* for delete blobs?  Everything needs to go for the next days' ETL load of files to process.

Thanks!

All replies (4)

Monday, January 8, 2018 7:17 PM âś…Answered | 1 vote

Hi MSChandler,

I think the issue with that is that the Blog Storage Rest API doesn't support a bulk operation for blob deletion (I was trying to find one here, but couldn't).

So strictly speaking, within Logic Apps, the only available option using the connectors is to list the items and loop through.

If you want to use the API directly, there is one API for containers, where you can find operations to create and delete containers. So you could potentially remove then re-create the container. This might be tricky if you have specific permissions associated to the container. Another complicating factor is that the container is just marked for deletion, so you would have to wait until it was deleted before recreating.

I hope this helps, Wagner.


Friday, December 29, 2017 5:13 PM | 1 vote

Following link may help

https://sameeraman.wordpress.com/2017/08/25/logic-apps-delete-files-older-than-x-days-from-a-blob-storage/

Gaurav Khanna | Microsoft MVP | Microsoft Community Contributor


Monday, January 8, 2018 3:30 PM

So I basically had the loop running and deleting one at a time and that's what the link has as well.  I guess my question wasn't very clear now that I re-read it.

I get a new set of 1,500+ files everyday and just need to delete all those files and start fresh in one call or run or whatever.  Looping one at a time seems like a lot of extra work when we just want to empty out the entire directory of 1,500+ files


Monday, January 8, 2018 10:26 PM

This is good information, thanks.  That looping is exactly what I have, and I did think about deleting the container but as you said, permissions will get messed up not to mention a shared key that I had for it for other connections.

Thanks,
Matt