Set-AzureRmIotHub

Updates the properties of an IotHub.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   -SkuName <PSIotHubSku>
   [-Units <Int64>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   -EventHubRetentionTimeInDays <Int64>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   [-FileUploadStorageConnectionString <String>]
   [-FileUploadContainerName <String>]
   [-FileUploadSasUriTtl <TimeSpan>]
   [-FileUploadNotificationTtl <TimeSpan>]
   [-FileUploadNotificationMaxDeliveryCount <Int32>]
   -EnableFileUploadNotifications <Boolean>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   -CloudToDevice <PSCloudToDeviceProperties>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   -OperationsMonitoringProperties <PSOperationsMonitoringProperties>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   [-RoutingProperties <PSRoutingProperties>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   [-Routes <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Management.IotHub.Models.PSRouteMetadata]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmIotHub
   -ResourceGroupName <String>
   -Name <String>
   [-FallbackRoute <PSFallbackRouteMetadata>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Updates the properties of an IotHub.

Examples

Example 1 Update the sku

PS C:\> Set-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName S1 -Units 5

Update the sku to S1 and units to 5 for the IotHub named "myiothub"

Example 2 Update the eventhub properties

PS C:\> Set-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubRetentionTimeInDays 4

Update the retention time in days to 4 for both the telemetry and operationsmonitoringevents events for the IotHub named "myiothub"

Parameters

-CloudToDevice

The properties for the cloud to device command queue.

Type:PSCloudToDeviceProperties
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableFileUploadNotifications

Flag that specifies whether notifications should be enabled for file upload.

Type:Boolean
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-EventHubRetentionTimeInDays

Retention time in days.

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

-FallbackRoute

Fallback Route for Routing

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

-FileUploadContainerName

The name of the container to upload the files to.

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

-FileUploadNotificationMaxDeliveryCount

The maximum delivery count for file upload notifications.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FileUploadNotificationTtl

Time to live value for the messages in the file upload notification queue.

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

-FileUploadSasUriTtl

Time to live for the for the SAS Uri thats generated for file upload.

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

-FileUploadStorageConnectionString

The storage connection string to upload the files to.

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

-Name

Name of the IotHub

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OperationsMonitoringProperties

The properties related to operations monitoring.

Type:PSOperationsMonitoringProperties
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Routes

Routes to be added for Routing

Type:List<T>[PSRouteMetadata]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RoutingProperties

The Routing properties for routing messages to external endpoints

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

-SkuName

Name of the Sku.

Type:PSIotHubSku
Accepted values:F1, S1, S2, S3, B1, B2, B3
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Units

Number of Units

Type:Int64
Position:Named
Default value:None
Required:False
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

PSIotHub