Hi Neil,
The script you are entering isn't correct. There is no resource group "my-resource-group" and you don't have permission to create it. There is a bug in the exercise. You may use instructions below as a workaround.
Please navigate to the Create an Azure virtual machine exercise, Activate a new sandbox, sign in, etc. Once sandbox is activated and black cloud shell window with "Welcome to Azure Cloud Shell" displayed, navigate to Exercise - Configure network access using the "Unit x of 14" dropdown above the exercise.
After page loads and resource group name is updated to learn-, immediately navigate back to Create an Azure virtual machine exercise and complete it. Inspiration for above workaround came from @pnaroju's #2 suggestion in this post.
Please click Accept Answer and upvote if the above was helpful.
Thanks.
-TP