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
Copy file name to clipboardExpand all lines: articles/virtual-machines/windows/quick-create-cli.md
+24-17Lines changed: 24 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,7 @@ author: cynthn
5
5
ms.service: virtual-machines
6
6
ms.collection: windows
7
7
ms.topic: quickstart
8
-
ms.workload: infrastructure
9
-
ms.date: 08/09/2021
8
+
ms.date: 02/23/2023
10
9
ms.author: cynthn
11
10
ms.custom: mvc, devx-track-azurecli, mode-api
12
11
---
@@ -27,28 +26,32 @@ To open the Cloud Shell, just select **Try it** from the upper right corner of a
27
26
28
27
## Create a resource group
29
28
30
-
Create a resource group with the [az group create](/cli/azure/group) command. An Azure resource group is a logical container into which Azure resources are deployed and managed. The following example creates a resource group named *myResourceGroup* in the *eastus* location:
29
+
Create a resource group with the [az group create](/cli/azure/group) command. An Azure resource group is a logical container into which Azure resources are deployed and managed. The following example creates a resource group named *myResourceGroup* in the *West US 3* location. Replace the value of the variables as needed.
31
30
32
31
```azurecli-interactive
33
-
az group create --name myResourceGroup --location eastus
32
+
resourcegroup="myResourceGroupCLI"
33
+
location="westus3"
34
+
az group create --name $resourcegroup --location $location
34
35
```
35
36
36
37
## Create virtual machine
37
38
38
-
Create a VM with [az vm create](/cli/azure/vm). The following example creates a VM named *myVM*. This example uses *azureuser* for an administrative user name.
39
+
Create a VM with [az vm create](/cli/azure/vm). The following example creates a VM named *myVM*. This example uses *azureuser* for an administrative user name. Replace the values of the variables as needed.
39
40
40
-
You will need to supply a password that meets the [password requirements for Azure VMs](./faq.yml#what-are-the-password-requirements-when-creating-a-vm-
41
-
).
41
+
You'll be prompted to supply a password that meets the [password requirements for Azure VMs](./faq.yml#what-are-the-password-requirements-when-creating-a-vm-
42
+
).
42
43
43
-
Using the example below, you will be prompted to enter a password at the command line. You could also add the the `--admin-password` parameter with a value for your password. The user name and password will be used later, when you connect to the VM.
44
+
Using the example below, you'll be prompted to enter a password at the command line. You could also add the `--admin-password` parameter with a value for your password. The user name and password will be used when you connect to the VM.
44
45
45
46
```azurecli-interactive
47
+
vmname="myVM"
48
+
username="azureuser"
46
49
az vm create \
47
-
--resource-group myResourceGroup \
48
-
--name myVM \
50
+
--resource-group $resourcegroup \
51
+
--name $vmname \
49
52
--image Win2022AzureEditionCore \
50
53
--public-ip-sku Standard \
51
-
--admin-username azureuser
54
+
--admin-username $username
52
55
```
53
56
54
57
It takes a few minutes to create the VM and supporting resources. The following example output shows the VM create operation was successful.
@@ -58,31 +61,35 @@ It takes a few minutes to create the VM and supporting resources. The following
By default, only RDP connections are opened when you create a Windows VM in Azure. Use [az vm open-port](/cli/azure/vm) to open TCP port 80 for use with the IIS web server:
83
90
84
91
```azurecli-interactive
85
-
az vm open-port --port 80 --resource-group myResourceGroup --name myVM
92
+
az vm open-port --port 80 --resource-group $resourcegroup --name $vmname
86
93
```
87
94
88
95
## View the web server in action
@@ -96,7 +103,7 @@ With IIS installed and port 80 now open on your VM from the Internet, use a web
96
103
When no longer needed, you can use the [az group delete](/cli/azure/group) command to remove the resource group, VM, and all related resources:
0 commit comments