web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / AzureBlobStorage.Delet...
Power Apps
Unanswered

AzureBlobStorage.DeleteFile() can delete a whole container!

(0) ShareShare
ReportReport
Posted on by 49

We've been utilizing Azure Blob Storage to store pictures taken via our PowerApps. This works great and we had no problems until today.

 

We have an app containing checklists which is used by mechanics. One of the input types is 'Take/Upload a picture' which is currently used to take pre-delivery pictures before our vehicles are shipped to our customers. In our last update we've added the possibility to view and delete pictures before submitting the checklist to the database, and this is where things went downhill.

 

Upon taking a picture we store the filename (a GUID) in a local collection.

When the mechanic wants to delete this picture we call AzureBlobStorage.GetFileMetadataByPath() to retrieve the ID of that blob.

Using the ID we call AzureBlobStorage.DeleteFile() to delete that blob. 

 

An error in the code caused the path to only contain the URL to the container instead of the full URL to a specific blob. The action GetFileMetadataByPath() responded with the ID of the container instead of the blob and we would use this to call the DeleteFile action resulting in the whole container being deleted. We hadn't activated the 'Soft delete' functionality yet for this storage account and we're currently waiting if MS can recover it from their side. Fingers crossed..

 

I had never imagined that the function DeleteFile could delete whole containers and I'm wondering if this is expected behavior or a bug. I think the question to ask is; is a container a blob (or a file as the name of the action suggests)?
The documentation says; "This operation deletes a blob.and today I discovered that it can also delete a whole container.

 

Soft recovery would have saved us a lot of hassle and I would advise everyone to enable that. It's also a good idea to check the 'IsFolder' property in the metadata of the file to make sure you're deleting a file/blob and not a whole container.

 

I wasn't sure where or how to post this, but I'm hoping that having this info out there might save somebody the stress this caused me today.. 😅

 

Peter

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard