-1

我需要通过 PowerShell 为我的 IoT Hub 创建一些自定义端点。cmdlet Add-AzIotHubRoutingEndpoint不够用,因为它不提供自定义 BatchFrequencyInSeconds 和 MaxChunkSizeInBytes 属性的可能性。

这可以以某种方式实现吗?

4

1 回答 1

0

我找到了解决方案。Set-AzIotHub 有一个参数 -RoutingProperties,通过这种方式您可以实现更大的自定义。我所做的是以下内容:

# Create an endpoint object
$customEndpoint = New-Object "Microsoft.Azure.Commands.Management.IotHub.Models.PSRoutingStorageContainerEndpoint"
# Set its contents...

# Get the routing properties from your Iot Hub
$routingProperties = $iotHub.Properties.Routing
# Add this endpoint to the specified category, mine was a storage container endpoint
$routingProperties.Endpoints.StorageContainers.Add($customEndpoint)

# Then call Set-AzIotHub
$iotHub = Set-AzIotHub `
    -ResourceGroupName $ResourceGroupName `
    -Name "$($ResourceGroupName)$($IotHubSettings.NameSuffix)" `
    -RoutingProperties $routingProperties
于 2020-07-15T09:00:17.023 回答