|
1 | 1 | ---
|
2 |
| -title: Create an account for Device Update for Azure IoT Hub |
3 |
| -description: Create a device update account and instance in Device Update for Azure IoT Hub using the Azure portal or CLI. |
| 2 | +title: Create Azure Device Update for Azure IoT Hub resources |
| 3 | +description: Create an Azure Device Update for Iot Hub account and instance by using the Azure portal or Azure CLI. |
4 | 4 | author: eshashah-msft
|
5 | 5 | ms.author: eshashah
|
6 |
| -ms.date: 10/30/2022 |
| 6 | +ms.date: 11/18/2024 |
7 | 7 | ms.topic: how-to
|
8 | 8 | ms.service: azure-iot-hub
|
9 | 9 | ms.subservice: device-update
|
10 | 10 | ---
|
11 | 11 |
|
12 | 12 | # Create Device Update for IoT Hub resources
|
13 | 13 |
|
14 |
| -To get started with Device Update, create a Device Update account and instance, and then set access control roles. |
| 14 | +To get started with Azure Device Update for IoT Hub, you create a Device Update account and instance, and then set access control roles. This article describes how to create and configure Device Update resources by using the Azure portal or Azure CLI. |
15 | 15 |
|
16 |
| -A Device Update account is a resource in your Azure subscription. A Device Update instance is a logical container within an account that is associated with a specific IoT hub. An instance contains updates and deployments associated with its IoT hub. You can create multiple instances within an account. For more information, see [Device Update resources](device-update-resources.md). |
| 16 | +A Device Update account is a resource in your Azure subscription. A Device Update instance is a logical container within the account that's associated with a specific IoT hub. A Device Update instance contains updates and deployments associated with its IoT hub. You can create multiple Device Update instances within an account. For more information, see [Device Update resources](device-update-resources.md). |
17 | 17 |
|
18 | 18 | ## Prerequisites
|
19 | 19 |
|
20 | 20 | # [Azure portal](#tab/portal)
|
21 | 21 |
|
22 |
| -An IoT hub. It's required that you use an S1 (Standard) tier or above. |
| 22 | +- **Owner** or **User Access Administrator** role permissions in an Azure subscription |
| 23 | +- A Standard (S1) or above instance of Azure IoT Hub |
| 24 | +- An Azure Storage account to store diagnostics logs for your Device Update instance |
23 | 25 |
|
24 | 26 | # [Azure CLI](#tab/cli)
|
25 | 27 |
|
26 |
| -* An IoT hub. It's required that you use an S1 (Standard) tier or above. |
| 28 | +- **Owner** or **User Access Administrator** role permissions in an Azure subscription |
| 29 | +- A Standard (S1) or above instance of Azure IoT Hub |
| 30 | +- The Bash environment in [Azure Cloud Shell](../cloud-shell/quickstart.md). Select the following button to open Cloud Shell. |
27 | 31 |
|
28 |
| -* An Azure CLI environment: |
| 32 | + :::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com"::: |
29 | 33 |
|
30 |
| - * Use the Bash environment in [Azure Cloud Shell](../cloud-shell/quickstart.md). |
| 34 | + Or, if you prefer to run Azure CLI commands locally: |
| 35 | + |
| 36 | + 1. [Install Azure CLI](/cli/azure/install-azure-cli). Run [az version](/cli/azure/reference-index#az-version) to find the installed version and dependent libraries, and [az upgrade](/cli/azure/reference-index#az-upgrade) to install the latest version. |
| 37 | + 1. Sign in to Azure by running [az login](/cli/azure/reference-index#az-login). |
| 38 | + 1. Install the `azure-iot` extension when prompted on first use. To make sure you're using the latest version of the extension, run `az extension update --name azure-iot`. |
31 | 39 |
|
32 |
| - :::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com"::: |
| 40 | +--- |
33 | 41 |
|
34 |
| - * Or, if you prefer to run CLI reference commands locally, [install the Azure CLI](/cli/azure/install-azure-cli) |
| 42 | +## Create a Device Update account and instance |
35 | 43 |
|
36 |
| - * Sign in to the Azure CLI by using the [az login](/cli/azure/reference-index#az-login) command. |
| 44 | +# [Azure portal](#tab/portal) |
37 | 45 |
|
38 |
| - * Run [az version](/cli/azure/reference-index#az-version) to find the version and dependent libraries that are installed. To upgrade to the latest version, run [az upgrade](/cli/azure/reference-index#az-upgrade). |
39 |
| - |
40 |
| - * When prompted, install Azure CLI extensions on first use. The commands in this article use the **azure-iot** extension. Run `az extension update --name azure-iot` to make sure you're using the latest version of the extension. |
| 46 | +1. In the [Azure portal](https://portal.azure.com), search for and select **Device Update for IoT Hubs**. |
| 47 | +1. Select **Create**, or **Create Device Update for IoT Hub** if this is your first Device Update account. |
41 | 48 |
|
42 |
| ---- |
| 49 | + :::image type="content" source="media/create-device-update-account/device-update-marketplace.png" alt-text="Screenshot of Device Update for IoT Hub resource."::: |
43 | 50 |
|
44 |
| -## Create an account and instance |
45 |
| - |
46 |
| -# [Azure portal](#tab/portal) |
| 51 | +1. On the **Basics** tab of the **Create Device Update** screen, provide the following information: |
47 | 52 |
|
48 |
| -1. In the [Azure portal](https://portal.azure.com), select **Create a Resource** and search for "Device Update for IoT Hub" |
| 53 | + - **Subscription**: Select the name of the Azure subscription for your Device Update account. |
| 54 | + - **Resource group**: Select an existing resource group or create a new one. |
| 55 | + - **Name**: Provide a name for your Device Update account. |
| 56 | + - **Location**: Select the Azure region for your account. For more information, see [Products available by region](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/). |
| 57 | + - **SKU**: Select **Standard**. |
| 58 | + - Under **Grant Access to Account**, select the checkbox for **Assign Device Update Administrator role** to assign yourself the Device Update administrator role. For more information, see [Configure access control roles](configure-access-control-device-update.md). |
| 59 | + - **Instance Name**: Provide a name for your Device Update instance. |
| 60 | + - **IoT Hub Name**: Select the IoT Hub you want to link to your Device Update instance. |
49 | 61 |
|
50 |
| -2. Select **Create** > **Device Update for IoT Hub** |
| 62 | +1. Select **Next: Diagnostics** |
51 | 63 |
|
52 |
| - :::image type="content" source="media/create-device-update-account/device-update-marketplace.png" alt-text="Screenshot of Device Update for IoT Hub resource." lightbox="media/create-device-update-account/device-update-marketplace.png"::: |
| 64 | + :::image type="content" source="media/create-device-update-account/account-details.png" alt-text="Screenshot of account details for a new Device Update account."::: |
53 | 65 |
|
54 |
| -3. On the **Basics** tab, provide the following information for your Device Update account and instance: |
| 66 | +1. On the **Diagnostics** tab, slide the toggle to **Microsoft diagnostics logging Enabled** to enable diagnostic logging for your Device Update instance. Enabling Microsoft diagnostics allows Microsoft to collect, store, and analyze diagnostic log files from your devices if they encounter an update failure. |
55 | 67 |
|
56 |
| - * **Subscription**: The Azure subscription to be associated with your Device Update account. |
57 |
| - * **Resource group**: An existing or new resource group. |
58 |
| - * **Name**: A name for your account. |
59 |
| - * **Location**: The Azure region where your account will be located. For information about which regions support Device Update for IoT Hub, see [Azure Products-by-region page](https://azure.microsoft.com/global-infrastructure/services/?products=iot-hub). |
60 |
| - * Check the box to assign the Device Update administrator role to yourself. You can also use the steps listed in the [Configure access control roles](configure-access-control-device-update.md) section to provide a combination of roles to users and applications for the right level of access. You need to have Owner or User Access Administrator permissions in your subscription to manage roles. |
61 |
| - * **Instance Name**: A name for your instance. |
62 |
| - * **IoT Hub Name**: Select the IoT Hub you want to link to your Device Update instance |
63 |
| - * Check the box to grant the right access to Azure Device Update service principal in the IoT Hub to set up and operate the Device Update Service. You need to have the right permissions to add access. |
64 |
| - > [!NOTE] |
65 |
| - > If you are unable to grant access to Azure Device Update service principal during resource creation, refer to [configure the access control for users and Azure Device Update service principal](configure-access-control-device-update.md) . If this access is not set you will not be able to run deployment, device management and diagnostic operations. Learn more about the [Azure Device Update service principal access](device-update-control-access.md#configuring-access-for-azure-device-update-service-principal-in-the-iot-hub). |
| 68 | +1. To enable remote diagnostics log collection, select **Select Azure Storage account** and then select an Azure Blob storage account to link to your Device Update instance. The Storage account details update automatically. |
66 | 69 |
|
67 |
| - :::image type="content" source="media/create-device-update-account/account-details.png" alt-text="Screenshot of account details for a new Device Update account." lightbox="media/create-device-update-account/account-details.png"::: |
| 70 | +1. Select **Next: Networking**. |
68 | 71 |
|
69 |
| -4. Select **Next: Diagnostics**. Enabling Microsoft diagnostics, gives Microsoft permission to collect, store, and analyze diagnostic log files from your devices when they encounter an update failure. In order to enable remote log collection for diagnostics, you need to link your Device Update instance to your Azure Blob storage account. Selecting the Azure Storage account will automatically update the storage details. |
| 72 | + :::image type="content" source="media/create-device-update-account/account-diagnostics.png" alt-text="Screenshot of diagnostic details."::: |
70 | 73 |
|
71 |
| - :::image type="content" source="media/create-device-update-account/account-diagnostics.png" alt-text="Screenshot of diagnostic details." lightbox="media/create-device-update-account/account-diagnostics.png"::: |
| 74 | +1. On the **Networking** tab, you choose the endpoints that devices can use to connect to your Device Update instance. For this example, select **Public access**. |
72 | 75 |
|
73 |
| -5. On the **Networking** tab, to continue creating Device Update account and instance. |
74 |
| - Choose the endpoints that devices can use to connect to your Device Update instance. Accept the default setting, Public access, for this example. |
| 76 | +1. Select **Review**. |
75 | 77 |
|
76 |
| - :::image type="content" source="media/create-device-update-account/account-networking.png" alt-text="Screenshot of networking details." lightbox="media/create-device-update-account/account-networking.png"::: |
| 78 | + :::image type="content" source="media/create-device-update-account/account-networking.png" alt-text="Screenshot of networking details."::: |
77 | 79 |
|
78 |
| -6. Select **Next: Review + Create**. After validation, select **Create**. |
| 80 | +1. On the **Review** tab, review the details, and when validation passes, select **Create**. |
79 | 81 |
|
80 |
| - :::image type="content" source="media/create-device-update-account/account-review.png" alt-text="Screenshot of account review." lightbox="media/create-device-update-account/account-review.png"::: |
| 82 | + :::image type="content" source="media/create-device-update-account/account-review.png" alt-text="Screenshot of account review."::: |
81 | 83 |
|
82 |
| -7. You'll see that your deployment is in progress. The deployment status will change to "complete" in a few minutes. When it does, select **Go to resource** |
| 84 | +1. The screen changes to show that your deployment is in progress. When the deployment completes, select **Go to resource**. |
83 | 85 |
|
84 | 86 | # [Azure CLI](#tab/cli)
|
85 | 87 |
|
86 |
| -Use the [az iot du account create](/cli/azure/iot/du/account#az-iot-du-account-create) command to create a new Device Update account. |
| 88 | +1. Run [az iot du account create](/cli/azure/iot/du/account#az-iot-du-account-create) to create a new Device Update account. |
87 | 89 |
|
88 |
| -Replace the following placeholders with your own information: |
| 90 | + ```azurecli |
| 91 | + az iot du account create --resource-group <resource_group> --account <account_name> --location <region> |
| 92 | + ``` |
89 | 93 |
|
90 |
| -* *\<resource_group>*: An existing resource group in your subscription. |
91 |
| -* *\<account_name>*: A name for your Device Update account. |
92 |
| -* *\<region>*: The Azure region where your account will be located. For information about which regions support Device Update for IoT Hub, see [Azure Products-by-region page](https://azure.microsoft.com/global-infrastructure/services/?products=iot-hub). If no region is provided, the resource group's location is used. |
| 94 | + In the command, replace the following placeholders with your own information: |
93 | 95 |
|
94 |
| - > [!NOTE] |
95 |
| - > Your Device Update account doesn't need to be in the same region as your IoT hubs, but for better performance it is recommended that you keep them geographically close. |
| 96 | + - `<resource_group>`: An existing resource group in your subscription. |
| 97 | + - `<account_name>`: A name for your Device Update account. |
| 98 | + - `<region>`: The Azure region for your account. For more information, see [Products available by region](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/). If you don't provide a region, setup uses the resource group location. |
96 | 99 |
|
97 |
| -```azurecli-interactive |
98 |
| -az iot du account create --resource-group <resource_group> --account <account_name> --location <region> |
99 |
| -``` |
| 100 | + > [!NOTE] |
| 101 | + > Your Device Update account doesn't need to be in the same region as your IoT hub, but for better performance they should be geographically close. |
100 | 102 |
|
101 |
| -Use the [az iot du instance create](/cli/azure/iot/du/instance#az-iot-du-instance-create) command to create a Device Update instance. |
| 103 | +1. Run [az iot du instance create](/cli/azure/iot/du/instance#az-iot-du-instance-create) to create a Device Update instance. |
102 | 104 |
|
103 |
| -An *instance* of Device Update is associated with a single IoT hub. Select the IoT hub that will be used with Device Update. When you link an IoT hub to a Device Update instance, a new shared access policy is automatically created give Device Update permissions to work with IoT Hub (registry write and service connect). This policy ensures that access is only limited to Device Update. |
| 105 | + ```azurecli |
| 106 | + az iot du instance create --account <account_name> --instance <instance_name> --iothub-ids <iothub_id> |
| 107 | + ``` |
104 | 108 |
|
105 |
| -Replace the following placeholders with your own information: |
| 109 | +An *instance* of Device Update is associated with a single IoT hub. Select the IoT hub that will be used with Device Update. When you link an IoT hub to a Device Update instance, a new shared access policy is automatically created give Device Update permissions to work with IoT Hub (registry write and service connect). This policy ensures that access is only limited to Device Update. |
106 | 110 |
|
107 |
| -* *\<account_name>*: The name of the Device Update account that this instance will be associated with. |
108 |
| -* *\<instance_name>*: A name for this instance. |
109 |
| -* *\<iothub_id>*: The resource ID for the IoT hub that will be linked to this instance. You can retrieve your IoT hub resource ID by using the [az iot hub show](/cli/azure/iot/hub#az-iot-hub-show) command and querying for the ID value: `az iot hub show -n <iothub_name> --query id`. |
| 111 | + In the command, replace the following placeholders with your own information: |
110 | 112 |
|
111 |
| -```azurecli-interactive |
112 |
| -az iot du instance create --account <account_name> --instance <instance_name> --iothub-ids <iothub_id> |
113 |
| -``` |
| 113 | + - `<account_name>`: The name of the Device Update account for this instance. |
| 114 | + - `<instance_name>`: A name for this instance. |
| 115 | + - `<iothub_id>`: The resource ID for the IoT hub to link to this instance. You can get your IoT hub resource ID by running [az iot hub show](/cli/azure/iot/hub#az-iot-hub-show) and querying for the ID value: `az iot hub show -n <iothub_name> --query id`. |
114 | 116 |
|
115 |
| ->[!TIP] |
116 |
| ->As part of the instance creation process, you can also configure diagnostics logging. For more information, see [Remotely collect diagnostic logs from devices](device-update-log-collection.md). |
| 117 | +> [!TIP] |
| 118 | +> You can also configure diagnostics logging as part of the instance creation process. You must have an Azure Blob Storage account to store the diagnostic logs. For more information, see [Remotely collect diagnostic logs from devices](device-update-log-collection.md). |
117 | 119 |
|
118 | 120 | ---
|
119 | 121 |
|
120 |
| -## Next steps |
| 122 | +## Configure access |
| 123 | + |
| 124 | +If you have the required **Owner** or **User Access Administrator** permissions for your Azure subscription, Device Update setup automatically assigns **IoT Hub Data Contributor** role access to your Device Update service principal. This access allows Device Update to run deployment, device management, and diagnostic operations. |
| 125 | + |
| 126 | +After you create your Device Update resources, you can configure access control to provide a combination of roles to users and applications for the right level of access. For more information, see [Configure access control roles for Device Update resources](configure-access-control-device-update.md). |
| 127 | + |
| 128 | +## Related content |
121 | 129 |
|
122 |
| -Once you have created your Device Update resources, [configure the access control for users and Azure Device Update service principal](configure-access-control-device-update.md). |
| 130 | +- [Device Update accounts and instances](device-update-resources.md) |
| 131 | +- [Device Update access control roles](device-update-control-access.md) |
123 | 132 |
|
124 |
| -Or, learn more about [Device Update accounts and instances](device-update-resources.md) or [Device Update access control roles](device-update-control-access.md). |
|
0 commit comments