Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dev-ojeda/mslearn-microservices-devops-aspnet-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: MicrosoftDocs/mslearn-microservices-devops-aspnet-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 11, 2023

  1. Retry making ACR instance

    CamSoper committed Dec 11, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    lucab Luca Bruno
    Copy the full SHA
    1c49686 View commit details

Commits on Dec 12, 2023

  1. Better wait logic for ACR

    CamSoper committed Dec 12, 2023
    Copy the full SHA
    1b85024 View commit details
Showing with 18 additions and 4 deletions.
  1. +18 −4 deploy/k8s/create-acr.sh
22 changes: 18 additions & 4 deletions deploy/k8s/create-acr.sh
Original file line number Diff line number Diff line change
@@ -97,10 +97,24 @@ then
echo
fi

eshopRegistry=`az acr show -n $eshopAcrName --query "loginServer" -otsv`

if [ -z "$eshopRegistry" ]
then
echo "Giving AKS access to ACR instance \"$eshopAcrName\"..."
retryCount=0
eshopRegistry=""

while [ -z "$eshopRegistry" ] && [ $retryCount -lt 10 ]; do
exec &> /dev/null
eshopRegistry=$(az acr show -n $eshopAcrName --query "loginServer" -otsv)
exec >& /dev/tty

if [ -z "$eshopRegistry" ]; then
echo "ACR instance wasn't ready. I'll keep trying for up to 5 minutes..."
sleep 30
retryCount=$((retryCount+1))
fi
done

if [ -z "$eshopRegistry" ]; then
echo "${newline}${errorStyle}ERROR! ACR server $eshopAcrName doesn't exist!${defaultTextStyle}${newline}"
exit 1
fi
@@ -115,10 +129,10 @@ aksIdentityObjectId=$(az aks show -g $eshopRg -n $ESHOP_AKSNAME --query identity
if [ ! -z "$aksIdentityObjectId" ]
then
acrResourceId=$(az acr show -n $eshopAcrName -g $eshopRg --query id -o tsv)

az role assignment create \
--role AcrPull \
--assignee-object-id $aksIdentityObjectId \
--assignee-principal-type ServicePrincipal \
--scope $acrResourceId \
--output none
fi