Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active February 1, 2018 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/33e2cbb0a36dec0477237ddb67669f86 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/33e2cbb0a36dec0477237ddb67669f86 to your computer and use it in GitHub Desktop.
Create Azure IoT Hub for Mongoose IoT
# Get the latest AzureAD/RM PSM's
Install-Module AzureRM
# Import the AuzreAD/RM PSM's
Import-Module AzureRM
# Prompt for AuthN and Login
Login-AzureRmAccount
# Get the Subscription
Get-AzureRMSubscription | Get-AzureRMSubscription -SubscriptionName $_.SubscriptionName
# Get IoT Hub Geos
$IoTHubLocations = ((Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Devices).ResourceTypes | Where-Object ResourceTypeName -eq IoTHubs).Locations
$IoTHubLocations | fl
$location = "East US"
# Create New RG
$RGName = "MyMongooseIoTHub"
$RG = New-AzureRmResourceGroup -Name $RGName -Location $location
#$RG = Get-AzureRmResourceGroup -Name $RGName
# Create IoT Hub
$IoTHubName = "MongooseIoTHub"
New-AzureRmIotHub -ResourceGroupName $RGName -Name $IoTHubName -SkuName F1 -Units 1 -Location $location
$IoTHub = Get-AzureRmIotHub -Name $IoTHubName -ResourceGroupName $RGName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment