You need to add echo "" |
before the AZ command to ensure it doesn't hijack stdin.
file='params.csv'
while read line; do
displayName=$(echo $line | cut -d "," -f 1)
password=$(echo $line | cut -d "," -f 2)
upn=$(echo $line | cut -d "," -f 3)
echo "" | az ad user create --display-name \
--user-principal-name \
--password
done < $file
This hint is from - https://stackoverflow.com/a/2708635