Skip to content

sajayantony/task-secrets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Using Secrets in tasks

Sample to build and run an image using secrets from Key Vaults

#environment variable
# export REGISTRY=myregistry
# export KEY_VAULT_NAME=myvault
# export KEY_VAULT_RESOURCE_GROUP=myRG

az configure --defaults acr=$REGISTRY

Setup the task

az acr task create --name task-secret  \
    --context https://github.com/sajayantony/task-secrets.git \
    --file acb.yaml \
    --commit-trigger-enabled false \
    --assign-identity \
    --set KeyVault=$KEY_VAULT_NAME

Obtain the principal ID for the task

principalID=$(az acr task show --name task-secret --query identity.principalId --output tsv)

Setup permissions on KV

az keyvault set-policy --name $KEY_VAULT_NAME \
    -g $KEY_VAULT_RESOURCE_GROUP \
    --object-id $principalID \
    --secret-permissions get

Execute the task

az acr task run -n task-secret

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors