Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use managed identity for arc releases #1263

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,19 @@ RESOURCE_AUDIENCE=${RESOURCE_AUDIENCE}

echo "Request parameter preparation, SUBSCRIPTION is $SUBSCRIPTION, RESOURCE_AUDIENCE is $RESOURCE_AUDIENCE, CHART_VERSION is $CHART_VERSION, SPN_CLIENT_ID is $SPN_CLIENT_ID, SPN_TENANT_ID is $SPN_TENANT_ID"

# msi is not supported yet since msi always linked to an Azure Resource
echo "Login cli using spn"
az login --service-principal --username=${SPN_CLIENT_ID} --password=${SPN_SECRET} --tenant=${SPN_TENANT_ID}
if [ $? -eq 0 ]; then
echo "Logged in successfully with spn"
echo "Login cli using Managed Identity"
# Retries needed due to: https://stackoverflow.microsoft.com/questions/195032
n=0
signInExitCode=-1
until [ "$n" -ge 5 ]
do
az login --identity --allow-no-subscriptions && signInExitCode=0 && break
n=$((n+1))
sleep 15
done

if [ $signInExitCode -eq 0 ]; then
echo "Logged in successfully"
else
echo "-e error failed to login to az with managed identity credentials"
exit 1
Expand Down
Loading