Note that the following command does not have any admin username argument specified, yet it still sends the request to the API and fails.
az vm create -n myvm -g docker-machine --subnet-n docker-machine --availability-set docker-machine --authentication-type ssh --image 'canonical:ubuntuserver:14.04.3-LTS:latest' --ssh-key-value 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAVUjb+H+bQgargG0Ew42/KjjIrJ4Vqwp8X3PKDCS7udZE8rTKx0ah8EfsVcSpzgHMOg2Dx/EBjF5/fE3QUwd8GCe1pNi875/Cf2CEfuQNhoxs+zXTdrVnaa6AnZszFHnPSS7QMhWA8lhjF4N2GCRQDDd3e45qNMc4TsNLz4dS90SNwNVbCyQnme46NTS5Fk2AbiJ5YqWF1UhEpUAdsWFsCRVQAHjH3Y57b2jk3RJJ9UFYQ5Trlow4ocOYEfsUGmr3yNFiIxlZC/sfx6WKoBxCOJhv/NJr0ow65zp/TC85IeDK5h8Jedd5UT2umdZDp4dbGhW0Aus2Md8yWE80/M9f alp@personal' --size Standard_A1
Starting vm create
Long running operation failed with status 'Failed' {
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [
{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.",
"details": [
{
"code": "BadRequest",
"message": "{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"target\": \"adminUsername\",\r\n \"message\": \"The Admin Username specified is not allowed.\"\r\n }\r\n}"
}
]
}
]
}
}
@burtbiel, i guess tth getpass.getuser()
might return empty string? if yes, we need a wrapper to throw on such case.
This is likely because the local user name was 'admin', which is not allowed by Azure. The name that will be used by the command can be found in az vm create -h
@yugangw-msft merged a PR that should fix this issue.
Most helpful comment
This is likely because the local user name was 'admin', which is not allowed by Azure. The name that will be used by the command can be found in az vm create -h