Skip to content

Commit 132f5c1

Browse files
authored
Merge pull request #49916 from robinsh/robinsh-iot-set5
IoT Hub cleanup set 5
2 parents 3fead47 + 8bdbec8 commit 132f5c1

8 files changed

+199
-363
lines changed

.openpublishing.redirection.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@
165165
"redirect_url": "/azure/iot-fundamentals/iot-introduction",
166166
"redirect_document_id": false
167167
},
168+
169+
{
170+
"source_path": "articles/iot-hub/iot-hub-create-using-cli-nodejs.md",
171+
"redirect_url": "/azure/iot-hub/iot-hub-create-using-cli",
172+
"redirect_document_id": true
173+
},
168174
{
169175
"source_path": "articles/cognitive-services/custom-decision-service/custom-decision-service-tutorial-analytics.md",
170176
"redirect_url": "/azure/cognitive-services/custom-decision-service",

articles/iot-hub/TOC.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@
224224
href: iot-hub-create-using-powershell.md
225225
- name: Use Azure CLI
226226
href: iot-hub-create-using-cli.md
227-
- name: Use CLI
228-
href: iot-hub-create-using-cli-nodejs.md
229227
- name: Use the REST API
230228
href: iot-hub-rm-rest.md
231229
- name: Use a template from Azure PowerShell

articles/iot-hub/iot-hub-create-use-iot-toolkit.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ ms.author: junhan
1313

1414
[!INCLUDE [iot-hub-resource-manager-selector](../../includes/iot-hub-resource-manager-selector.md)]
1515

16-
You can use [Azure IoT Toolkit for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit) to create Azure IoT hubs. This article shows you how to create an IoT hub with Azure IoT Toolkit.
16+
This article shows you how to use the [Azure IoT Toolkit for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit) to create an Azure IoT hub.
1717

1818
To complete this article, you need the following:
1919

20-
* An active Azure account.
20+
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
21+
2122
- [Visual Studio Code](https://code.visualstudio.com/)
23+
2224
- [Azure IoT Toolkit](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit)
2325

2426
## Create an IoT hub
@@ -49,8 +51,10 @@ To complete this article, you need the following:
4951

5052
## Next steps
5153

52-
Now you have deployed an IoT hub using Azure IoT Toolkit for Visual Studio Code, you may want to explore further:
54+
Now you have deployed an IoT hub using the Azure IoT Toolkit for Visual Studio Code. To explore further, check out the following articles:
55+
56+
* [Use the Azure IoT Toolkit extension for Visual Studio Code to send and receive messages between your device and an IoT Hub](iot-hub-vscode-iot-toolkit-cloud-device-messaging.md).
57+
58+
* [Use the Azure IoT Toolkit extension for Visual Studio Code for Azure IoT Hub device management](iot-hub-device-management-iot-toolkit.md)
5359

54-
* [Use Azure IoT Toolkit extension for Visual Studio Code to send and receive messages between your device and IoT Hub](iot-hub-vscode-iot-toolkit-cloud-device-messaging.md).
55-
* [Use Azure IoT Toolkit extension for Visual Studio Code for Azure IoT Hub device management](iot-hub-device-management-iot-toolkit.md)
56-
* [Wiki page](https://github.com/microsoft/vscode-azure-iot-toolkit/wiki) for Azure IoT Toolkit.
60+
* [See the Azure IoT Toolkit wiki page](https://github.com/microsoft/vscode-azure-iot-toolkit/wiki).

articles/iot-hub/iot-hub-create-using-cli-nodejs.md

Lines changed: 0 additions & 126 deletions
This file was deleted.
Lines changed: 43 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,88 @@
11
---
2-
title: Create an IoT Hub using Azure CLI (az.py) | Microsoft Docs
3-
description: How to create an Azure IoT hub using the cross-platform Azure CLI 2.0 (az.py).
4-
author: dominicbetts
5-
manager: timlt
2+
title: Create an IoT Hub using Azure CLI | Microsoft Docs
3+
description: How to create an Azure IoT hub using Azure CLI.
4+
author: robinsh
65
ms.service: iot-hub
76
services: iot-hub
87
ms.topic: conceptual
9-
ms.date: 06/16/2017
10-
ms.author: dobett
8+
ms.date: 08/23/2018
9+
ms.author: robinsh
1110
---
1211

13-
# Create an IoT hub using the Azure CLI 2.0
12+
# Create an IoT hub using Azure CLI
1413

1514
[!INCLUDE [iot-hub-resource-manager-selector](../../includes/iot-hub-resource-manager-selector.md)]
1615

17-
## Introduction
16+
This article shows you how to create an IoT hub using Azure CLI.
1817

19-
You can use Azure CLI 2.0 (az.py) to create and manage Azure IoT hubs programmatically. This article shows you how to use the Azure CLI 2.0 (az.py) to create an IoT hub.
18+
## Prerequisites
2019

21-
You can complete the task using one of the following CLI versions:
20+
To complete this how-to, you need an Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
2221

23-
* [Azure CLI (azure.js)](iot-hub-create-using-cli-nodejs.md) – the CLI for the classic and resource management deployment models.
24-
* Azure CLI 2.0 (az.py) - the next generation CLI for the resource management deployment model as described in this article.
25-
26-
To complete this tutorial, you need the following:
27-
28-
* An active Azure account. If you don't have an account, you can create a [free account][lnk-free-trial] in just a couple of minutes.
29-
* [Azure CLI 2.0][lnk-CLI-install].
22+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
3023

3124
## Sign in and set your Azure account
3225

33-
Sign in to your Azure account and select your subscription.
34-
35-
1. At the command prompt, run the [login command][lnk-login-command]:
36-
37-
```azurecli
38-
az login
39-
```
26+
If you are running Azure CLI locally instead of using Cloud Shell, you need to sign in to your Azure account.
4027

41-
Follow the instructions to authenticate using the code and sign in to your Azure account through a web browser.
28+
At the command prompt, run the [login command](https://docs.microsoft.com/cli/azure/get-started-with-azure-cli):
4229

43-
2. If you have multiple Azure subscriptions, signing in to Azure grants you access to all the Azure accounts associated with your credentials. Use the following [command to list the Azure accounts][lnk-az-account-command] available for you to use:
44-
4530
```azurecli
46-
az account list
31+
az login
4732
```
4833

49-
Use the following command to select subscription that you want to use to run the commands to create your IoT hub. You can use either the subscription name or ID from the output of the previous command:
50-
51-
```azurecli
52-
az account set --subscription {your subscription name or id}
53-
```
34+
Follow the instructions to authenticate using the code and sign in to your Azure account through a web browser.
5435

5536
## Create an IoT Hub
5637

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

59-
1. When you create an IoT hub, you must create it in a resource group. Either use an existing resource group, or run the following [command to create a resource group][lnk-az-resource-command]:
40+
1. When you create an IoT hub, you must create it in a resource group. Either use an existing resource group, or run the following [command to create a resource group](https://docs.microsoft.com/cli/azure/resource):
6041

61-
```azurecli
62-
az group create --name {your resource group name} --location westus
63-
```
64-
65-
> [!TIP]
66-
> The previous example creates the resource group in the West US location. You can view a list of available locations by running the command `az account list-locations -o table`.
67-
>
68-
>
69-
70-
2. Run the following [command to create an IoT hub][lnk-az-iot-command] in your resource group, using a globally unique name for your IoT hub:
42+
```azurecli
43+
az group create --name {your resource group name} --location westus
44+
```
45+
46+
> [!TIP]
47+
> The previous example creates the resource group in the West US location. You can view a list of available locations by running this command:
48+
>
49+
>``` bash
50+
>az account list-locations -o table
51+
>```
52+
>
53+
54+
2. Run the following [command to create an IoT hub](https://docs.microsoft.com/cli/azure/iot/hub#az-iot-hub-create) in your resource group, using a globally unique name for your IoT hub:
7155
72-
```azurecli
73-
az iot hub create --name {your iot hub name} --resource-group {your resource group name} --sku S1
74-
```
56+
```azurecli
57+
az iot hub create --name {your iot hub name} \
58+
--resource-group {your resource group name} --sku S1
59+
```
7560
7661
[!INCLUDE [iot-hub-pii-note-naming-hub](../../includes/iot-hub-pii-note-naming-hub.md)]
7762

7863

79-
> [!NOTE]
80-
> The previous command creates an IoT hub in the S1 pricing tier for which you are billed. For more information, see [Azure IoT Hub pricing][lnk-iot-pricing].
81-
>
64+
The previous command creates an IoT hub in the S1 pricing tier for which you are billed. For more information, see [Azure IoT Hub pricing](https://azure.microsoft.com/pricing/details/iot-hub/).
8265

8366
## Remove an IoT Hub
8467

85-
You can use the Azure CLI to [delete an individual resource][lnk-az-resource-command], such as an IoT hub, or delete a resource group and all its resources, including any IoT hubs.
68+
You can use Azure CLI to [delete an individual resource](https://docs.microsoft.com/cli/azure/resource), such as an IoT hub, or delete a resource group and all its resources, including any IoT hubs.
8669

87-
To delete an IoT hub, run the following command:
70+
To [delete an IoT hub](https://docs.microsoft.com/cli/azure/iot/hub#az-iot-hub-delete), run the following command:
8871

8972
```azurecli
90-
az iot hub delete --name {your iot hub name} --resource-group {your resource group name}
73+
az iot hub delete --name {your iot hub name} -\
74+
-resource-group {your resource group name}
9175
```
9276

93-
To delete a resource group and all its resources, run the following command:
77+
To [delete a resource group](https://docs.microsoft.com/cli/azure/group#az-group-delete) and all its resources, run the following command:
9478

9579
```azurecli
9680
az group delete --name {your resource group name}
9781
```
9882

9983
## Next steps
100-
To learn more about developing for IoT Hub, see the following articles:
101-
102-
* [IoT Hub developer guide][lnk-devguide]
103-
104-
To further explore the capabilities of IoT Hub, see:
105-
106-
* [Using the Azure portal to manage IoT Hub][lnk-portal]
107-
108-
<!-- Links -->
109-
[lnk-free-trial]: https://azure.microsoft.com/pricing/free-trial/
110-
[lnk-CLI-install]: https://docs.microsoft.com/cli/azure/install-az-cli2
111-
[lnk-login-command]: https://docs.microsoft.com/cli/azure/get-started-with-az-cli2
112-
[lnk-az-account-command]: https://docs.microsoft.com/cli/azure/account
113-
[lnk-az-register-command]: https://docs.microsoft.com/cli/azure/provider
114-
[lnk-az-addcomponent-command]: https://docs.microsoft.com/cli/azure/component
115-
[lnk-az-resource-command]: https://docs.microsoft.com/cli/azure/resource
116-
[lnk-az-iot-command]: https://docs.microsoft.com/cli/azure/iot
117-
[lnk-iot-pricing]: https://azure.microsoft.com/pricing/details/iot-hub/
118-
[lnk-devguide]: iot-hub-devguide.md
119-
[lnk-portal]: iot-hub-create-through-portal.md
84+
85+
To learn more about using an IoT hub, see the following articles:
86+
87+
* [IoT Hub developer guide](iot-hub-devguide.md)
88+
* [Using the Azure portal to manage IoT Hub](iot-hub-create-through-portal.md)

0 commit comments

Comments
 (0)