gpt4 book ai didi

Azure Iothub 的事件中心兼容连接字符串

转载 作者:行者123 更新时间:2023-12-02 06:21:28 25 4
gpt4 key购买 nike

我正在尝试在 ARM 模板中获取与事件中心兼容的连接字符串,然后将其传递到我的 HDInsight 群集以进行进一步处理。

我正在尝试创建我选择的事件中心连接字符串,但生成的事件中心名称不相同,并且包含一个我无法跟踪其源的 guid。

我需要在模板内列出事件中心连接字符串并将其传递给 HDInsight 脚本操作。

iothub 资源中的端点部分是我自定义事件中心兼容连接字符串的位置。

"resources": [
{
"type": "Microsoft.Devices/IotHubs",
"sku": {
"name": "S1",
"tier": "Standard",
"capacity": 1
},
"name": "[variables('IotHub')]",
"apiVersion": "2016-02-03",
"location": "southeastasia",
"tags": {},
"properties": {
"ipFilterRules": [],
"eventHubEndpoints": {
"events": {
"retentionTimeInDays": 4,
"partitionCount": 4,
"partitionIds": [
"0",
"1",
"2",
"3"
],
"path": "[variables('IotHub')]",
"endpoint": "[concat('sb://', variables('IotHub'),'.servicebus.windows.net/')]"
}
},
"storageEndpoints": {
"$default": {
"sasTtlAsIso8601": "PT1H",
"connectionString": "",
"containerName": ""
}
},
"enableFileUploadNotifications": false,
"cloudToDevice": {
"maxDeliveryCount": 10,
"defaultTtlAsIso8601": "PT1H",
"feedback": {
"lockDurationAsIso8601": "PT1M",
"ttlAsIso8601": "PT1H",
"maxDeliveryCount": 10
}
},
"operationsMonitoringProperties": {
"events": {
"None": "None",
"Connections": "None",
"DeviceTelemetry": "None",
"C2DCommands": "None",
"DeviceIdentityOperations": "None",
"FileUploadOperations": "None"
}
},
"features": "None"
},
"resources": [],
"dependsOn": []
}
],

最佳答案

您无法设置 IoT 中心的事件中心兼容名称或事件中心兼容终结点的值,这些值是在创建中心时生成的。但是,您可以在 ARM 模板中访问这些值。创建 IoT 中心的模板的“输出”部分中的以下代码段说明了要使用的语法:

"outputs": {
"eventHubCompatibleEndpoint": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Devices/IoTHubs',parameters('hubName'))).eventHubEndpoints.events.endpoint]"
},
"eventHubCompatibleName": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Devices/IoTHubs',parameters('hubName'))).eventHubEndpoints.events.path]"
}
}

关于Azure Iothub 的事件中心兼容连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40218193/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com