Use Azure CLI to create a virtual machine, azurecli

Source: Internet
Author: User
Tags myvm

Use Azure CLI to create a virtual machine, azurecli

Use the az vm create command to create a vm.

When creating a virtual machine, you can use multiple options, such as operating system image, disk size adjustment, and credential management. In this example, a virtual machine running Ubuntu Server named "myVM" is created.

Az vm create -- resource-group myResourceGroupVM -- name myVM -- image snapshot tults -- generate-ssh-keys

After a VM is created, Azure CLI outputs information about the VM. Please note downPublicIpAddressYou can use this address to access the virtual machine.

{"Fqdns": "", "id": "/subscriptions/d5b9d4b7-6fc1-0000-0000-000000000000/resourceGroups/myResourceGroupVM/providers/Microsoft. compute/virtualMachines/myVM "," location ":" chinaeast "," macAddress ":" 00-0D-3A-23-9A-49 "," powerState ":" VM running "," privateIpAddress ":" 10.0.0.4 ", "publicIpAddress": "52.174.34.95", "resourceGroup": "myResourceGroupVM "}
Connect to VM

Now you can use SSH to connect to the VM. Replace the sample IP address withPublicIpAddress.

Ssh 52.174.34.95

After using the VM, close the SSH session.

Exit

For more information about the VM image and size, click here.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.