Azure / Azure/azure-sdk-for-python

Get ACR token from ContainerRegistryClient

Open
#37,570 6 comments 0 reactions 1 assignee Claimed by @kashifkhan View on GitHub
Client Container Registry customer-reported feature-request needs-team-attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

**Is your feature request related to a problem? Please describe.**
When you want to get an ACR refresh token like you would with

```bash
az acr login --name --expose-token --output tsv --query accessToken
```

using the Python SDK, there is no easy way to do it. Logic is buried in the `ACRExchangeClient` class which is not supposed to be used directly.

**Describe the solution you'd like**
A method directly available on the `ContainerRegistryClient` class to get the ACR token that can then be used for `docker login` command.

**Describe alternatives you've considered**
I considered hack around the `ACRExchangeClient` and `ContainerRegistryChallengePolicy` classes but that just doesn't feel right.

**Additional context**
Similar feature request has been made on the [JS SDK](https://github.com/Azure/azure-sdk-for-js/issues/27635)

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.