Ok, have you created the user in the "Credentials" section in the Automation Account ?
On the left side, under Shared Resources, click on Credentials
Then, create a user...
Name: You decide the name
User Name: It has to be a valid user in your tenant AD
Password: The password of the user account.
When created, you can call this user in your Automation Account script
hth