0

We somehow managed to create a file in an Azure File Share whose name ends in a . (dot) (the file name ends in . not the share name :) ). We now cannot retrieve, remove, edit that file. Whenever we try to perform any action we get:

Extension Microsoft_Azure_FileStorage

Content FilePropertiesBladev2

Error code 404

Is there anyway we can remove this file using Powershell, Azure CLI, etc.?

Thanks

1 Answers1

0

I tried in my environment and got below results:

Status Code: 404 - error

The above error indicates mostly File share or file present in the file share not found in the file storage.

According to this MS-DOCS check whether the file is locked for editing by another user also check if the file is open in another program.

Is there anyway we can remove this file using Powershell, Azure CLI, etc.?

I tried in powershell and removed the .files successfully.

Initially I have some files in fileshare.

Portal: enter image description here

Commands:

$sharename = "fileshare1"
$foldername = "directory1"
$accountname = "storage326123"
$accountkey = "<storage account key>"
az storage file delete --account-name $accountname --account-key $accountkey --share-name $sharename --path directory1/1..json

Response:

enter image description here

Portal:

enter image description here

Venkatesan
  • 3,748
  • 1
  • 3
  • 15
  • Thank you Venkatesan, for taking the time to answer in detail. However, your answer doesn't cover the scenario we are facing. The file name ends in **.** (dot) (no extension). In your example, instead of the file you delete to be called **1.json** try with just **1.** – Adrian Anghel Oct 22 '22 at 13:02
  • I tried without extension it worked. I have added without extension like name IExtension it is deleted. – Venkatesan Oct 22 '22 at 13:50