- 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
推薦閱讀
- Mastering Objectoriented Python
- x86匯編語言:從實模式到保護模式(第2版)
- 精通軟件性能測試與LoadRunner實戰(第2版)
- 實戰低代碼
- Mastering Python High Performance
- Building a Recommendation Engine with Scala
- Visual C#.NET程序設計
- HTML5從入門到精通 (第2版)
- Visual Basic程序設計
- Kotlin極簡教程
- C#程序設計基礎入門教程
- Java EE實用教程
- Android應用開發攻略
- INSTANT Lift Web Applications How-to
- Access 2016數據庫應用與開發:實戰從入門到精通(視頻教學版)