Skip to content

Commit 15668ee

Browse files
committed
Make sections more stand-alone
1 parent 5331b25 commit 15668ee

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Save your access token (the string without quotes) for later.
4646

4747
## Use the resource provider REST API to create an IoT hub
4848

49-
Open **Postman** and follow the order of REST commands below to create your IoT hub. These commands are from the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource) article. If any of these REST commands fail, find help with the [IoT Hub API common error codes](/rest/api/iothub/common-error-codes). Keep in mind the access token expires after 5-60 minutes, so you may need to generate another one.
49+
Open **Postman** and follow the order of REST commands below to create your IoT hub. These commands are from the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource) reference. If any of these REST commands fail, find help with the [IoT Hub API common error codes](/rest/api/iothub/common-error-codes). Keep in mind the access token expires after 5-60 minutes, so you may need to generate another one.
5050

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

@@ -86,6 +86,8 @@ Open **Postman** and follow the order of REST commands below to create your IoT
8686

8787
:::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

89+
See the PUT command in the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource/create-or-update?tabs=HTTP).
90+
8991
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**.
9092

9193
## Confirm your IoT hub is in the Azure portal
@@ -100,7 +102,7 @@ Explore more Azure CLI commands for IoT Hub in the [az iot hub](/cli/azure/iot/h
100102

101103
### Update your IoT hub
102104

103-
Updating is as simple as using the same PUT request from when we created the IoT hub and editing the JSON body to contain parameters of your choosing. Try repeating the PUT request, but this time, edit the body of the request by adding a **tags** property, like this:
105+
Updating is as simple as using the same PUT request from when we created the IoT hub and editing the JSON body to contain parameters of your choosing. Edit the body of the request by adding a **tags** property, then run the PUT request.
104106

105107
```json
106108
{
@@ -118,8 +120,16 @@ Updating is as simple as using the same PUT request from when we created the IoT
118120
}
119121
```
120122

123+
```rest
124+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}?api-version=2018-04-01
125+
```
126+
121127
The response will show the new tag added in the console. Remember, you may need to refresh your access token if too much time has passed since the last time you generated one.
122128

129+
See the PUT command in the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource/create-or-update?tabs=HTTP).
130+
131+
Alternatively, use the PATCH command from the IoT Hub Resource(/rest/api/iothub/iot-hub-resource/update?tabs=HTTP) to update tags.
132+
123133
## Show all details of your IoT hub
124134

125135
To see all the specifications of your new IoT hub, use a GET request. You can use the same URL that you used with the PUT request, but must erase the **Body** of that request (if not already blank) because a GET request can't have a body. Here's the GET request template:
@@ -128,6 +138,8 @@ To see all the specifications of your new IoT hub, use a GET request. You can us
128138
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}?api-version=2018-04-01
129139
```
130140

141+
See the GET command in the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource/get?tabs=HTTP).
142+
131143
## Remove your IoT hub from the Azure portal
132144

133145
If you're only testing, you might want to clean up your resources and delete your new IoT hub, by sending a DELETE request. be sure to replace the values in `{}` with your own values. The `{resourceName}` value is the name of your IoT hub.
@@ -136,6 +148,8 @@ If you're only testing, you might want to clean up your resources and delete you
136148
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}?api-version=2018-04-01
137149
```
138150

151+
See the DELETE command from the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource/delete?tabs=HTTP).
152+
139153
## Next steps
140154

141155
Since you've deployed an IoT hub using the resource provider REST API, you may want to explore further:

0 commit comments

Comments
 (0)