- Azure IoT Development Cookbook
- Yatish Patil
- 241字
- 2021-07-02 20:50:32
How to do it...
Let's look at this section to create IoT Hub using PowerShell:
- Open PowerShell in administrator mode:

Start PowerShell in administrator mode
- Once the PowerShell window is ready, log in to the Azure account using the command:
'Login-AzureRmAccount'

Login to Azure account
- If you have only one Azure subscription, then you are good to go.
- If you have multiple subscriptions, first we need to select the subscription which we need to work on.
- To view a list of all the available Azure subscription for your work use the following command:
'Get-AzureRMSubscription'
- 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
- Before we create the IoT Hub, we need to create a resource group, which this IoT Hub will be a part of.
- The command to create a new resource group is the following:
New-AzureRmResourceGroup -Name MyBookIoTHub -Location "West US"

Add new resource group
- 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
- You can log in to the Azure portal and view the newly created IoT Hub:

IoT Hub list view
- To view the available IoT Hub in your account, use the command:
Get-AzureRmIotHub
- To delete an existing IoT Hub, use the following command:
Remove-AzureRmIotHub `
-ResourceGroupName MyBookIoTHub `
-Name MyBookIoTHub
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- Python數據分析入門與實戰
- 深入淺出Electron:原理、工程與實踐
- Manga Studio Ex 5 Cookbook
- Mastering phpMyAdmin 3.4 for Effective MySQL Management
- Java程序設計與計算思維
- Hadoop+Spark大數據分析實戰
- 編程數學
- UML 基礎與 Rose 建模案例(第3版)
- Java Web開發詳解
- Node.js:來一打 C++ 擴展
- Domain-Driven Design in PHP
- 大學計算機基礎
- 工業機器人離線編程
- Learning Nessus for Penetration Testing