I have a created a private AKS cluster on Azure with a Linux VM that acts as self hosted agent\Bastion. The Linux box can access the AKS cluster via Kubectl. My issue is when I try to run a bash script in the Azure DevOps pipeline, I get permission denied.(The pipeline is using the selfhosted agent above) The Bash script runs a Helm command that get a list of the images that AKS will need. I want to use this list to pull images from an external Docker registry and push them to an internal Azure Container Registry and then use Helm to deploy.
Here is the Helm command in the script:
helm upgrade --install hosted-node -f helm_config.yaml myapp/hosted-app --dry-run -n dev | grep "image:" | awk "{print $2}" | uniq | sed "s/"//g" | grep "myapp" | sed "s/^.*image: //g"
The pipeline flow is like this:
Get list of images needed
Pull images from a private Docker repo
Push images to ACR
Run Helm (it will be configured to use images in the ACR)
How to I give the build agent the proper creds from the pipeline to run the above command.
Thanks, Ray