File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -396,19 +396,15 @@ get_values_from_user() {
396396
397397# Authenticate with Azure
398398echo " "
399- if az account show & > /dev/null; then
400- echo " Already authenticated with Azure."
399+ echo " Attempting to authenticate with Azure..."
400+ if [ -n " $managedIdentityClientId " ]; then
401+ # Use managed identity if running in Azure
402+ echo " Authenticating with Managed Identity..."
403+ az login --identity --client-id ${managedIdentityClientId}
401404else
402- echo " Not authenticated with Azure. Attempting to authenticate..."
403- if [ -n " $managedIdentityClientId " ]; then
404- # Use managed identity if running in Azure
405- echo " Authenticating with Managed Identity..."
406- az login --identity --client-id ${managedIdentityClientId}
407- else
408- # Use Azure CLI login if running locally
409- echo " Authenticating with Azure CLI..."
410- az login
411- fi
405+ # Use Azure CLI login if running locally
406+ echo " Authenticating with Azure CLI..."
407+ az login
412408fi
413409echo " "
414410
You can’t perform that action at this time.
0 commit comments