apple / apple/container

[Bug]: `container image pull` does not work for Azure Container Registry even if logged in (401 Unauthorized)

Open
#254 45 comments 0 reactions 1 assignee Claimed by @adityaramani View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### I have done the following

- [x] I have searched the existing issues
- [x] If possible, I've reproduced the issue using the 'main' branch of this project

### Steps to reproduce

1. Login to the Azure Regisry (I followed [this documentation](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli#az-acr-login-with---expose-token)) :

```sh
TOKEN=$(az acr login --name myregistry --expose-token --output tsv --query accessToken)
container registry login myregistry.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password-stdin <<< $TOKEN
```

2. I got the message:
```
Login succeeded
```

3. Try to pull an image:
```
container image pull myregistry.azurecr.io/api/dummy:latest
```

### Current behavior

I got the follow error:

```
Error: internalError: "HTTP request to https://myregistry.azurecr.io/oauth2/token?client_id=containerization-registry-client&service=myregistry.azurecr.io&scope=repository:api/dummy:pull failed with response: 401 Unauthorized. No credentials found for host myregistry.azurecr.io"
```

### Expected Behavior

The image should be pulled.

### Environment

```markdown
- OS: 15.5 (24F74)
- Xcode: N/A
- Container: container CLI version 0.2.0 (build: release, commit: 3b5c253)
```

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.