Skip to content

Commit fce6307

Browse files
committed
docs: Explain how to configure the script and the registry for ACR
Signed-off-by: Francesc Arbona <[email protected]>
1 parent 4c6eead commit fce6307

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/actions/spelling/allow.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
acr
2+
ACR
13
aic
24
amd
35
anyfield
@@ -14,6 +16,7 @@ argoprojlabs
1416
args
1517
auths
1618
aws
19+
azurecr
1720
babayaga
1821
baralias
1922
baz
@@ -217,6 +220,7 @@ TODO
217220
toolchain
218221
Torvalds
219222
Tracef
223+
tsv
220224
uber
221225
unmarshal
222226
unmarshals

docs/configuration/registries.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ It has been successfully tested against the following popular registries:
1515
* GitHub Packages Registry (`docker.pkg.github.com`)
1616
* GitLab Container Registry (`registry.gitlab.com`)
1717
* Google Container Registry (`gcr.io`)
18+
* Azure Container Registry (`azurecr.io`)
1819

1920
Chances are, that it will work out of the box for other registries as well.
2021

@@ -326,3 +327,29 @@ two strategies to overcome this:
326327
i.e. for getting EKS credentials from the aws CLI. For example, if the
327328
token has a lifetime of 12 hours, you can set `credsexpire: 12h` and Argo
328329
CD Image Updater will get a new token after 12 hours.
330+
331+
### <a name="external-script-azure"></a>Configuring a script to authenticate against an Azure Container Registry
332+
333+
You can authenticate against an Azure Container Registry using Azure Managed Identities with an external script:
334+
335+
```yaml
336+
registries:
337+
- name: ACR example with external script
338+
api_url: https://acr-example.azurecr.io/
339+
prefix: acr-example.azurecr.io
340+
credentials: ext:/app/scripts/acr-login.sh
341+
credsexpire: 10h
342+
```
343+
344+
The script should contain the name of the registry:
345+
346+
```bash
347+
acr-login.sh: |
348+
#!/bin/sh
349+
LOGIN=$(az login --identity)
350+
REGISTRY="acr-example"
351+
TOKEN=$(az acr login --name $REGISTRY --expose-token --output tsv --query accessToken)
352+
echo "00000000-0000-0000-0000-000000000000:$TOKEN"
353+
```
354+
355+
And the image used for `argocd-image-updater` should contain the Azure CLI.

0 commit comments

Comments
 (0)