📌  相关文章
📜  Microsoft Azure – 用于管理 Azure VM 的 Azure CLI 命令

📅  最后修改于: 2022-05-13 01:57:42.237000             🧑  作者: Mango

Microsoft Azure – 用于管理 Azure VM 的 Azure CLI 命令

Azure 命令行界面用于管理或创建 Azure 资源。通过使用简单的 AZ CLI 命令,我们可以快速、大规模地管理 Azure VM。

让我们开始使用一些重要的 Azure CLI 命令来管理 Azure 虚拟机。

1. 在选择资源组中启动特定的已停止 VM

使用以下命令在已停止的选定资源组中启动特定 VM:

az vm start --resource-group 'resource_group_name --name vm_name

例子:

az vm start --resource-group Cloud-Operations --name CloudOpsVM

输出:

输出图像 2:

2. 停止选择资源组中的特定运行虚拟机

使用以下命令停止选定资源组中正在运行的 VM:

az vm stop --resource-group 'resource_group_name --name vm_name

例子:

az vm stop --resource-group Cloud-Operations --name CloudOpsVM

输出:

输出图像 2:

3. 取消分配选定资源组中的特定 VM

使用以下命令取消分配选定资源组中的特定 VM:

az vm deallocate --resource-group 'resource_group_name --name vm_name

例子:

az vm deallocate --resource-group Cloud-Operations --name CloudOpsVM

输出:

输出图像 2:

4. 重新启动选择资源组中的特定选择 VM

使用以下命令重新启动选定资源组中的特定 VM:

az vm restart --resource-group 'resource_group_name --name vm_name

例子:

az vm restart --resource-group Cloud-Operations --name CloudOpsVM

输出:

输出图像 2: