When I try to run timmy neutron sqaured bash script to obtain a list of all my repos and images in my Azure ACR I get the following error message:
PS C:\users<redacted>\Desktop\scripts> bash redacted .sh
repo1/image1 ERROR: The requested data does not exist.
Correlation ID: 56e7ce3b-7e06-44d3-9226-0bd3fe64e7a7. repo2/image2 ERROR: The requested data does not exist. Correlation ID: 78d37130-9e0f-4dd5-9a96-ec3a5d998a8c. repo3/image3 ERROR: The requested data does not exist. Correlation ID: ccafb0b5-0e29-43c1-8ceb-ac293ac0759d. repo4/image4 ERROR: The requested data does not exist. Correlation ID: e19b4747-96fc-46c5-8640-8a395e39c383.
If I run the two az acr repo ... commands individually, they run ok.
Can anybody see an issue with the the way the variables are declared or the script syntax?
Please refer to timmy's bash script @ Retrieve list of repositories and their tag versions in one call or below
#!/bin/bash
registry_name='REGISTRY_NAME'
destination='LOCATION_TO_STORE_LIST'
az acr login --name $registry_name
touch $destination
repos="$(az acr repository list -n $registry_name --output tsv)"
for i in $repos; do
images="$(az acr repository show-tags -n $registry_name --repository $i --output tsv --orderby time_desc)"
for j in $images; do
echo $i":"$j >> $destination;
done;
done;
Help is very well appreciated.