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 / Deleting a file in Azu...
Power Apps
Unanswered

Deleting a file in Azure Blob Storage

(0) ShareShare
ReportReport
Posted on by 765 Super User 2024 Season 1

My application allows users to take photos. These photos are stored in Azure Blob Storage. They also can view and delete the photos they have taken.

The question I have is around Deleting the file. Here is the basic code:

 

//storageAccount = "/saName"
//photoContainer = "/1/421/3/18"
//PhotoId = "3"
With(
 {
 blobId:
 AzureBlobStorage.GetFileMetadataByPathV2( 
 storageAccount,
 $"{photoContainer}{pPath}/{PhotoId}.jpg"
 ).Id
 },
 If(
 IsBlank( blobId ),
 UpdateIf(
 ctxIHSSaveState,
 Id = 1,
 {
 error: 2
 }
 );
 AzureBlobStorage.DeleteFileV2(
 storageAccount,
 blobId,
 {SkipDeleteIfFileNotFoundOnServer:true}
 )
 )
)

The call to GetFileMetadataByPathV2() works and returns the Blob Id. The call to DeleteFileV2() does not throw an error. When I look in the container after the delete the file is still there. Soft Deletes are off. I would expect that the file would be gone after a delete, or at least have some kind of flag indicating it was deleted. Are my expectations wrong? What should be happening?

 

Thank you.

 

 

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @sperry1625 , I had similar delete functionality, but I am using AzureBlobStorage.DeleteFile(BlobId) in my code.

     

    Not sure on V2 version, can you try AzureBlobStorage.DeleteFile(BlobId))?

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • sperry1625 Profile Picture
    765 Super User 2024 Season 1 on at

    Thank you @ANB , I Tried your suggestion, same result. Doesn't fail, but doesn't delete either.

     

    I use Access Keys to access the blob storage, how do you control what access an app has when accessing blob storage utilizing Axxess keys?

     

    Thank you.

     

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @sperry1625 , This is strange because even we have the Access key used for connection creation.

    The only difference is that we use AzureBlobStorage.ListFolderV2 to get the BlobID rather than using GetFileMetadataByPathV2()

     

    Can you try to retrieve the BlobID using AzureBlobStorage.ListFolderV2

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


     

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard