You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Common Azure CLI commands for managing Azure resources
@@ -17,16 +17,19 @@ The Azure CLI allows you to create and manage your Azure resources on macOS, Lin
17
17
This article requires the Azure CLI version 2.0.4 or later. Run `az --version` to find the version. If you need to upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli). You can also use [Cloud Shell](../../cloud-shell/quickstart.md) from your browser.
18
18
19
19
## Basic Azure Resource Manager commands in Azure CLI
20
+
20
21
For more detailed help with specific command line switches and options, you can use the online command help and options by typing `az <command> <subcommand> --help`.
21
22
22
23
### Create VMs
24
+
23
25
| Task | Azure CLI commands |
24
26
| --- | --- |
25
27
| Create a resource group |`az group create --name myResourceGroup --location eastus`|
26
-
| Create a Linux VM |`az vm create --resource-group myResourceGroup --name myVM --image ubuntults`|
28
+
| Create a Linux VM |`az vm create --resource-group myResourceGroup --name myVM --image LinuxImageName`|
27
29
| Create a Windows VM |`az vm create --resource-group myResourceGroup --name myVM --image win2016datacenter`|
28
30
29
31
### Manage VM state
32
+
30
33
| Task | Azure CLI commands |
31
34
| --- | --- |
32
35
| Start a VM |`az vm start --resource-group myResourceGroup --name myVM`|
@@ -37,6 +40,7 @@ For more detailed help with specific command line switches and options, you can
37
40
| Delete a VM |`az vm delete --resource-group myResourceGroup --name myVM`|
38
41
39
42
### Get VM info
43
+
40
44
| Task | Azure CLI commands |
41
45
| --- | --- |
42
46
| List VMs |`az vm list`|
@@ -45,6 +49,7 @@ For more detailed help with specific command line switches and options, you can
45
49
| Get all available VM sizes |`az vm list-sizes --location eastus`|
46
50
47
51
## Disks and images
52
+
48
53
| Task | Azure CLI commands |
49
54
| --- | --- |
50
55
| Add a data disk to a VM |`az vm disk attach --resource-group myResourceGroup --vm-name myVM --disk myDataDisk --size-gb 128 --new`|
@@ -54,6 +59,6 @@ For more detailed help with specific command line switches and options, you can
54
59
| Create image of a VM |`az image create --resource-group myResourceGroup --source myVM --name myImage`|
55
60
| Create VM from image |`az vm create --resource-group myResourceGroup --name myNewVM --image myImage`|
56
61
57
-
58
62
## Next steps
63
+
59
64
For additional examples of the CLI commands, see the [Create and Manage Linux VMs with the Azure CLI](tutorial-manage-vm.md) tutorial.
0 commit comments