Skip to content

Commit 936ec8b

Browse files
refactor: prompt user for azure cli authentication while running post deployment script (#726)
* Refactor process_sample_data.sh to streamline required variable retrieval * prompt for Azure CLI authentication in process_sample_data.sh
1 parent 3642453 commit 936ec8b

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

infra/scripts/process_sample_data.sh

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,19 +396,15 @@ get_values_from_user() {
396396

397397
# Authenticate with Azure
398398
echo ""
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}
401404
else
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
412408
fi
413409
echo ""
414410

0 commit comments

Comments
 (0)