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
The Azure IoT Edge runtime is what turns a device into an IoT Edge device. The runtime can be deployed on devices as small as a Raspberry Pi or as large as an industrial server. Once a device is configured with the IoT Edge runtime, you can start deploying business logic to it from the cloud.
17
17
18
18
To learn more about how the IoT Edge runtime works and what components are included, see [Understand the Azure IoT Edge runtime and its architecture](iot-edge-runtime.md).
19
19
20
-
This article lists the steps to run the Azure IoT Edge runtime on an Ubuntu 16.04 Virtual Machine using the preconfigured [Azure IoT Edge on Ubuntu Azure Marketplace offer](https://aka.ms/azure-iot-edge-ubuntuvm).
20
+
This article lists the steps to deploy an Ubuntu 18.04 LTS virtual machine with the Azure IoT Edge runtime installed and configured using a pre-supplied device connection string. The deployment is accomplished using a [cloud-init](../virtual-machines/linux/using-cloud-init.md
21
+
) based [Azure Resource Manager template](../azure-resource-manager/templates/overview.md) maintained in the [iotedge-vm-deploy](https://github.com/Azure/iotedge-vm-deploy) project repository.
21
22
22
-
On first boot, the Azure IoT Edge on Ubuntu VM preinstalls the latest version of the Azure IoT Edge runtime. It also includes a script to set the connection string and then restart the runtime, which can be triggered remotely through the Azure VM portal or Azure command line, allowing you to easily configure and connect the IoT Edge device without starting an SSH or remote desktop session. This script will wait to set the connection string until the IoT Edge client is fully installed so that you don’t have to build that into your automation.
23
+
On first boot, the Ubuntu 18.04 LTS virtual machine [installs the latest version of the Azure IoT Edge runtime via cloud-init](https://github.com/Azure/iotedge-vm-deploy/blob/master/cloud-init.txt). It also sets a supplied connection string before the runtime starts, allowing you to easily configure and connect the IoT Edge device without the need to start an SSH or remote desktop session.
23
24
24
-
## Deploy from the Azure Marketplace
25
+
## Deploy using Deploy to Azure Button
25
26
26
-
1. Navigate to the [Azure IoT Edge on Ubuntu](https://aka.ms/azure-iot-edge-ubuntuvm) Marketplace offer or by searching “Azure IoT Edge on Ubuntu” on [the Azure Marketplace](https://azuremarketplace.microsoft.com/)
27
-
2. Select **GET IT NOW** and then **Continue** on the next dialog.
28
-
3. Once in the Azure portal, select **Create** and follow the wizard to deploy the VM.
29
-
* If it’s your first time trying out a VM, it’s easiest to use a password and to enable the SSH in the public inbound port menu.
30
-
* If you have a resource intensive workload, you should upgrade the virtual machine size by adding more CPUs and/or memory.
31
-
4. Once the virtual machine is deployed, configure it to connect to your IoT Hub:
32
-
1. Copy your device connection string from your IoT Edge device created in your IoT Hub (You can follow the [Retrieve the connection string in the Azure portal](how-to-register-device.md#retrieve-the-connection-string-in-the-azure-portal) procedure if you aren’t familiar with this process)
33
-
1. Select your newly created virtual machine resource from the Azure portal and open the **run command** option
34
-
1. Select the **RunShellScript** option
35
-
1. Execute the script below via the command window with your device connection string:
1. Wait a few moments, and the screen should then provide a success message indicating the connection string was set successfully.
27
+
The [Deploy to Azure Button](../azure-resource-manager/templates/deploy-to-azure-button.md) allows for streamlined deployment of [Azure Resource Manager templates](../azure-resource-manager/templates/overview.md) maintained on GitHub. This section will demonstrate usage of the Deploy to Azure Button contained in the [iotedge-vm-deploy](https://github.com/Azure/iotedge-vm-deploy) project repository.
39
28
40
-
## Deploy from the Azure portal
41
29
42
-
From the Azure portal, search for “Azure IoT Edge” and select **Ubuntu Server 16.04 LTS + Azure IoT Edge runtime** to begin the VM creation workflow. From there, complete steps 3 and 4 in the "Deploy from the Azure Marketplace" instructions above.
30
+
1. We will deploy an Azure IoT Edge enabled Linux VM using the iotedge-vm-deploy Azure Resource Manager template. To begin, click the button below:
31
+
32
+
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedge-vm-deploy%2Fmaster%2FedgeDeploy.json)
33
+
34
+
1. On the newly launched window, fill in the available form fields:
35
+
36
+
> [!div class="mx-imgBorder"]
37
+
> [](./media/how-to-install-iot-edge-ubuntuvm/iotedge-vm-deploy.png)
38
+
39
+
**Subscription**: The active Azure subscription to deploy the virtual machine into.
40
+
41
+
**Resource group**: An existing or newly created Resource Group to contain the virtual machine and it's associated resources.
42
+
43
+
**DNS Label Prefix**: A required value of your choosing that is used to prefix the hostname of the virtual machine.
44
+
45
+
**Admin Username**: A username, which will be provided root privileges on deployment.
46
+
47
+
**Device Connection String**: A [Device Connection string](how-to-register-device.md) for a device that was created within your intended [IoT Hub](../iot-hub/about-iot-hub.md).
48
+
49
+
**VM Size**: The [size](../cloud-services/cloud-services-sizes-specs.md) of the virtual machine to be deployed
50
+
51
+
**Ubuntu OS Version**: The version of the Ubuntu OS to be installed on the base virtual machine.
52
+
53
+
**Location**: The [geographic region](https://azure.microsoft.com/global-infrastructure/locations/) to deploy the virtual machine into, this value defaults to the location of the selected Resource Group.
54
+
55
+
**Authentication Type**: Choose **sshPublicKey** or **password** depending on your preference.
56
+
57
+
**Admin Password or Key**: The value of the SSH Public Key or the value of the password depending on the choice of Authentication Type.
58
+
59
+
When all fields have been filled in, select the checkbox at the bottom of the page to accept the terms and select **Purchase** to begin the deployment.
60
+
61
+
1. Verify that the deployment has completed successfully. A virtual machine resource should have been deployed into the selected resource group. Take note of the machine name, this should be in the format `vm-0000000000000`. Also, take note of the associated **DNS Name**, which should be in the format `<dnsLabelPrefix>`.`<location>`.cloudapp.azure.com.
62
+
63
+
The **DNS Name** can be obtained from the **Overview** section of the newly deployed virtual machine within the Azure portal.
64
+
65
+
> [!div class="mx-imgBorder"]
66
+
> [](./media/how-to-install-iot-edge-ubuntuvm/iotedge-vm-dns-name.png)
67
+
68
+
1. If you want to SSH into this VM after setup, use the associated **DNS Name** with the command:
69
+
`ssh <adminUsername>@<DNS_Name>`
43
70
44
71
## Deploy from Azure CLI
45
72
46
-
1. If you’re using Azure CLI on your desktop, start by logging in:
73
+
1. Ensure that you have installed the Azure CLI iot extension with:
74
+
```azurecli-interactive
75
+
az extension add --name azure-iot
76
+
```
77
+
78
+
1. Next, if you're using Azure CLI on your desktop, start by logging in:
47
79
48
80
```azurecli-interactive
49
81
az login
50
82
```
51
83
52
-
1. If you have multiple subscriptions, select the subscription you’d like to use:
84
+
1. If you have multiple subscriptions, select the subscription you'd like to use:
53
85
1. List your subscriptions:
54
86
55
87
```azurecli-interactive
56
88
az account list --output table
57
89
```
58
90
59
-
1. Copy the SubscriptionID field for the subscription you’d like to use.
91
+
1. Copy the SubscriptionID field for the subscription you'd like to use.
60
92
61
-
1. Set your working subscription with the ID that you just copied:
93
+
1. Set your working subscription with the ID that you copied:
62
94
63
95
```azurecli-interactive
64
-
az account set -s {SubscriptionId}
96
+
az account set -s <SubscriptionId>
65
97
```
66
98
67
99
1. Create a new resource group (or specify an existing one in the next steps):
@@ -70,26 +102,61 @@ From the Azure portal, search for “Azure IoT Edge” and select **Ubuntu Serve
70
102
az group create --name IoTEdgeResources --location westus2
71
103
```
72
104
73
-
1. Accept the terms of use for the virtual machine. If you want to review the terms first, follow the steps in [Deploy from the Azure Marketplace](#deploy-from-the-azure-marketplace).
105
+
1. Create a new virtual machine:
106
+
107
+
To use an **authenticationType** of `password`, see the example below:
74
108
75
109
```azurecli-interactive
76
-
az vm image terms accept --urn microsoft_iot_edge:iot_edge_vm_ubuntu:ubuntu_1604_edgeruntimeonly:latest
To authenticate with an SSH key, you may do so by specifying an **authenticationType** of `sshPublicKey`, then provide the value of the SSH key in the **adminPasswordOrKey** parameter. An example is shown below.
80
122
81
-
```azurecli-interactive
82
-
az vm create --resource-group IoTEdgeResources --name EdgeVM --image microsoft_iot_edge:iot_edge_vm_ubuntu:ubuntu_1604_edgeruntimeonly:latest --admin-username azureuser --generate-ssh-keys
1. Set the device connection string (You can follow the [Retrieve the connection string with the Azure CLI](how-to-register-device.md#retrieve-the-connection-string-with-the-azure-cli) procedure if you’re not familiar with this process):
az vm run-command invoke -g IoTEdgeResources -n EdgeVM --command-id RunShellScript --script "/etc/iotedge/configedge.sh '{device_connection_string}'"
89
-
```
140
+
1. Verify that the deployment has completed successfully. A virtual machine resource should have been deployed into the selected resource group. Take note of the machine name, this should be in the format `vm-0000000000000`. Also, take note of the associated **DNS Name**, which should be in the format `<dnsLabelPrefix>`.`<location>`.cloudapp.azure.com.
141
+
142
+
The **DNS Name** can be obtained from the JSON-formatted output of the previous step, within the **outputs** section as part of the **public SSH** entry. The value of this entry can be used to SSH into to the newly deployed machine.
143
+
144
+
```bash
145
+
"outputs": {
146
+
"public SSH": {
147
+
"type": "String",
148
+
"value": "ssh <adminUsername>@<DNS_Name>"
149
+
}
150
+
}
151
+
```
152
+
153
+
The **DNS Name** can also be obtained from the **Overview** section of the newly deployed virtual machine within the Azure portal.
154
+
155
+
> [!div class="mx-imgBorder"]
156
+
> [](./media/how-to-install-iot-edge-ubuntuvm/iotedge-vm-dns-name.png)
90
157
91
-
If you want to SSH into this VM after setup, use the publicIpAddress with the command:
92
-
`ssh azureuser@{publicIpAddress}`
158
+
1. If you want to SSH into this VM after setup, use the associated **DNS Name** with the command:
159
+
`ssh <adminUsername>@<DNS_Name>`
93
160
94
161
## Next steps
95
162
@@ -99,4 +166,4 @@ If you are having problems with the IoT Edge runtime installing properly, check
99
166
100
167
To update an existing installation to the newest version of IoT Edge, see [Update the IoT Edge security daemon and runtime](how-to-update-iot-edge.md).
101
168
102
-
If you'd like to open up ports to access the VM through SSH or other inbound connections, refer to the Azure Virtual Machine documentation on [opening up ports and endpoints to a Linux VM](../virtual-machines/linux/nsg-quickstart.md)
169
+
If you'd like to open up ports to access the VM through SSH or other inbound connections, refer to the Azure Virtual Machines documentation on [opening up ports and endpoints to a Linux VM](../virtual-machines/linux/nsg-quickstart.md)
0 commit comments