Reader small image

You're reading from  Azure IoT Development Cookbook

Product typeBook
Published inAug 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781787283008
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Yatish Patil
Yatish Patil
author image
Yatish Patil

Yatish Patil is currently working with Saviant Consulting as a technical project manager. He has delivered enterprise IoT and analytics applications using Microsoft Azure, ASP.NET, MVC, C#, SQL Server, and NoSQL. He has diverse industrial experience in IT and has worked in a variety of domains, such as utilities, manufacturing, and engineering. He has completed his certification in Developing Azure Solutions in the Microsoft Azure Certification. Yatish was also the technical reviewer for a Microsoft Azure-based technology book Microsoft Azure IaaS Essentials, which teaches guides Microsoft Azure subscribers how to design, configure, and build cloud-based infrastructure using Microsoft Azure. Yatish was among the industry speakers at India IoT Symposium, 2016. He delivered the industry session on remote asset monitoring with Microsoft Azure IoT Suite.
Read more about Yatish Patil

Right arrow

Creating Azure IoT Hub from PowerShell

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
Previous PageNext Page
You have been reading a chapter from
Azure IoT Development Cookbook
Published in: Aug 2017Publisher: PacktISBN-13: 9781787283008
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Yatish Patil

Yatish Patil is currently working with Saviant Consulting as a technical project manager. He has delivered enterprise IoT and analytics applications using Microsoft Azure, ASP.NET, MVC, C#, SQL Server, and NoSQL. He has diverse industrial experience in IT and has worked in a variety of domains, such as utilities, manufacturing, and engineering. He has completed his certification in Developing Azure Solutions in the Microsoft Azure Certification. Yatish was also the technical reviewer for a Microsoft Azure-based technology book Microsoft Azure IaaS Essentials, which teaches guides Microsoft Azure subscribers how to design, configure, and build cloud-based infrastructure using Microsoft Azure. Yatish was among the industry speakers at India IoT Symposium, 2016. He delivered the industry session on remote asset monitoring with Microsoft Azure IoT Suite.
Read more about Yatish Patil