官术网_书友最值得收藏!

How to do it...

Let's look at this section to create IoT Hub using PowerShell:

  1. Open PowerShell in administrator mode:
Start PowerShell in administrator mode
  1. Once the PowerShell window is ready, log in to the Azure account using the command:
'Login-AzureRmAccount'
Login to Azure account
  1. If you have only one Azure subscription, then you are good to go.
  2. If you have multiple subscriptions, first we need to select the subscription which we need to work on.
  3. To view a list of all the available Azure subscription for your work use the following command:
'Get-AzureRMSubscription'
  1. Select the subscription with the command, (in my case it is Visual Studio Enterprise):
Select-AzureRMSubscription -SubscriptionName "{subscription name}"
Select the Azure account to work with
  1. Before we create the IoT Hub, we need to create a resource group, which this IoT Hub will be a part of.
  2. The command to create a new resource group is the following:
New-AzureRmResourceGroup -Name MyBookIoTHub -Location "West US"
Add new resource group
  1. We will create the IoT Hub using the following command:
New-AzureRmIotHub `
-ResourceGroupName MyBookIoTHub `
-Name MyBookIoTHub `
-SkuName S1 -Units 1 `
-Location "West US"
Azure IoT Hub created
  1. You can log in to the Azure portal and view the newly created IoT Hub:
IoT Hub list view
  1. To view the available IoT Hub in your account, use the command:
Get-AzureRmIotHub
  1. To delete an existing IoT Hub, use the following command:
Remove-AzureRmIotHub `
-ResourceGroupName MyBookIoTHub `
-Name MyBookIoTHub
主站蜘蛛池模板: 张家港市| 扶余县| 柳河县| 瓮安县| 泾阳县| 凤庆县| 安岳县| 上高县| 多伦县| 丁青县| 锡林郭勒盟| 鄂托克前旗| 鄂伦春自治旗| 海林市| 高邑县| 新津县| 嘉兴市| 清新县| 临漳县| 嘉禾县| 延边| 确山县| 天峻县| 临清市| 志丹县| 临湘市| 阿克苏市| 长汀县| 潜江市| 普兰县| 利津县| 木里| 辉县市| 都兰县| 皮山县| 遂昌县| 凌海市| 龙口市| 靖州| 晋宁县| 巢湖市|