Skip to content

Az module results in 500 error with Save-PsResource #1933

Description

@JBuildman

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

  1. Execute 'Save-PsResource Az'

Expected behavior

Az Module is saved

Actual behavior

Cmdlet fails with 500 error

Error details

PS E:\pwsh-modules> get-error

Type        : System.Management.Automation.ActionPreferenceStopException
ErrorRecord : 
    Exception             : 
        Type       : System.Net.Http.HttpRequestException
        TargetSite : 
            Name          : MoveNext
            DeclaringType : [Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls+<SendV2RequestAsync>d__37]
            MemberType    : Method
            Module        : Microsoft.PowerShell.PSResourceGet.dll
        Message    : 'Response status code does not indicate success: 500 (Internal Server Error).' Request sent: 'https://www.powershellgallery.com/api/v2/FindPackagesById()?%24filter=NormalizedVersion+ge+%275.0.1%27 
+and+NormalizedVersion+le+%275.0.19%27+and+Id+eq+%27Az.ContainerRegistry%27&%24inlinecount=allpages&%24skip=0&%24orderby=NormalizedVersion+desc&id=%27Az.ContainerRegistry%27'
        Source     : Microsoft.PowerShell.PSResourceGet
        HResult    : -2146233088
        StackTrace : 
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.SendV2RequestAsync(HttpRequestMessage message, HttpClient s_client) in C:\__w\1\s\PSResourceGet\src\code\V2ServerAPICalls.cs:line 1535
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.HttpRequestCall(String requestUrlV2, ErrorRecord& errRecord) in C:\__w\1\s\PSResourceGet\src\code\V2ServerAPICalls.cs:line 800
    TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls
    CategoryInfo          : ConnectionError: (Microsoft.PowerShel…ts.V2ServerAPICalls:V2ServerAPICalls) [Save-PSResource], HttpRequestException
    FullyQualifiedErrorId : HttpRequestCallFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource
    InvocationInfo        : 
        MyCommand        : Save-PSResource
        ScriptLineNumber : 1
        OffsetInLine     : 1
        HistoryId        : 4
        Line             : Save-PsResource Az
        Statement        : Save-PsResource Az
        PositionMessage  : At line:1 char:1
                           + Save-PsResource Az
                           + ~~~~~~~~~~~~~~~~~~
        InvocationName   : Save-PsResource
        CommandOrigin    : Internal
    ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
    PipelineIterationInfo : 
              0
              1
TargetSite  : 
    Name          : Invoke
    DeclaringType : [System.Management.Automation.Runspaces.PipelineBase]
    MemberType    : Method
    Module        : System.Management.Automation.dll
Message     : The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: 'Response status code does not indicate success: 500 (Internal Server Error).'      
Request sent: 'https://www.powershellgallery.com/api/v2/FindPackagesById()?%24filter=NormalizedVersion+ge+%275.0.1%27+and+NormalizedVersion+le+%275.0.19%27+and+Id+eq+%27Az.ContainerRegistry%27&%24inlinecount=allpages& 
%24skip=0&%24orderby=NormalizedVersion+desc&id=%27Az.ContainerRegistry%27'
Data        : System.Collections.ListDictionaryInternal
Source      : System.Management.Automation
HResult     : -2146233087
StackTrace  : 
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in
C:\__w\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 76
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeCommand[TResult](PowerShell pwsh, PSCommand psCommand, PSInvocationSettings invocationSettings) in
C:\__w\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 99
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.ExecuteNormally(CancellationToken cancellationToken) in
C:\__w\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 136

Environment data

PS E:\pwsh-modules> Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.1                 Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository…}

Key   : PSVersion
Value : 7.5.4
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.5.4
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.26200
Name  : OS


Key   : Platform
Value : Win32NT
Name  : Platform


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name  : PSCompatibleVersions


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion

Visuals

No response

Activity

  1. JBuildman commented on Jan 29, 2026

    @JBuildman
    Author

    In the Az github they redirected me here.
    Azure/azure-powershell#29112

  2. nerddtvg commented on Feb 3, 2026

    @nerddtvg

    Running into the same issue:

    ~  Invoke-WebRequest 'https://www.powershellgallery.com/api/v2/FindPackagesById()?%24filter=NormalizedVersion+ge+%275.0.1%27+and+NormalizedVersion+le+%275.0.19%27+and+Id+eq+%27Az.ContainerRegistry%27&%24inlinecount=allpages&%24skip=0&%24orderby=NormalizedVersion+desc&id=%27Az.ContainerRegistry%27'
    Invoke-WebRequest:
    <m:error
      xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
      <m:code />
      <m:message
        xml:lang="en-US">An error has occurred.</m:message>
    </m:error>
    

    If we add a second %27 to the URL, it works:

     ~  Invoke-WebRequest 'https://www.powershellgallery.com/api/v2/FindPackagesById()?$filter=NormalizedVersion+ge+%275.0.1%27+and+NormalizedVersion+le+%275.0.19%27+and+Id+eq+%27Az.ContainerRegistry%27&$inlinecount=allpages&$skip=0&$orderby=NormalizedVersion+desc&id=%27Az.ContainerRegistry%27%27'
    
    StatusCode        : 200
    StatusDescription : OK
    Content           : <?xml version="1.0" encoding="utf-8"?><feed xml:base="https://www.powershellgallery.com/api/v2" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmln…
    ....
    

    This works by removing the single quotes about the id parameter at the end:

    https://www.powershellgallery.com/api/v2/FindPackagesById()?%24filter=NormalizedVersion+ge+%275.0.1%27+and+NormalizedVersion+le+%275.0.19%27+and+Id+eq+%27Az.ContainerRegistry%27&%24inlinecount=allpages&%24skip=0&%24orderby=NormalizedVersion+desc&id=Az.ContainerRegistry

    And if the orderby clause is removed, it works:

    https://www.powershellgallery.com/api/v2/FindPackagesById()?%24filter=NormalizedVersion+ge+%275.0.1%27+and+NormalizedVersion+le+%275.0.19%27+and+Id+eq+%27Az.ContainerRegistry%27&%24inlinecount=allpages&%24skip=0&id=%27Az.ContainerRegistry%27

  3. nerddtvg commented on Feb 3, 2026

    @nerddtvg

    Here is a temporary workaround made by taking the current Az module (15.2.0) requirements and forming them into a hashtable.

    This will not install Az though. That will still fail.

    $reqs = @{
    'Az.Accounts' = @{Version='[5.3.2,)'};
    'Az.Advisor' = @{Version='[3.0.0]'};
    'Az.Aks' = @{Version='[7.1.0]'};
    'Az.AnalysisServices' = @{Version='[1.2.0]'};
    'Az.ApiManagement' = @{Version='[4.1.0]'};
    'Az.App' = @{Version='[2.0.1]'};
    'Az.AppConfiguration' = @{Version='[2.0.1]'};
    'Az.ApplicationInsights' = @{Version='[3.0.0]'};
    'Az.ArcResourceBridge' = @{Version='[2.0.0]'};
    'Az.ArizeAI' = @{Version='[1.0.0]'};
    'Az.Attestation' = @{Version='[3.0.0]'};
    'Az.Automanage' = @{Version='[2.0.0]'};
    'Az.Automation' = @{Version='[1.11.2]'};
    'Az.Batch' = @{Version='[4.0.1]'};
    'Az.Billing' = @{Version='[2.2.0]'};
    'Az.Cdn' = @{Version='[6.0.0]'};
    'Az.CloudService' = @{Version='[2.1.1]'};
    'Az.CognitiveServices' = @{Version='[1.16.0]'};
    'Az.Compute' = @{Version='[11.2.0]'};
    'Az.ConfidentialLedger' = @{Version='[2.0.0]'};
    'Az.ConnectedMachine' = @{Version='[1.1.1]'};
    'Az.ContainerInstance' = @{Version='[4.1.2]'};
    'Az.ContainerRegistry' = @{Version='[5.0.1]'};
    'Az.CosmosDB' = @{Version='[1.19.1]'};
    'Az.DataBoxEdge' = @{Version='[1.2.1]'};
    'Az.Databricks' = @{Version='[1.10.1]'};
    'Az.DataFactory' = @{Version='[1.19.7]'};
    'Az.DataLakeAnalytics' = @{Version='[1.1.0]'};
    'Az.DataLakeStore' = @{Version='[1.5.2]'};
    'Az.DataMigration' = @{Version='[1.0.0]'};
    'Az.DataProtection' = @{Version='[2.8.0]'};
    'Az.DataShare' = @{Version='[1.1.1]'};
    'Az.DataTransfer' = @{Version='[1.0.0]'};
    'Az.DesktopVirtualization' = @{Version='[5.4.1]'};
    'Az.DevCenter' = @{Version='[3.0.0]'};
    'Az.DeviceRegistry' = @{Version='[1.0.0]'};
    'Az.DevTestLabs' = @{Version='[1.1.0]'};
    'Az.Dns' = @{Version='[2.0.0]'};
    'Az.DnsResolver' = @{Version='[1.2.1]'};
    'Az.ElasticSan' = @{Version='[1.6.0]'};
    'Az.EventGrid' = @{Version='[2.2.0]'};
    'Az.EventHub' = @{Version='[5.4.0]'};
    'Az.Fabric' = @{Version='[1.0.0]'};
    'Az.FirmwareAnalysis' = @{Version='[1.0.0]'};
    'Az.FrontDoor' = @{Version='[2.1.0]'};
    'Az.Functions' = @{Version='[4.3.0]'};
    'Az.HDInsight' = @{Version='[6.4.0]'};
    'Az.HealthcareApis' = @{Version='[3.0.0]'};
    'Az.HealthDataAIServices' = @{Version='[1.0.0]'};
    'Az.IotHub' = @{Version='[2.8.1]'};
    'Az.KeyVault' = @{Version='[6.4.2]'};
    'Az.Kusto' = @{Version='[2.4.0]'};
    'Az.LambdaTest' = @{Version='[1.0.0]'};
    'Az.LoadTesting' = @{Version='[1.1.1]'};
    'Az.LogicApp' = @{Version='[1.6.0]'};
    'Az.MachineLearning' = @{Version='[1.2.0]'};
    'Az.MachineLearningServices' = @{Version='[1.3.0]'};
    'Az.Maintenance' = @{Version='[1.5.1]'};
    'Az.ManagedServiceIdentity' = @{Version='[2.0.0]'};
    'Az.ManagedServices' = @{Version='[3.1.2]'};
    'Az.MarketplaceOrdering' = @{Version='[2.2.0]'};
    'Az.Migrate' = @{Version='[2.11.0]'};
    'Az.Monitor' = @{Version='[7.0.0]'};
    'Az.MySql' = @{Version='[1.5.1]'};
    'Az.NetAppFiles' = @{Version='[1.0.0]'};
    'Az.Network' = @{Version='[7.24.1]'};
    'Az.NetworkCloud' = @{Version='[2.0.0]'};
    'Az.Nginx' = @{Version='[2.0.0]'};
    'Az.NotificationHubs' = @{Version='[1.2.0]'};
    'Az.OperationalInsights' = @{Version='[3.3.0]'};
    'Az.Oracle' = @{Version='[2.0.0]'};
    'Az.PolicyInsights' = @{Version='[1.7.3]'};
    'Az.PostgreSql' = @{Version='[1.4.0]'};
    'Az.PowerBIEmbedded' = @{Version='[2.1.0]'};
    'Az.PrivateDns' = @{Version='[1.2.0]'};
    'Az.RecoveryServices' = @{Version='[7.11.0]'};
    'Az.RedisCache' = @{Version='[1.11.0]'};
    'Az.RedisEnterpriseCache' = @{Version='[1.6.0]'};
    'Az.Relay' = @{Version='[3.0.0]'};
    'Az.ResourceGraph' = @{Version='[1.2.1]'};
    'Az.ResourceMover' = @{Version='[1.3.1]'};
    'Az.Resources' = @{Version='[9.0.0]'};
    'Az.Security' = @{Version='[1.8.0]'};
    'Az.SecurityInsights' = @{Version='[3.2.1]'};
    'Az.ServiceBus' = @{Version='[4.1.1]'};
    'Az.ServiceFabric' = @{Version='[5.0.0]'};
    'Az.SignalR' = @{Version='[2.3.2]'};
    'Az.Sql' = @{Version='[6.4.0]'};
    'Az.SqlVirtualMachine' = @{Version='[2.4.0]'};
    'Az.StackHCI' = @{Version='[2.6.5]'};
    'Az.StackHCIVM' = @{Version='[1.1.0]'};
    'Az.Storage' = @{Version='[9.5.0]'};
    'Az.StorageAction' = @{Version='[1.0.0]'};
    'Az.StorageDiscovery' = @{Version='[1.0.0]'};
    'Az.StorageMover' = @{Version='[2.0.0]'};
    'Az.StorageSync' = @{Version='[2.5.2]'};
    'Az.StreamAnalytics' = @{Version='[3.0.0]'};
    'Az.Support' = @{Version='[2.1.0]'};
    'Az.Synapse' = @{Version='[3.2.4]'};
    'Az.TrafficManager' = @{Version='[1.3.0]'};
    'Az.Websites' = @{Version='[3.4.2]'};
    'Az.Workloads' = @{Version='[2.0.0]'}
    }
    
    Install-PSResource -RequiredResource  $reqs
  4. anamnavi commented on Feb 6, 2026

    @anamnavi
    Member

    Hi all, the fix for this issue has been released in Microsoft.PowerShell.PSResourceGet 1.2.0-rc2, please update your PSResourceGet version to pull in the fix.
    https://www.powershellgallery.com/packages/Microsoft.PowerShell.PSResourceGet/1.2.0-rc2

    Installing Az from PowerShellGallery should work smoothly now.
    Image

    Thank you for the patience everyone and reporting!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions