I get an error while the machine is running and the connection is successful
The issue seems to be with the key name.
I don’t think the question specifies a particular name for the key pair when generating it. During validation, the tests won’t know the exact key name you used for SSH access. Instead, they simply attempt:
ssh azureuser@<vm-ip-add>
it wouldn’t pass the -i flag.
Try creating the key pair with the default name—it should work.
Thanks, that works without a specific name!
