79664471

Date: 2025-06-13 07:09:08
Score: 1.5
Natty:
Report link

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

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: PeterN