-
-
Save darrenjrobinson/33e2cbb0a36dec0477237ddb67669f86 to your computer and use it in GitHub Desktop.
Create Azure IoT Hub for Mongoose IoT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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