You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Install-Module and Find-Module commands work properly though when registered with the same repository URI, so I know that the Azure Artifacts Credential Provider is setup properly.
The Azure Artifacts Credential Provider has been installed with the following command as per the docs:
And a VSS_NUGET_EXTERNAL_FEED_ENDPOINTS system environment variable added using a valid Azure DevOps Personal Access Token, as per the docs.
Tangentially related
What's worse is it seems that the latest prerelease version 3.0.23 of PowerShellGet has broken the Install-Module and Find-Module commands completely, and previous prerelease versions have been delisted; see PowerShell/PowerShellGet#58. Luckily I still have PowerShellGet v3.0.12 installed so the commands still work on my local machine, but new servers that I'm setting up are not able to connect to our Azure Artifacts feed without the -Credential parameter.
I created the AzureArtifactsPowerShellModuleHelper module a while back to help solve this issue, but found that sometimes even with that module PowerShellGet 2.2.5 still couldn't access the feed and we'd need to use the prerelease v3 version. With v3.0.23 broken though, and older v3 versions delisted and thus can't be installed, there's not much we can do when v2.2.5 has issues. I was hoping that PSResourceGet would eliminate the need for using the AzureArtifactsPowerShellModuleHelper module and PowerShellGet.
Expected behavior
The Install-PSResource and Find-PSResource cmdlets should automatically use the Azure Artifacts Credential Provider to provide credentials to connect to the private Azure DevOps Artifacts feed.
Find-PSResource $MyPrivateModule -Repository $MyPrivateAzureArtifactsFeedFind-PSResource: 'Response status code does not indicate success: 401 (Unauthorized).' Re-run the command with -Credential.
Error details
PS> Get-ErrorException : Type : Microsoft.PowerShell.PSResourceGet.UtilClasses.UnauthorizedException TargetSite : Name : MoveNext DeclaringType : Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls+<SendV2RequestAsync>d__38, Microsoft.PowerShell.PSResourceGet, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null MemberType : Method Module : Microsoft.PowerShell.PSResourceGet.dll Message : 'Response status code does not indicate success: 401 (Unauthorized).' Re-run the command with -Credential. Source : Microsoft.PowerShell.PSResourceGet HResult : -2146233088 StackTrace : at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.SendV2RequestAsync(HttpRequestMessage message, HttpClient s_client) at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.HttpRequestCall(String requestUrlV2, ErrorRecord& errRecord)TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICallsCategoryInfo : InvalidResult: (Microsoft.PowerShel…ts.V2ServerAPICalls:V2ServerAPICalls) [Find-PSResource], UnauthorizedExceptionFullyQualifiedErrorId : UnauthorizedRequest,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResourceInvocationInfo : MyCommand : Find-PSResource ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 7 Line : Find-PSResource <REDACTED>.ServerConfiguration -Repository AzureArtifacts-<REDACTED> Statement : Find-PSResource <REDACTED>.ServerConfiguration -Repository AzureArtifacts-<REDACTED> PositionMessage : At line:1 char:1 + Find-PSResource <REDACTED>.ServerConfiguration -Repository AzureAr … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ InvocationName : Find-PSResource CommandOrigin : InternalScriptStackTrace : at <ScriptBlock>, <No file>: line 1PipelineIterationInfo :
Environment data
PS>Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable
ModuleType Version PreRelease Name ExportedCommands
-----------------------------------------------
Binary 1.0.3 Microsoft.PowerShell.PSResourceGet {Find-PSResource,Get-InstalledPSResource,Get-PSResourceRepository,Get-PSScriptFileInfo…}
Key : PSVersion
Value : 7.4.1
Name : PSVersion
Key : PSEdition
Value : Core
Name : PSEdition
Key : GitCommitId
Value : 7.4.1
Name : GitCommitId
Key : OS
Value : Microsoft Windows 10.0.19045
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
Here's a screenshot showing the issue, and that it works properly with PowerShellGet, but not PSResourceGet. If you need any other information for troubleshooting let me know; I'm happy to provide anything that can help get this issue resolved.
The text was updated successfully, but these errors were encountered:
@alerickson@SydneyhSmith any chance to see you pull request get in master? This would simplify our process so much if we no longer have to provide credentials every time we want to update our modules
Prerequisites
Steps to reproduce
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
environment variable using a valid Azure DevOps PAT.Register-PSResourceRepository -Name <RepoName> -Uri <FeedUrl> -Trusted
Install-PSResource
orFind-PSResource
to find a module in the private feed. It returns back a401 (Not Authorized)
error.Details
It seems that
Install-PSResource
andFind-PSResource
still do not work properly with Azure Artifacts and the Azure Artifacts Credential Provider in Microsoft.PowerShell.PSResourceGet v1.0.3; they result in a401 (Not Authorized)
error.The
Install-Module
andFind-Module
commands work properly though when registered with the same repository URI, so I know that the Azure Artifacts Credential Provider is setup properly.The Azure Artifacts Credential Provider has been installed with the following command as per the docs:
And a
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
system environment variable added using a valid Azure DevOps Personal Access Token, as per the docs.Tangentially related
What's worse is it seems that the latest prerelease version 3.0.23 of PowerShellGet has broken the
Install-Module
andFind-Module
commands completely, and previous prerelease versions have been delisted; see PowerShell/PowerShellGet#58. Luckily I still have PowerShellGet v3.0.12 installed so the commands still work on my local machine, but new servers that I'm setting up are not able to connect to our Azure Artifacts feed without the-Credential
parameter.I created the AzureArtifactsPowerShellModuleHelper module a while back to help solve this issue, but found that sometimes even with that module PowerShellGet 2.2.5 still couldn't access the feed and we'd need to use the prerelease v3 version. With v3.0.23 broken though, and older v3 versions delisted and thus can't be installed, there's not much we can do when v2.2.5 has issues. I was hoping that PSResourceGet would eliminate the need for using the AzureArtifactsPowerShellModuleHelper module and PowerShellGet.
Expected behavior
The
Install-PSResource
andFind-PSResource
cmdlets should automatically use the Azure Artifacts Credential Provider to provide credentials to connect to the private Azure DevOps Artifacts feed.Find-PSResource $MyPrivateModule -Repository $MyPrivateAzureArtifactsFeed
Should be able to find the module.
Actual behavior
Error details
Environment data
Visuals
Here's a screenshot showing the issue, and that it works properly with PowerShellGet, but not PSResourceGet. If you need any other information for troubleshooting let me know; I'm happy to provide anything that can help get this issue resolved.
The text was updated successfully, but these errors were encountered: