您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

适用于 Linux 虚拟机的 Azure CLI 示例Azure CLI Samples for Linux virtual machines

下表包含指向使用 Azure CLI 生成的 bash 脚本的链接。The following table includes links to bash scripts built using the Azure CLI.

创建虚拟机Create virtual machines
创建虚拟机Create a virtual machine 使用最小配置创建 Linux 虚拟机。Creates a Linux virtual machine with minimal configuration.
创建完全配置的虚拟机Create a fully configured virtual machine 创建资源组、虚拟机以及所有相关资源。Creates a resource group, virtual machine, and all related resources.
创建高度可用的虚拟机Create highly available virtual machines 使用高度可用且负载均衡的配置创建多个虚拟机。Creates several virtual machines in a highly available and load balanced configuration.
创建 VM 并运行配置脚本Create a VM and run configuration script 创建一个虚拟机,并使用 Azure 自定义脚本扩展安装 NGINX。Creates a virtual machine and uses the Azure Custom Script extension to install NGINX.
创建安装有 WordPress 的 VMCreate a VM with WordPress installed 创建一个虚拟机,并使用 Azure 自定义脚本扩展安装 WordPress。Creates a virtual machine and uses the Azure Custom Script extension to install WordPress.
从托管 OS 磁盘创建 VMCreate a VM from a managed OS disk 通过将现有托管磁盘附加为 OS 磁盘来创建虚拟机。Creates a virtual machine by attaching an existing Managed Disk as OS disk.
从快照创建 VMCreate a VM from a snapshot 通过先从快照创建托管磁盘,然后将新的托管磁盘附加为 OS 磁盘来从快照创建虚拟机。Creates a virtual machine from a snapshot by first creating a managed disk from snapshot and then attaching the new managed disk as OS disk.
管理存储Manage storage
从 VHD 创建托管磁盘Create managed disk from a VHD 从作为操作系统磁盘的专用 VHD 或作为数据磁盘的数据 VHD 创建托管磁盘。Creates a managed disk from a specialized VHD as a OS disk or from a data VHD as data disk.
从快照创建托管磁盘Create a managed disk from a snapshot 从快照创建托管磁盘。Creates a managed disk from a snapshot.
将托管磁盘复制到相同或不同订阅Copy managed disk to same or different subscription 将托管磁盘复制到相同或不同订阅(但是与父托管磁盘处于相同区域中)。Copies managed disk to same or different subscription but in the same region as the parent managed disk.
将快照作为 VHD 导出到存储帐户Export a snapshot as VHD to a storage account 将托管快照作为 VHD 导出到不同区域中的存储帐户。Exports a managed snapshot as VHD to a storage account in different region.
将快照复制到相同或不同订阅Copy snapshot to same or different subscription 将快照复制到相同或不同订阅(但是与父快照处于相同区域中)。Copies snapshot to same or different subscription but in the same region as the parent snapshot.
网络虚拟机Network virtual machines
保护虚拟机之间的网络流量Secure network traffic between virtual machines 创建两个虚拟机、所有相关资源以及内部和外部网络安全组 (NSG)。Creates two virtual machines, all related resources, and an internal and external network security groups (NSG).
保护虚拟机Secure virtual machines
对 VM 和数据磁盘进行加密Encrypt a VM and data disks 创建 Azure Key Vault、加密密钥和服务主体,然后对 VM 进行加密。Creates an Azure Key Vault, encryption key, and service principal, then encrypts a VM.
监视虚拟机Monitor virtual machines
使用 Operations Management Suite 监视 VMMonitor a VM with Operations Management Suite 创建一个虚拟机,安装 Operations Management Suite 代理,并在 OMS 工作区中注册该 VM。Creates a virtual machine, installs the Operations Management Suite agent, and enrolls the VM in an OMS Workspace.
对虚拟机进行故障排除Troubleshoot virtual machines
对 VM 操作系统磁盘进行故障排除Troubleshoot a VMs operating system disk 将一个 VM 中的操作系统磁盘作为数据磁盘装载到第二个 VM 中。Mounts the operating system disk from one VM as a data disk on a second VM.