← 返回命令列表

Linux command

az-vm 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create

az vm create --resource-group [MyRG] --name [MyVM] --image [Ubuntu2204]

List

az vm list

Start

az vm start --resource-group [MyRG] --name [MyVM]

Stop

az vm stop --resource-group [MyRG] --name [MyVM]

Deallocate

az vm deallocate --resource-group [MyRG] --name [MyVM]

Delete

az vm delete --resource-group [MyRG] --name [MyVM]

Get

az vm show --resource-group [MyRG] --name [MyVM]

说明

az vm manages Azure virtual machines. It provides commands for creating, starting, stopping, configuring, and deleting VMs, as well as managing disks, network interfaces, and extensions. The command group enables full lifecycle management of Azure compute resources.

参数

create
Create new virtual machine
list
List virtual machines
start
Start VM
stop
Stop VM (still incurs compute charges)
deallocate
Deallocate VM (stops billing for compute)
restart
Restart VM
delete
Delete VM
show
Get VM details
--resource-group, -g _name_
Resource group name
--name, -n _name_
VM name
--image
OS image (Ubuntu2204, Win2022Datacenter, etc.)
--size
VM size (Standard_B2s, Standard_D2s_v3, etc.)
--admin-username
Admin username
--admin-password
Admin password
--ssh-key-values
SSH public key(s)

FAQ

What is the az-vm command used for?

az vm manages Azure virtual machines. It provides commands for creating, starting, stopping, configuring, and deleting VMs, as well as managing disks, network interfaces, and extensions. The command group enables full lifecycle management of Azure compute resources.

How do I run a basic az-vm example?

Run `az vm create --resource-group [MyRG] --name [MyVM] --image [Ubuntu2204]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does create do in az-vm?

Create new virtual machine