New-AzureRmIotHub

Creates a new IotHub.

Syntax

New-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   -SkuName <PSIotHubSku>
   -Units <Int64>
   -Location <String>
   [-Properties <PSIotHubInputProperties>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<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:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Name of the IotHub

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

Resource Group Name

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

Name of the sku

Type:Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubSku
Parameter Sets:F1, S1, S2, S3
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Units

Number of units

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Properties

Properties of the IoT hub.

Type:Microsoft.Azure.Commands.Management.IotHub.Models.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:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubSku System.Int64 Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubInputProperties

Outputs

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