Redigera

Dela via


Add-AzIotHubRoutingEndpoint

Add an endpoint to your IoT Hub

Syntax

Add-AzIotHubRoutingEndpoint
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-EndpointName] <String>
   -EndpointType <PSEndpointType>
   -EndpointResourceGroup <String>
   -EndpointSubscriptionId <String>
   -ConnectionString <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIotHubRoutingEndpoint
   [-InputObject] <PSIotHub>
   [-EndpointName] <String>
   -EndpointType <PSEndpointType>
   -EndpointResourceGroup <String>
   -EndpointSubscriptionId <String>
   -ConnectionString <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIotHubRoutingEndpoint
   [-ResourceId] <String>
   [-EndpointName] <String>
   -EndpointType <PSEndpointType>
   -EndpointResourceGroup <String>
   -EndpointSubscriptionId <String>
   -ConnectionString <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Add a new endpoint in your IoT Hub. To learn about the endpoints that are supported, see https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-endpoints

Examples

Example 1

Add-AzIotHubRoutingEndpoint -ResourceGroupName "myresourcegroup" -Name "myiothub" -EndpointName E2 -EndpointType EventHub -EndpointResourceGroup resourcegroup1 -EndpointSubscriptionId 91d12343-a3de-345d-b2ea-135792468abc -ConnectionString 'Endpoint=sb://myeventhub1.servicebus.windows.net/;SharedAccessKeyName=access1;SharedAccessKey=*****=;EntityPath=event11'

ResourceGroupName : resourcegroup1
SubscriptionId    : 91d12343-a3de-345d-b2ea-135792468abc
EndpointName      : E2
ConnectionString  : Endpoint=sb://myeventhub1.servicebus.windows.net:5671/;SharedAccessKeyName=iothubroutes_myeventhub1;SharedAccessKey=****;EntityPath=event1

Add a new endpoint "E2" of type EventHub to an "myiothub" IoT Hub.

Example 2

Add-AzIotHubRoutingEndpoint -ResourceGroupName "myresourcegroup" -Name "myiothub" -EndpointName S1 -EndpointType AzureStorageContainer -EndpointResourceGroup resourcegroup1 -EndpointSubscriptionId 91d12343-a3de-345d-b2ea-135792468abc -ConnectionString 'DefaultEndpointsProtocol=https;AccountName=mystorage1;AccountKey=*****;EndpointSuffix=core.windows.net' -ContainerName container -Encoding json

ResourceGroupName       : resourcegroup1
SubscriptionId          : 91d12343-a3de-345d-b2ea-135792468abc
EndpointName            : S1
ContainerName           : container
ConnectionString        : DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=mystorage1;AccountKey=****
FileNameFormat          : {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}
BatchFrequencyInSeconds : 300
MaxChunkSizeInBytes     : 314572800
Encoding                : json

Add a new endpoint "S1" of type AzureStorageContainer to an "myiothub" IoT Hub.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-ConnectionString

Connection string of the Routing Endpoint

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

-ContainerName

Name of the storage container

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

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

-Encoding

Select the format in which you want to route your data in. You can select JSON or AVRO. The default is set to AVRO.

Type:String
Accepted values:JSON, AVRO
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndpointName

Name of the Routing Endpoint

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

-EndpointResourceGroup

Resource group of the Endpoint resource

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

-EndpointSubscriptionId

SubscriptionId of the Endpoint resource

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

-EndpointType

Type of the Routing Endpoint

Type:PSEndpointType
Accepted values:EventHub, ServiceBusQueue, ServiceBusTopic, AzureStorageContainer
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

IotHub Object

Type:PSIotHub
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Name of the Iot Hub

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

-ResourceGroupName

Name of the Resource Group

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

-ResourceId

IotHub Resource Id

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

Inputs

PSIotHub

String

Outputs

PSRoutingEventHubEndpoint

PSRoutingServiceBusQueueEndpoint

PSRoutingServiceBusTopicEndpoint

PSRoutingStorageContainerEndpoint