Azure / Azure/azure-powershell
Get-AzStorageBlobByTag - Method not found: 'System.Collections.Generic.IAsyncEnumerable'
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
While executing this cmdlet:
```pwsh
Get-AzStorageBlobByTag -Context $storageCTX -TagFilterSqlExpression """IsLatest""='true'"
```
The following is returned:
```pwsh
Get-AzStorageBlobByTag: Method not found: 'System.Collections.Generic.IAsyncEnumerable`1> Azure.AsyncPageable`1.AsPages(System.String, System.Nullable`1)'
```
In reading the docs, it seems like the TagFilterExpression synax being used is correct:
```pwsh
get-help Get-AzStorageBlobByTag -Examples
Example 3: List all blobs match a specific blob tag, across containers, and get the blob properties.
PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -GetBlobProperty
```
### Issue script & Debug output
```PowerShell
Get-AzStorageBlobByTag -Context $storageCTX -TagFilterSqlExpression """IsLatest""='true'" -Debug
DEBUG: 5:27:48 PM - Init Operation Context for 'GetAzureStorageBlobByTagCommand' with client request id Azure-Storage-PowerShell-9b05ab1e-b1d0-4878-8e64-ecf41814f1da. If you want to get more details, please add "-Debug" to your command.
DEBUG: 5:27:48 PM - GetAzureStorageBlobByTagCommand begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 5:27:48 PM - Use storage account 'devopsagenthubsa' from storage context.
Get-AzStorageBlobByTag: Method not found: 'System.Collections.Generic.IAsyncEnumerable`1> Azure.AsyncPageable`1.AsPages(System.String, System.Nullable`1)'.
Get-AzStorageBlobByTag task status : [Total: 1. Successful: 0. Failed: 0. Active: 0. ]
```
### Environment data
```PowerShell
$PSVersionTable
Name Value
---- -----
PSVersion 7.2.2
PSEdition Core
GitCommitId 7.2.2
OS Darwin 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
### Module versions
```PowerShell
Get-Module -ListAvailable | where name -like 'Az*' | select version, name
Version Name
------- ----
7.3.2 Az
2.7.4 Az.Accounts
1.1.2 Az.Advisor
3.1.2 Az.Aks
1.1.4 Az.AnalysisServices
2.3.1 Az.ApiManagement
1.0.0 Az.AppConfiguration
1.3.0 Az.ApplicationInsights
1.0.0 Az.Attestation
1.7.3 Az.Automation
3.1.1 Az.Batch
2.0.0 Az.Billing
1.8.1 Az.Cdn
1.1.0 Az.CloudService
1.10.0 Az.CognitiveServices
4.24.1 Az.Compute
3.0.1 Az.ContainerInstance
2.2.3 Az.ContainerRegistry
1.5.1 Az.CosmosDB
1.1.0 Az.DataBoxEdge
1.2.0 Az.Databricks
1.16.4 Az.DataFactory
1.0.2 Az.DataLakeAnalytics
1.3.0 Az.DataLakeStore
1.0.1 Az.DataShare
1.1.0 Az.DeploymentManager
3.1.0 Az.DesktopVirtualization
1.0.2 Az.DevTestLabs
1.1.2 Az.Dns
1.3.0 Az.EventGrid
1.11.0 Az.EventHub
1.9.0 Az.FrontDoor
4.0.1 Az.Functions
5.0.0 Az.HDInsight
1.3.2 Az.HealthcareApis
2.7.4 Az.IotHub
4.3.0 Az.KeyVault
2.0.0 Az.Kusto
1.5.0 Az.LogicApp
1.1.3 Az.MachineLearning
1.2.0 Az.Maintenance
3.0.0 Az.ManagedServices
1.0.2 Az.MarketplaceOrdering
1.1.1 Az.Media
1.1.2 Az.Migrate
3.0.1 Az.Monitor
1.0.0 Az.MySql
4.15.0 Az.Network
1.1.1 Az.NotificationHubs
3.0.1 Az.OperationalInsights
1.5.0 Az.PolicyInsights
1.0.0 Az.PostgreSql
1.1.2 Az.PowerBIEmbedded
1.0.3 Az.PrivateDns
5.2.0 Az.RecoveryServices
1.6.0 Az.RedisCache
1.0.0 Az.RedisEnterpriseCache
1.0.3 Az.Relay
1.1.0 Az.ResourceMover
5.4.0 Az.Resources
1.1.1 Az.Security
1.1.0 Az.SecurityInsights
1.8.0 Az.ServiceBus
3.0.1 Az.ServiceFabric
1.4.1 Az.SignalR
3.7.1 Az.Sql
1.1.0 Az.SqlVirtualMachine
1.1.0 Az.StackHCI
4.3.0 Az.Storage
1.7.0 Az.StorageSync
2.0.0 Az.StreamAnalytics
1.0.0 Az.Support
1.1.0 Az.Synapse
1.1.0 Az.TrafficManager
2.10.0 Az.Websites
```
### Error output
```PowerShell
Resolve-AzError
DEBUG: 5:29:19 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 5:29:19 PM - using account id ''...
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release. Please change any scripts that use this alias to use `Resolve-AzError` instead.
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.
HistoryId: 145
Message : Method not found: 'System.Collections.Generic.IAsyncEnumerable`1> Azure.AsyncPageable`1.AsPages(System.String, System.Nullable`1)'.
StackTrace : at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobByTagCommand.ListBlobsByTag(Int64 taskId, IStorageBlobManagement localChannel,
String tagFilterSqlExpression)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobByTagCommand.ListBlobsByTag(Int64 taskId, IStorageBlobManagement localChannel,
String tagFilterSqlExpression)
at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobByTagCommand.<>c__DisplayClass24_0.b__0(Int64 taskId)
at Microsoft.WindowsAzure.Commands.Storage.Common.LimitedConcurrencyTaskScheduler.RunTask(Func`2 taskGenerator)
at Microsoft.WindowsAzure.Commands.Storage.Common.StorageCloudCmdletBase`1.RunTask(Func`2 taskGenerator)
at Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobByTagCommand.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : System.MissingMethodException
InvocationInfo : {Get-AzStorageBlobByTag}
Line : Get-AzStorageBlobByTag -Context $storageCTX -TagFilterSqlExpression """IsLatest""='true'" -Debug
Position : At line:1 char:1
+ Get-AzStorageBlobByTag -Context $storageCTX -TagFilterSqlExpression " …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 145
```
Contributor guide
Assessment
This issue has not been assessed yet.