Hi@akhtar,
you can specify --admin-username to provide a username for the account to be created on the VM. Without that, the Azure CLI uses the username of your current shell login session. If the username you have logged into the Azure Cloud Shell or local PowerShell session contains those invalid characters, the VM create operation fails.
$ az vm create -n myvm -g MyResourceGroup --image UbuntuLTS --admin-username <user_name>
Hope it helps!
To know more, join our Azure Training in Sunderland today.