Skip to content

Get-AzStorageBlob blocks console in interactive mode if an error ocurrs #24748

Open
@david-garcia-garcia

Description

@david-garcia-garcia

Description

I am investigating an unhandled exception in Get-AzStorageBlob. When the error happens, the console gets blocked and you can only regain console control using ctrl+c.

image

Issue script & Debug output

$ctx = New-AzStorageContext -StorageAccountName $backupUrl.storageAccountName -SasToken $backupUrl.sasToken;

$blobs = Get-AzStorageBlob -Container $backupUrl.container -Context $ctx -Prefix $backupUrl.prefix;

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.20348.2227
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2227
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

PS C:\> Get-Module Az*

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.17.0     Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear...
Script     6.1.3      Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountMa...

Error output

PS C:\> Resolve-AzError


   HistoryId: 4


Message        : Method not found: 'Azure.Pageable`1<Azure.Storage.Blobs.Models.BlobItem>
                 Azure.Storage.Blobs.BlobContainerClient.GetBlobs(Azure.Storage.Blobs.Models.BlobTraits,
                 Azure.Storage.Blobs.Models.BlobStates, System.String, System.Threading.CancellationToken)'.
StackTrace     :    at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobCommand.<ListBlobsByPrefi
                 x>d__52.MoveNext()
                    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&
                 stateMachine)
                    at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobCommand.ListBlobsByPrefix
                 (Int64 taskId, IStorageBlobManagement localChannel, String containerName, String prefix, Func`2
                 blobFilter, Boolean includeDeleted, Boolean includeVersion)
                    at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobCommand.<>c__DisplayClass
                 55_1.<ExecuteCmdlet>b__0(Int64 taskId)
                    at Microsoft.WindowsAzure.Commands.Storage.Common.LimitedConcurrencyTaskScheduler.RunTask(Func`2
                 taskGenerator)
                    at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobCommand.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : System.MissingMethodException
InvocationInfo : {Get-AzStorageBlob}
Line           :         $blobs = Get-AzStorageBlob -Container $backupUrl.container -Context $ctx -Prefix
                 $backupUrl.prefix;

Position       : At C:\Program Files\WindowsPowerShell\Modules\Sbs\Functions\SbsMssqlPrepareRestoreFiles.ps1:22 char:18
                 + ...    $blobs = Get-AzStorageBlob -Container $backupUrl.container -Contex ...
                 +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 4

Metadata

Metadata

Labels

Investigate 🔍assembly-conflictrelated to conflicts when loading assembliesbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reported

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions