Skip to content

spin registry login fails with Azure Container Registry (ACR) #2270

@ThorstenHans

Description

@ThorstenHans

When trying to authenticate against an Azure Container Registry (ACR), spin registry login fails with the following error message:

export ACR_PASSWORD=<YOUR_PASSWORD_HERE>
export ACR_NAME=<YOUR_ACR_NAME_HERE>

spin registry login -u $ACR_NAME -p $ACR_PASSWORD $ACR_NAME.azurecr.io
Error: cannot log in to the registry

Caused by:
      cannot authenticate as foobar to registry foobar.azurecr.io: http transport error: error decoding response body: missing field `token` at line 1 column 882

Repro

To create necessary ACR instance, you can use the following Azure CLI commands:

# Create an Azure Resource Group
az group create --name rg-foobar \
    --location germanywestcentral

# Create an ACR
az acr create --name foobar \
    --resource-group rg-foobar \
    --location germanywestcentral \
    --sku Basic \
    --admin-enabled true

Once the ARC instance has been provisioned, you can grab necessary authentication information as shown here:

# Grab credential for ACR
az acr credential show --name foobar \
    --resource-group rg-foobar \
    -oyaml
passwords:
- name: password
  value: SOME_PASSWORD
- name: password2
  value: SOME_OTHER_PASSWORD
username: foobar

Environment

Spin version: spin 2.2.0 (eebfae1 2024-01-30)

MacOS

Darwin zion 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:05 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6031 arm64

Installed Spin plugin versions:

cloud 0.7.0 [installed]
js2wasm 0.6.1 [installed]
py2wasm 0.3.2 [installed]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions