Azure-docs: VM creation issue

Created on 16 Apr 2018  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

I'm at the 2nd step and trying to create a VM after successfully creating myResourceGroupVM via Cloud Shell. This is what I get when I try to create VM in Cloud Shell.

PS Azure:> az vm create --resource-group myResourceGroupVM --name myVM --image UbuntuLTS --generate-ssh-keys
admin user name cannot contain upper case character A-Z, special characters \/"[]:|<>+=;,?*@#()! or start with $ or -

Don't understand what I am missing here. I'm logged in via my corporate email-id using the enterprise subscription.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 cxp doc-bug in-progress triaged virtual-machines-linusvc

Most helpful comment

@anshuman-nath As @MicahMcKittrick-MSFT notes, 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. The doc should probably be updated to reflect this better.

All 5 comments

@anshuman-nath Thanks for the feedback! We are currently investigating and will update you shortly.

@anshuman-nath you can specify a username instead if needed:

az vm create --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username USER_NAME --generate-ssh-keys

@anshuman-nath As @MicahMcKittrick-MSFT notes, 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. The doc should probably be updated to reflect this better.

Thanks for clarifying that @iainfoulds! I was actually curious as to what login it used without specifying that and it makes total sense :)

Thank you @iainfoulds! I was having same issue but using my work computer where my username has an "_", adding --admin-username did the trick!

Was this page helpful?
0 / 5 - 0 ratings