Skip to content

Publish-PSResource to Azure Container Registry throws an error, when anonymousPullEnabled: true #1828

Open
@milosbithawk

Description

@milosbithawk

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

I was looking for a way to allow my users to download (pull) PowerShell modules from our Azure Container Registry (ACR) without requiring authentication. I found the anonymousPullEnabled property in the ACR settings and set it to $true. This allowed users to pull modules from our ACR without authentication.

However, when I try to upload new modules (while already signed in with my admin account using Connect-AzAccount), I receive the error shown in the attachment.

Is there a better approach to allow users to pull modules from our ACR anonymously? Or am I on the wrong path? Assuming that Microsoft Artifacts hosted on ACR support anonymous pulls, it seems like this should also be possible for us — but I haven’t found any guidance online how to set this up.

Expected behavior

A login prompt, or using my current Az Session.

Actual behavior

I get the error: 
Publish-PSResource: One or more errors occurred. (Error occured while starting to upload the blob location used for publishing to ContainerRegistry: System.Net.Http.HttpRequestException 'Error occured while trying to retrieve response header: Error occured while trying to retrieve response: Response status code does not indicate success: 401 (Unauthorized).')

Error details

Environment data

1.1.1                 Microsoft.PowerShell.PSResourceGet

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

Image

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