Skip to content

Commit 0f1799b

Browse files
committed
Edits
1 parent 3c90b96 commit 0f1799b

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

articles/iot-hub/create-hub.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: kgremban
77
ms.author: kgremban
88
ms.service: iot-hub
99
ms.topic: how-to
10-
ms.date: 06/10/2024
10+
ms.date: 07/03/2024
1111
ms.custom: ['Role: Cloud Development']
1212
---
1313

@@ -17,7 +17,23 @@ This article describes how to create and manage an IoT hub.
1717

1818
## Prerequisites
1919

20-
* Depending on which tool you use, either have access to the [Azure portal](https://portal.azure.com) or [install the Azure CLI](/cli/azure/install-azure-cli).
20+
Prepare the following prerequisites, depending on which tool you use.
21+
22+
### [Azure portal](#tab/portal)
23+
24+
* Access to the [Azure portal](https://portal.azure.com).
25+
26+
### [Azure CLI]()
27+
28+
* The Azure CLI installed on your development machine. If you don't have the Azure CLI, follow the steps to [Install the Azure CLI](/cli/azure/install-azure-cli).
29+
30+
* A resource group in your Azure subscription. If you want to create a new resource group, use the [az group create](/cli/azure/group#az-group-create) command:
31+
32+
```azurecli
33+
az group create --name <RESOURCE_GROUP_NAME> --location <REGION>
34+
```
35+
36+
---
2137

2238
## Create an IoT hub
2339

@@ -29,16 +45,15 @@ This article describes how to create and manage an IoT hub.
2945

3046
Use the Azure CLI to create a resource group and then add an IoT hub.
3147

32-
Use the [iz iot hub create](/cli/azure/iot/hub#az-iot-hub-create) command to create an IoT hub in your resource group, using a globally unique name for your IoT hub. For example:
48+
Use the [az iot hub create](/cli/azure/iot/hub#az-iot-hub-create) command to create an IoT hub in your resource group, using a globally unique name for your IoT hub. For example:
3349

3450
```azurecli-interactive
35-
az iot hub create --name <NEW_NAME_FOR_YOUR_IOT_HUB> \
36-
--resource-group <RESOURCE_GROUP_NAME> --sku S1
51+
az iot hub create --name <NEW_NAME_FOR_YOUR_IOT_HUB> --resource-group <RESOURCE_GROUP_NAME> --sku S1
3752
```
3853

3954
[!INCLUDE [iot-hub-pii-note-naming-hub](../../includes/iot-hub-pii-note-naming-hub.md)]
4055

41-
The previous command creates an IoT hub in the S1 pricing tier for which you're billed. For more information, see [Azure IoT Hub pricing](https://azure.microsoft.com/pricing/details/iot-hub/).
56+
The previous command creates an IoT hub in the S1 pricing tier. For more information, see [Azure IoT Hub pricing](https://azure.microsoft.com/pricing/details/iot-hub/).
4257

4358
---
4459

@@ -48,23 +63,14 @@ Provide access permissions to applications and services that use IoT Hub functio
4863

4964
### Connect with a connection string
5065

51-
Connection strings are an easy way to get started with IoT Hub, and are used in many samples and tutorials, but aren't recommended for production scenarios.
66+
Connection strings are tokens that grant devices and services permissions to connect to IoT Hub based on shared access policies. Connection strings are an easy way to get started with IoT Hub, and are used in many samples and tutorials, but aren't recommended for production scenarios.
5267

53-
Shared access policies define permissions for devices and services to connect to IoT Hub. The built-in policies provide one or more of the following permissions. You should always provide the least necessary permissions for a given scenario.
54-
55-
* The **Registry Read** and **Registry Write** permissions grant read and write access rights to the identity registry. These permissions are used by back-end cloud services to manage device identities.
56-
57-
* The **Service Connect** permission grants permission to access service endpoints. This permission is used by back-end cloud services to send and receive messages from devices. It's also used to update and read device twin and module twin data.
58-
59-
* The **Device Connect** permission grants permissions for sending and receiving messages using the IoT Hub device-side endpoints. This permission is used by devices to send and receive messages from an IoT hub or update and read device twin and module twin data. It's also used for file uploads.
60-
61-
For information about the access granted by specific permissions, see [IoT Hub permissions](./iot-hub-dev-guide-sas.md#access-control-and-permissions).
68+
For most sample scenarios, the **service** policy is sufficient. The service policy grants **Service Connect** permissions to access service endpoints. For more information about the other built-in shared access policies, see [IoT Hub permissions](./iot-hub-dev-guide-sas.md#access-control-and-permissions).
6269

70+
To get the IoT Hub connection string for the **service** policy, follow these steps:
6371

6472
#### [Azure portal](#tab/portal)
6573

66-
To get the IoT Hub connection string for the **service** policy, follow these steps:
67-
6874
1. In the [Azure portal](https://portal.azure.com), select **Resource groups**. Select the resource group where your hub is located, and then select your hub from the list of resources.
6975

7076
1. On the left-side pane of your IoT hub, select **Shared access policies**.
@@ -73,10 +79,9 @@ To get the IoT Hub connection string for the **service** policy, follow these st
7379

7480
1. Copy the **Primary connection string** and save the value.
7581

76-
7782
#### [Azure CLI](#tab/cli)
7883

79-
IoT hubs are created with several default access policies. One such policy is the **service** policy, which provides sufficient permissions for a service to read and write the IoT hub's endpoints. Run the following command to get a connection string for your IoT hub that adheres to the service policy:
84+
Use the [az iot hub connection-string show](/cli/azure/iot/hub/connection-string#az-iot-hub-connection-string-show) command to get a connection string for your IoT hub that adheres to the service policy:
8085

8186
```azurecli-interactive
8287
az iot hub connection-string show --hub-name YOUR_IOT_HUB_NAME --policy-name service
@@ -92,11 +97,11 @@ The service connection string should look similar to the following example:
9297

9398
### Connect with role assignments
9499

95-
In production scenarios, we recommend using Microsoft Entra ID and Azure role-based access control (Azure RBAC) for connecting to IoT Hub. For more information, see [Control access to IoT Hub by using Microsoft Entra ID](./authenticate-authorize-azure-ad.md).
100+
Authenticating access by using Microsoft Entra ID and controlling permissions by using Azure role-based access control (RBAC) provides improved security and ease of use over security tokens. To minimize potential security issues inherent in security tokens, we recommend that you enforce Microsoft Entra authentication whenever possible. For more information, see [Control access to IoT Hub by using Microsoft Entra ID](./authenticate-authorize-azure-ad.md).
96101

97102
## Delete an IoT hub
98103

99-
When you delete an IoT hub, you lose the associated device identity registry. Any registered devices will need to be registered to a new IoT hub to continue sending data. If you want to move or upgrade an IoT hub, or delete an IoT hub but keep the devices, consider [migrating an IoT hub using the Azure CLI](./migrate-hub-state-cli.md).
104+
When you delete an IoT hub, you lose the associated device identity registry. If you want to move or upgrade an IoT hub, or delete an IoT hub but keep the devices, consider [migrating an IoT hub using the Azure CLI](./migrate-hub-state-cli.md).
100105

101106
### [Azure portal](#tab/portal)
102107

@@ -106,11 +111,10 @@ To delete an IoT hub, open your IoT hub in the Azure portal, then choose **Delet
106111

107112
### [Azure CLI](#tab/cli)
108113

109-
To [delete an IoT hub](/cli/azure/iot/hub#az-iot-hub-delete), run the following command:
114+
To delete an IoT hub, run the [az iot hub delete](/cli/azure/iot/hub#az-iot-hub-delete) command:
110115

111116
```azurecli-interactive
112-
az iot hub delete --name {your iot hub name} -\
113-
-resource-group {your resource group name}
117+
az iot hub delete --name <IOT_HUB_NAME> --resource-group <RESOURCE_GROUP_NAME>
114118
```
115119

116120
---
@@ -121,16 +125,16 @@ In addition to the Azure portal and CLI, the following tools are available to he
121125

122126
* **PowerShell cmdlets**
123127

124-
Use the [Az.IoTHub](/powershell/module/az.iothub) set of commands to create and manage IoT hubs.
128+
Use the [Az.IoTHub](/powershell/module/az.iothub) set of commands.
125129

126130
* **IoT Hub resource provider REST API**
127131

128-
Use the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource) set of operations to create and manage IoT hubs.
132+
Use the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource) set of operations.
129133

130134
* **Azure resource manager templates, Bicep, or Terraform**
131135

132-
Use the [Microsoft.Devices/IoTHubs](/azure/templates/microsoft.devices/iothubs) resource type to create and manage IoT hubs. For examples, see [IoT Hub sample templates](/samples/browse/?terms=iot%20hub&languages=bicep%2Cjson)
136+
Use the [Microsoft.Devices/IoTHubs](/azure/templates/microsoft.devices/iothubs) resource type. For examples, see [IoT Hub sample templates](/samples/browse/?terms=iot%20hub&languages=bicep%2Cjson).
133137

134138
* **Visual Studio Code**
135139

136-
Use the [Azure IoT Hub extension for Visual Studio Code](./reference-iot-hub-extension.md) to create and manage IoT hubs.
140+
Use the [Azure IoT Hub extension for Visual Studio Code](./reference-iot-hub-extension.md).

0 commit comments

Comments
 (0)