Skip to content

Commit f3efd37

Browse files
committed
Fixed indentations
1 parent 6dffe42 commit f3efd37

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

articles/iot-hub/iot-hub-rm-rest.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.custom: devx-track-csharp
1313

1414
# Create an IoT hub using the resource provider REST API (.NET)
1515

16-
You can use the [IoT Hub Resource](/rest/api/iothub/iothubresource) REST API to create and manage Azure IoT hubs programmatically. This article shows you how to use the IoT Hub Resource to create an IoT hub using **Postman**. Alternatively, you can use cURL.
16+
You can use the [IoT Hub Resource](/rest/api/iothub/iothubresource) REST API to create and manage Azure IoT hubs programmatically. This article shows you how to use the IoT Hub Resource to create an IoT hub using **Postman**. Alternatively, you can use **cURL**.
1717

1818
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
1919

@@ -27,20 +27,20 @@ You can use the [IoT Hub Resource](/rest/api/iothub/iothubresource) REST API to
2727

2828
1. In the Azure PowerShell cmdlet or Azure Cloud Shell, sign in and then retrieve a token with this command:
2929

30-
```azurecli-interactive
31-
az account get-access-token --resource https://management.azure.com
32-
```
33-
You should see a response in the console similar to this JSON (except the access token is long):
34-
35-
```json
36-
{
37-
"accessToken": "eyJ ... pZA",
38-
"expiresOn": "2022-09-16 20:57:52.000000",
39-
"subscription": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
40-
"tenant": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
41-
"tokenType": "Bearer"
42-
}
43-
```
30+
```azurecli-interactive
31+
az account get-access-token --resource https://management.azure.com
32+
```
33+
You should see a response in the console similar to this JSON (except the access token is long):
34+
35+
```json
36+
{
37+
"accessToken": "eyJ ... pZA",
38+
"expiresOn": "2022-09-16 20:57:52.000000",
39+
"subscription": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
40+
"tenant": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
41+
"tokenType": "Bearer"
42+
}
43+
```
4444

4545
Save your access token (the string without quotes) for later.
4646

@@ -50,41 +50,41 @@ Open **Postman** and follow the order of REST commands below to create your IoT
5050

5151
1. In a new **Postman** request, from the **Auth** tab, select the **Type** dropdown list and choose **Bearer Token**.
5252

53-
:::image type="content" source="media/iot-hub-rm-rest/select-bearer-token.png" alt-text="Screenshot that shows how to select the Bearer Token type of authorization in **Postman**.":::
53+
:::image type="content" source="media/iot-hub-rm-rest/select-bearer-token.png" alt-text="Screenshot that shows how to select the Bearer Token type of authorization in **Postman**.":::
5454

5555
1. Retrieve and copy the access token you saved previously and paste it into the field labeled **Token**.
5656

5757
### Create a new IoT hub
5858

5959
1. Select the REST command dropdown list and choose the PUT command. Copy the URL below, replacing the values in the `{}` with your own values. The `{resourceName}` value is the name you'd like for your new IoT hub. Paste the URL into the field next to the PUT command.
6060

61-
```rest
62-
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}?api-version=2018-04-01
63-
```
61+
```rest
62+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}?api-version=2018-04-01
63+
```
6464

65-
:::image type="content" source="media/iot-hub-rm-rest/paste-put-command.png" alt-text="Screenshot that shows how to add a PUT command in Postman.":::
65+
:::image type="content" source="media/iot-hub-rm-rest/paste-put-command.png" alt-text="Screenshot that shows how to add a PUT command in Postman.":::
6666

67-
For more information about the PUT command, see [Iot Hub Resource - Create Or Update](/rest/api/iothub/iot-hub-resource/create-or-update?tabs=HTTP).
67+
For more information about the PUT command, see [Iot Hub Resource - Create Or Update](/rest/api/iothub/iot-hub-resource/create-or-update?tabs=HTTP).
6868

6969
1. From the **Body** tab, select the **raw** and **JSON** from the dropdown lists.
7070

7171
1. Paste this JSON into the box in **Postman** as shown. Make sure your IoT hub name matches the one in your PUT URL. Change the location to your location (the location assigned to your resource group).
7272

73-
```json
74-
{
75-
"name": "<my-iot-hub>",
76-
"location": "westus2",
77-
"tags": {},
78-
"properties": {},
79-
"sku": {
80-
"name": "S1",
81-
"tier": "Standard",
82-
"capacity": 1
73+
```json
74+
{
75+
"name": "<my-iot-hub>",
76+
"location": "westus2",
77+
"tags": {},
78+
"properties": {},
79+
"sku": {
80+
"name": "S1",
81+
"tier": "Standard",
82+
"capacity": 1
83+
}
8384
}
84-
}
85-
```
85+
```
8686

87-
:::image type="content" source="media/iot-hub-rm-rest/add-body-for-put.png" alt-text="Screenshot that shows how to add JSON to the body of your request in Postman.":::
87+
:::image type="content" source="media/iot-hub-rm-rest/add-body-for-put.png" alt-text="Screenshot that shows how to add JSON to the body of your request in Postman.":::
8888

8989
1. Select **Send** to send your request and create a new IoT hub. A successful request will return a **201 Created** response with a JSON printout of your IoT hub specifications. You can save your request if you're using **Postman**.
9090

0 commit comments

Comments
 (0)