You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure IoT Hub转CosmosDB:自定义终结点分区键模板遥测字段语法问题

Azure IoT 消息路由自定义终结点分区键模板语法问题

我在Azure门户配置消息路由的*Custom Endpoint(自定义终结点)*时,设置了分区键模板,期望将遥测字段my_telemetry_date中的日期值追加到{deviceid}-之后,最终得到如下格式的分区键:

{"PartitionKey" : "FFFFFFFA-2023-10-22"}

遥测数据本身包含字段{"my_telemetry_date" : "2023-10-22"},但测试多种语法后,仅{deviceid}能被正确替换,my_telemetry_date的字段值始终无法被解析替换,具体尝试情况如下:

  • 尝试语法:{deviceid}-{Body.my_telemetry_date}
    结果:

    {"PartitonKey" : "FFFFFFFA-{Body.my_telemetry_date}"}

  • 尝试语法:{deviceid}-{Body.<my_telemetry_date>}
    结果:

    {"PartitonKey" : "FFFFFFFA-{Body.<my_telemetry_date>}"}

  • 尝试语法:{deviceid}-{<my_telemetry_date>}
    结果:

    {"PartitonKey" : "FFFFFFFA-{<my_telemetry_date>}"}

  • 尝试语法:{deviceid}-<my_telemetry_date>
    结果:

    {"PartitonKey" : "FFFFFFFA-<my_telemetry_date>"}

需要找到正确的分区键模板语法,以正常提取遥测消息体中的my_telemetry_date字段值。

内容的提问来源于stack exchange,提问作者Adrian Wreyford

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 07:15:06