Skip to content

Upgrade to latest Storage dataplane SDK, storage cmdlet will fail with "method not found" #27708

Open
@blueww

Description

@blueww
Member

Description

I recently upgrade Az.Storage to latest storage dataplane SDK release (Azure.Core still depends on 1.44.1),but most storage cmdlets not work in PSH 5 with following error. (PSH 7 works)

My code change can be found in the last commit in wastoresh/azure-powershell at stg98

    <PackageReference Include="Azure.Storage.Blobs" Version="12.25.0-beta.1" />
    <PackageReference Include="Azure.Storage.Files.DataLake" Version="12.23.0-beta.1" />
    <PackageReference Include="Azure.Storage.Files.Shares" Version="12.23.0-beta.1" />
    <PackageReference Include="Azure.Storage.Queues" Version="12.23.0-beta.1" />

The change is not for 5/19 release, but should be required in the recent future release.

Issue script & Debug output

$ctx = New-AzStorageContext -StorageAccountName $storageAccount
Get-AzStorageContainer -Context $ctx -MaxCount 10
Get-AzStorageContainer : Method not found: 'Void Azure.Core.RequestUriBuilder.AppendQuery(System.ReadOnlySpan`1<Char>, System.ReadOnlySpan`1<Char>, Boolean)'.
At line:2 char:1
+ Get-AzStorageContainer -Context $ctx1 -MaxCount 10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzStorageContainer], MissingMethodException
    + FullyQualifiedErrorId : MissingMethodException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageContainerCommand

Environment data

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

Module versions

coming module Az.Storage

Error output

Activity

added
bugThis issue requires a change to an existing behavior in the product in order to be resolved.
needs-triageThis is a new issue that needs to be triaged to the appropriate team.
on May 8, 2025
added
TrackingWe will track status and follow internally
on May 8, 2025
blueww

blueww commented on May 8, 2025

@blueww
MemberAuthor

Discussed with @isra-fel , and open this issue per his suggestion:

Can't say for sure. Possibilities are

isra-fel

isra-fel commented on Jun 11, 2025

@isra-fel
Member

@blueww I can run the cmdlet without error in PS 5. Here's what I did

# In PS 7
.\tools\BuildScripts\BuildModules.ps1 -TargetModule Storage -Configuration Release

# In PS 5
ipmo .\artifacts\Release\Az.Accounts\Az.Accounts.psd1,.\artifacts\Release\Az.Storage\Az.Storage.psd1
new-azstorageaccount -ResourceGroupName yemingtemp -Name yemingsa061101 -SkuName Standard_GRS -Location eastus2
$ctx = New-AzStorageContext -StorageAccountName yemingsa061101
Get-AzStorageContainer -Context $ctx -MaxCount 10

It returned nothing without error

blueww

blueww commented on Jun 12, 2025

@blueww
MemberAuthor

@isra-fel

I still can repro this issue.
Do you think we need a live debug session?

My repro steps:

  1. run : git reset ., git checkout ., git clean -dfx
  2. pull latest code of main branch on https://github.com/Azure/azure-powershell
  3. cherry-pick this commit wastoresh@3092760
  4. In PS 7
.\tools\BuildScripts\BuildModules.ps1 -TargetModule Storage -Configuration Release
  1. in PS 5
ipmo .\artifacts\Release\Az.Accounts\Az.Accounts.psd1,.\artifacts\Release\Az.Storage\Az.Storage.psd1
$ctx = New-AzStorageContext -StorageAccountName $accountName
Get-AzStorageContainer -Context $ctx -MaxCount 10

Get error:

PS D:\code\PSH_Dev> Get-AzStorageContainer -Context $ctx -MaxCount 10
Get-AzStorageContainer : Method not found: 'Void 
Azure.Core.RequestUriBuilder.AppendQuery(System.ReadOnlySpan`1<Char>, System.ReadOnlySpan`1<Char>, Boolean)'.
At line:1 char:1
+ Get-AzStorageContainer -Context $ctx -MaxCount 10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzStorageContainer], MissingMethodException
    + FullyQualifiedErrorId : MissingMethodException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureSto 
   rageContainerCommand

If you still can't repro this issue, Would you please check

  1. if the correct SDK version is loaded in your PSH5 console by run following command after run "Get-AzStorageContainer".
PS D:\code\PSH_Dev> [appdomain]::currentdomain.getassemblies() | Where-Object {$_.location -like "*Azure.Storage.Blobs*"} | Format-Table fullName,Location

FullName                                                                                 Location                                                            
--------                                                                                 --------                                                            
Azure.Storage.Blobs, Version=12.25.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8 D:\code\PSH_Dev\artifacts\Release\Az.Storage\Azure.Storage.Blobs.dll
  1. The PSH version, following is mine:
PS D:\code\PSH_Dev> $PSVersionTable

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

blueww commented on Jun 12, 2025

@blueww
MemberAuthor

BTW, Storage dataplane SDK has a new release recently, and it depends on "Azure.Core (>= 1.46.2)"
https://www.nuget.org/packages/Azure.Storage.Blobs/12.26.0-beta.1#dependencies-body-tab

Could we just make PSH framework be ready to upgrade to the new SDK version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TrackingWe will track status and follow internallybugThis issue requires a change to an existing behavior in the product in order to be resolved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @blueww@isra-fel

        Issue actions

          Upgrade to latest Storage dataplane SDK, storage cmdlet will fail with "method not found" · Issue #27708 · Azure/azure-powershell