Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Azure IoT Development Cookbook

You're reading from  Azure IoT Development Cookbook

Product type Book
Published in Aug 2017
Publisher Packt
ISBN-13 9781787283008
Pages 254 pages
Edition 1st Edition
Languages
Author (1):
Yatish Patil Yatish Patil
Profile icon Yatish Patil

Table of Contents (10) Chapters

Preface 1. Getting Started with the Azure IoT Platform 2. Introducing Device Management 3. IoT Hub Messaging and Commands 4. Azure IoT Communication Protocols 5. Azure IoT Hub Security and Best Practices 6. IoT Suite and Pre-Configured Solutions 7. Azure IoT Analytics 8. Using Real Devices to Connect and Implement Azure IoT Hub 9. Managing the Azure IoT Hub

Creating Azure IoT Hub from the Command Prompt

In this recipe, you will need to use the Azure account where you will create the IoT Hub, apart from this, the Azure CLI should be installed on your machine.

To install Azure CLI, follow this URL: https://docs.microsoft.com/en-us/azure/cli-install-nodejs.

How to do it...

In this section, let's look at creating an IoT Hub using CLI:

  1. Open the Command Prompt within administrator mode.
  2. Use the login command in Command Prompt:
azure login
  1. It will ask you to login using a web browser with the link displayed in the Command Prompt:
Login command
  1. The web link will validate the code generated in Command Prompt:
Login authenticate through web
  1. Once you successfully log in, it will show a message on the browser and you can go back to the Command Prompt for your work:
Login validated successfully
  1. Now, select the account with which you want to work and create the IoT Hub:
azure account set “Visual Studio Enterprise”
Select Azure account
  1. Now, we need to create a resource group, which this IoT Hub will be a part of:
azure group create -n MyBookIoTHub -l westus
  1. We use the following command to create a new IoT Hub using the Command Prompt:
azure iothub create -g MyBookIoTHub -n MyBookIoTHub -l westus -k s1 -u 1

In the preceding create IoT Hub command, the parameters are resource group, IoT Hub name, location, instance size, and unit.

You have been reading a chapter from
Azure IoT Development Cookbook
Published in: Aug 2017 Publisher: Packt ISBN-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.
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}