In the Azure CLI script while passing the admin public key replace '$key' with "$key" as shown below.
az group deployment create --resource-group $resourceGroupName --template-uri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/101-vm-sshkey/azuredeploy.json --parameters projectName=$projectName adminUsername=$username adminPublicKey="$key"
Also when entering the value for the SSH public key copy the entire content in *.pub file of the generated keys and paste in the console WITHOUT any quotes.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@chintanr11 Thanks for your feedback. We are checking on this and will update you shortly.
@chintanr11 I have reproduced the issue and have raised a PR for the document changes.
Thank you!