Azure / Azure/acr

az acr task credential add supports enabling permissions to keyvault

Open
#489 0 comments 0 reactions 1 assignee Assigned to @toddysm View on GitHub
feature-acr-tasks feature-request triaged
Dominant language
No language data
Stars
177
Forks
137
PR merge metrics
No merged PRs in 30d

Description

**What is the problem you're trying to solve**
When using `acr task credentials` that would typically store values in keyvault for general security reasons, it's yet another tedious step to establish rights.

For example, the following two steps are required:
```
az acr task credential add \
-n hello-world \
-r $REGISTRY \
--login-server $REGISTRY_DOCKERHUB_URL \
-u https://${AKV}.vault.azure.net/secrets/registry-dockerhub-user \
-p https://${AKV}.vault.azure.net/secrets/registry-dockerhub-password \
--use-identity [system]

az keyvault set-policy \
--name $AKV \
--resource-group $AKV_RG \
--object-id $(az acr task show \
--name node-public \
--registry $REGISTRY \
--query identity.principalId --output tsv) \
--secret-permissions get
```
**Describe the solution you'd like**
Consolidate these two steps into:
```
az acr task credential add \
-n hello-world \
-r $REGISTRY \
--login-server $REGISTRY_DOCKERHUB_URL \
-u https://${AKV}.vault.azure.net/secrets/registry-dockerhub-user \
-p https://${AKV}.vault.azure.net/secrets/registry-dockerhub-password \
--keyvault $AKV \
--keyvault-secret-permissions get
--use-identity [system]
```
If the user needs multiple keyvaults, they can still use the 2nd `az keyvault set-policy` command.

**Additional context**

Fewer commands to do the right thing.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.