New-​Azure​Rm​Iot​Hub

Creates a new IotHub.

Syntax

New-AzureRmIotHub
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-SkuName] <PSIotHubSku>
   [-Units] <Int64>
   [-Location] <String>
   [-Properties <PSIotHubInputProperties>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Creates a new IotHub. You can create the IotHub with either the default properties or specify the input proerties.

Examples

Example 1 Create a new IotHub with default properties

PS C:\> New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1 -Location "northeurope"

Creates a new IotHub named "myiothub" of the sku "S1", capacity 1 and location "northeurope".

Example 2 Create a new IotHub with the MaxDeliveryCount of the CloudtoDevice Queue set to 20

PS C:\> New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1 -Location "northeurope" -Properties $properties

Creates a new IotHub named "myiothub" of the sku "S1", capacity 1 and location "northeurope" with advanced input properties represented by $properties.

$psCloudToDeviceProperties = New-Object Microsoft.Azure.Commands.Management.IotHub.Models.PSCloudToDeviceProperties -Property @{MaxDeliveryCount=20} $properties = New-Object Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubInputProperties -Property @{CloudToDevice=$psCloudToDeviceProperties} New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1 -Location "northeurope" -Properties $properties

Required Parameters

-Location

Location where the IoT hub needs to be created.

Type:String
Position:4
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Name of the IoT hub.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Name of hte resource group.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SkuName

Name of the Sku.

Type:PSIotHubSku
Parameter Sets:F1, S1, S2, S3
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Units

Number of units.

Type:Int64
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Properties

Properties of the IoT hub.

Type:PSIotHubInputProperties
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

Outputs

Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub