I am trying to delete Azure Storage directory using Powershell:-
# the Context is already set correctly, not showing it here though
if( $myshare -eq $null )
{
$myshare=New-AzureStorageShare -Name "share" -Context $context
}
Remove-AzureStorageDirectory -ShareName "share" -Path "mycontainer/mydir/dir1" -Context $context -Confirm:$false
I am getting the following error:-
Remove-AzureStorageDirectory : The remote server returned an error: (404) Not Found. HTTP
Status Code: 404 - HTTP Error Message: The specified parent path does not exist.
At C:\test.ps1:21 char:1
+ Remove-AzureStorageDirectory -ShareName "share" -Path "mycontainer/my ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Remove-AzureStorageDirectory], StorageException
+ FullyQualifiedErrorId : StorageException,Microsoft.WindowsAzure.Commands.Storage.File.Cmd
let.RemoveAzureStorageDirectory
This is how the folder that I am trying to delete (dir1) exists in my storage:-
mycontainer/mydir/dir1
So the path very much exists. I am not sure what it's expecting otherwise.