Hi khadija
To complete the Create an Azure Virtual Machine exercise, there is no need to use sudo. Is there something besides the listed tasks that you are attempting to do? This isn't part of the exercise, but after you create the VM and install NGINX, you could connect to the VM using command similar to below:
ssh azureuser@<publicIpAddress>
Check the output for publicIPaddress and use it in the command above to SSH to the VM. Once you have connected to your VM using SSH, you could use sudo command on your VM.
Please click Accept Answer if the above was useful. If you still need assistance please add a comment.
Thanks.
-TP