- 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
推薦閱讀
- JavaScript前端開發模塊化教程
- LaTeX Cookbook
- FFmpeg入門詳解:音視頻流媒體播放器原理及應用
- C#程序設計教程
- 深入淺出Android Jetpack
- C語言程序設計案例式教程
- 從Java到Web程序設計教程
- MongoDB,Express,Angular,and Node.js Fundamentals
- Instant Lucene.NET
- Deep Learning with R Cookbook
- 人工智能算法(卷1):基礎算法
- 邊玩邊學Scratch3.0少兒趣味編程
- 從零開始學UI:概念解析、實戰提高、突破規則
- Implementing Microsoft Dynamics NAV(Third Edition)
- JavaEE架構與程序設計