Get-AzureStorageBlobContent Exception to download a blob

泪湿孤枕 提交于 2019-12-11 19:47:52

问题


I am using following command to download blob from provided container but it give me following exception.

Code

$subscriptionName = "mysubscrition"
$storageAccount = "myaccount"
$containerName = "mycontainer"

Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccount $storageAccount
Get-AzureStorageContainer -Container $containerName
Get-AzureStorageBlob -Container $containerName | Sort LastModified -Descending |Select-Object -First 1 | Get-AzureStorageBlobContent -Blob name -Destination "C:\BlobDownload" -Force | Out-Null

Excetion

Get-AzureStorageBlobContent : Could not load file or assembly 'Microsoft.WindowsAzure.Storage.DataMovement, Version=2.2.1.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At line:7 char:106
+ Get-AzureStorageBlob -Container $containerName | Sort LastModified -Descending | ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-AzureStorageBlobContent], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobContentCommand

回答1:


This appears to be a transient install issue. Can you try reinstalling as follows:

(1) uninstall (2) Remove webpi cache directrory (~\appdata\local\Microsoft\Web Platform Installer) (3) install a fresh copy from webpi




回答2:


This is actually caused by an issue with the wix installer and the version number of the Storage.DataMovement dll. During an upgrade, the Windows Installer will not replace a file with a lower version of the same file. What happes is that the file is marked for deletion, the replacement with the lower version file is disallowed, and then the file is removed (but not replaced).

You can solve this in two ways:

(1) Repair the install in Control Panel -> Uninstall a program

(2) Replace with a more recent version (0.8.5, for example). The more recent versions should not display this issue



来源:https://stackoverflow.com/questions/21891167/get-azurestorageblobcontent-exception-to-download-a-blob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!