Add-AzIotHubRoutingEndpoint
將端點新增至IoT中樞
語法
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
在IoT中樞中新增端點。 若要了解支援的端點,請參閱 https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-endpoints
範例
範例 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
將 EventHub 類型的新端點 「E2」 新增至 「myiothub」 IoT 中樞。
範例 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
將 AzureStorageContainer 類型的新端點 “S1” 新增至 “myiothub” IoT 中樞。
參數
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ConnectionString
路由端點的連接字串
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ContainerName
記憶體容器的名稱
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Encoding
選取您要在其中路由傳送數據的格式。 您可以選取 JSON 或 AVRO。 預設值會設定為AVRO。
類型: | String |
接受的值: | JSON, AVRO |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-EndpointName
路由端點的名稱
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-EndpointResourceGroup
端點資源的資源群組
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-EndpointSubscriptionId
端點資源的 SubscriptionId
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-EndpointType
路由端點的類型
類型: | PSEndpointType |
接受的值: | EventHub, ServiceBusQueue, ServiceBusTopic, AzureStorageContainer |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-InputObject
IotHub 物件
類型: | PSIotHub |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Name
IoT 中樞的名稱
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceId
IotHub 資源標識碼
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
輸出
PSRoutingServiceBusQueueEndpoint