你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Devices IotHubs

Bicep 资源定义

可以使用面向的操作部署 IotHubs 资源类型:

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Devices/IotHubs 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Devices/IotHubs@2023-06-30' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  sku: {
    capacity: int
    name: 'string'
  }
  etag: 'string'
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  properties: {
    allowedFqdnList: [
      'string'
    ]
    authorizationPolicies: [
      {
        keyName: 'string'
        primaryKey: 'string'
        rights: 'string'
        secondaryKey: 'string'
        keyName: 'string'
        primaryKey: 'string'
        rights: 'string'
        secondaryKey: 'string'
      }
    ]
    cloudToDevice: {
      defaultTtlAsIso8601: 'string'
      feedback: {
        lockDurationAsIso8601: 'string'
        maxDeliveryCount: int
        ttlAsIso8601: 'string'
      }
      maxDeliveryCount: int
    }
    comments: 'string'
    disableDeviceSAS: bool
    disableLocalAuth: bool
    disableModuleSAS: bool
    enableDataResidency: bool
    enableFileUploadNotifications: bool
    eventHubEndpoints: {
      {customized property}: {
        partitionCount: int
        retentionTimeInDays: int
      }
    }
    features: 'string'
    ipFilterRules: [
      {
        action: 'string'
        filterName: 'string'
        ipMask: 'string'
      }
    ]
    messagingEndpoints: {
      {customized property}: {
        lockDurationAsIso8601: 'string'
        maxDeliveryCount: int
        ttlAsIso8601: 'string'
      }
    }
    minTlsVersion: 'string'
    networkRuleSets: {
      applyToBuiltInEventHubEndpoint: bool
      defaultAction: 'string'
      ipRules: [
        {
          action: 'Allow'
          filterName: 'string'
          ipMask: 'string'
        }
      ]
    }
    privateEndpointConnections: [
      {
        properties: {
          privateEndpoint: {}
          privateLinkServiceConnectionState: {
            actionsRequired: 'string'
            description: 'string'
            status: 'string'
          }
        }
      }
    ]
    publicNetworkAccess: 'string'
    restrictOutboundNetworkAccess: bool
    routing: {
      endpoints: {
        cosmosDBSqlContainers: [
          {
            authenticationType: 'string'
            containerName: 'string'
            databaseName: 'string'
            endpointUri: 'string'
            identity: {
              userAssignedIdentity: 'string'
            }
            name: 'string'
            partitionKeyName: 'string'
            partitionKeyTemplate: 'string'
            primaryKey: 'string'
            resourceGroup: 'string'
            secondaryKey: 'string'
            subscriptionId: 'string'
          }
        ]
        eventHubs: [
          {
            authenticationType: 'string'
            connectionString: 'string'
            endpointUri: 'string'
            entityPath: 'string'
            id: 'string'
            identity: {
              userAssignedIdentity: 'string'
            }
            name: 'string'
            resourceGroup: 'string'
            subscriptionId: 'string'
          }
        ]
        serviceBusQueues: [
          {
            authenticationType: 'string'
            connectionString: 'string'
            endpointUri: 'string'
            entityPath: 'string'
            id: 'string'
            identity: {
              userAssignedIdentity: 'string'
            }
            name: 'string'
            resourceGroup: 'string'
            subscriptionId: 'string'
          }
        ]
        serviceBusTopics: [
          {
            authenticationType: 'string'
            connectionString: 'string'
            endpointUri: 'string'
            entityPath: 'string'
            id: 'string'
            identity: {
              userAssignedIdentity: 'string'
            }
            name: 'string'
            resourceGroup: 'string'
            subscriptionId: 'string'
          }
        ]
        storageContainers: [
          {
            authenticationType: 'string'
            batchFrequencyInSeconds: int
            connectionString: 'string'
            containerName: 'string'
            encoding: 'string'
            endpointUri: 'string'
            fileNameFormat: 'string'
            id: 'string'
            identity: {
              userAssignedIdentity: 'string'
            }
            maxChunkSizeInBytes: int
            name: 'string'
            resourceGroup: 'string'
            subscriptionId: 'string'
          }
        ]
      }
      enrichments: [
        {
          endpointNames: [
            'string'
          ]
          key: 'string'
          value: 'string'
        }
      ]
      fallbackRoute: {
        condition: 'string'
        endpointNames: [
          'string'
        ]
        isEnabled: bool
        name: 'string'
        source: 'string'
      }
      routes: [
        {
          condition: 'string'
          endpointNames: [
            'string'
          ]
          isEnabled: bool
          name: 'string'
          source: 'string'
        }
      ]
    }
    storageEndpoints: {
      {customized property}: {
        authenticationType: 'string'
        connectionString: 'string'
        containerName: 'string'
        identity: {
          userAssignedIdentity: 'string'
        }
        sasTtlAsIso8601: 'string'
      }
    }
  }
}

属性值

IotHubs

名称 说明
name 资源名称 字符串 (必需)

字符限制:3-50

有效字符:
字母数字和连字符。

不能以连字符结尾。

资源名称在 Azure 中必须是唯一的。
location 资源位置。 字符串 (必需)
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
sku IotHub SKU 信息 IotHubSkuInfo (必需)
etag Etag 字段 是必需的。 如果在响应正文中提供,则还必须根据常规 ETag 约定将其作为标头提供。 字符串
标识 IotHub 的托管标识。 ArmIdentity
properties IotHub 属性 IotHubProperties

ArmIdentity

名称 说明 Value
type 用于资源的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”将从服务中删除任何标识。 “None”
“SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
userAssignedIdentities {ArmUserIdentity} 字典 ArmIdentityUserAssignedIdentities

ArmIdentityUserAssignedIdentities

名称 说明
{customized property} ArmUserIdentity

ArmUserIdentity

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

IotHubProperties

名称 说明
allowedFqdnList 允许的 FQDN 列表 (来自 Iot 中心的出口的完全限定域名) 。 string[]
authorizationPolicies 可用于保护与 IoT 中心的连接的共享访问策略。 SharedAccessSignatureAuthorizationRule[]
cloudToDevice IoT 中心云到设备的消息传送属性。 CloudToDeviceProperties
comments IoT 中心注释。 字符串
disableDeviceSAS 如果为 true,则所有设备 (包括 Edge 设备,但不包括) 作用域 SAS 密钥的模块,都不能用于身份验证。 bool
disableLocalAuth 如果为 true,则无法使用具有 Iot 中心范围的 SAS 密钥的 SAS 令牌进行身份验证。 bool
disableModuleSAS 如果为 true,则不能使用所有模块范围的 SAS 密钥进行身份验证。 bool
enableDataResidency 当设置为 true 时,此属性将启用数据驻留,从而禁用灾难恢复。 bool
enableFileUploadNotifications 如果为 True,则启用文件上传通知。 bool
eventHubEndpoints 与事件中心兼容的终结点属性。 此字典的唯一可能的键是事件。 在对 IoT 中心进行创建或更新调用时,此密钥必须存在于字典中。 IotHubPropertiesEventHubEndpoints
features 为 IoT 中心启用的功能和功能。 “DeviceManagement”
“None”
ipFilterRules IP 筛选器规则。 IpFilterRule[]
messagingEndpoints 文件上传通知队列的消息传送终结点属性。 IotHubPropertiesMessagingEndpoints
minTlsVersion 指定要对此中心支持的最低 TLS 版本。 可以设置为“1.2”,以拒绝使用低于 1.2 的 TLS 版本的客户端。 字符串
networkRuleSets IotHub 的网络规则集属性 NetworkRuleSetProperties
专用终结点 在此 IotHub 上创建的专用终结点连接 PrivateEndpointConnection[]
publicNetworkAccess 是否允许来自公用网络的请求 “Disabled”
“已启用”
restrictOutboundNetworkAccess 如果为 true,则来自 IotHub 的出口将限制为仅允许通过 allowedFqdnList 配置的 FQDN。 bool
路由 IoT 中心的路由相关属性。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging RoutingProperties
storageEndpoints 可在其中上传文件的 Azure 存储终结点列表。 目前只能配置一个 Azure 存储帐户,并且该帐户必须将其密钥作为$default。 指定多个存储帐户会导致引发错误。 当 enableFileUploadNotifications 属性设置为 True 时,不指定此属性的值会导致引发错误。 IotHubPropertiesStorageEndpoints

SharedAccessSignatureAuthorizationRule

名称 说明
keyName 共享访问策略的名称。 字符串 (必需)
primaryKey 主键。 字符串
权限 分配给共享访问策略的权限。 “DeviceConnect”
“RegistryRead”
“RegistryRead,DeviceConnect”
“RegistryRead,RegistryWrite”
“RegistryRead,RegistryWrite,DeviceConnect”
“RegistryRead, RegistryWrite, ServiceConnect”
“RegistryRead,RegistryWrite,ServiceConnect,DeviceConnect”
“RegistryRead, ServiceConnect”
“RegistryRead,ServiceConnect,DeviceConnect”
“RegistryWrite”
“RegistryWrite,DeviceConnect”
“RegistryWrite,ServiceConnect”
“RegistryWrite、ServiceConnect、DeviceConnect”
“ServiceConnect”
“ServiceConnect,DeviceConnect” (必需)
secondaryKey 辅助密钥。 字符串
keyName 共享访问策略的名称。 字符串 (必需)
primaryKey 主键。 字符串
权限 分配给共享访问策略的权限。 “DeviceConnect”
“RegistryRead”
“RegistryRead,DeviceConnect”
“RegistryRead,RegistryWrite”
“RegistryRead,RegistryWrite,DeviceConnect”
“RegistryRead, RegistryWrite, ServiceConnect”
“RegistryRead,RegistryWrite,ServiceConnect,DeviceConnect”
“RegistryRead, ServiceConnect”
“RegistryRead,ServiceConnect,DeviceConnect”
“RegistryWrite”
“RegistryWrite,DeviceConnect”
“RegistryWrite,ServiceConnect”
“RegistryWrite、ServiceConnect、DeviceConnect”
“ServiceConnect”
“ServiceConnect,DeviceConnect” (必需)
secondaryKey 辅助密钥。 字符串

CloudToDeviceProperties

名称 说明
defaultTtlAsIso8601 设备队列中云到设备消息的默认生存时间。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串
反馈 云到设备消息的反馈队列的属性。 FeedbackProperties
maxDeliveryCount 设备队列中云到设备消息的最大传递计数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 int

约束:
最小值 = 1
最大值 = 100

FeedbackProperties

名称 说明
lockDurationAsIso8601 反馈队列的锁定持续时间。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串
maxDeliveryCount IoT 中心尝试在反馈队列上传递消息的次数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 int

约束:
最小值 = 1
最大值 = 100
ttlAsIso8601 消息在 IoT 中心过期之前可以使用的时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串

IotHubPropertiesEventHubEndpoints

名称 说明
{customized property} EventHubProperties

EventHubProperties

名称 说明
partitionCount 在事件中心兼容的终结点中接收设备到云消息的分区数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages。 int
retentionTimeInDays 设备到云消息的保留时间(以天为单位)。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages int

IpFilterRule

名称 说明
action 此规则捕获的请求的所需操作。 “Accept”
“拒绝” (必需)
filterName IP 筛选器规则的名称。 字符串 (必需)
ipMask 包含规则的 CIDR 表示法中的 IP 地址范围的字符串。 字符串 (必需)

IotHubPropertiesMessagingEndpoints

名称 说明
{customized property} MessagingEndpointProperties

MessagingEndpointProperties

名称 说明
lockDurationAsIso8601 锁定持续时间。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 字符串
maxDeliveryCount IoT 中心尝试传递消息的次数。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 int

约束:
最小值 = 1
最大值 = 100
ttlAsIso8601 消息在 IoT 中心过期之前可以使用的时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 字符串

NetworkRuleSetProperties

名称 说明
applyToBuiltInEventHubEndpoint 如果为 True,则网络规则集也会应用于 IotHub 的 BuiltIn EventHub 终结点 需要 bool ()
defaultAction 网络规则集的默认操作 “允许”
“拒绝”
ipRules IP 规则列表 NetworkRuleSetIpRule[] (必需)

NetworkRuleSetIpRule

名称 说明
action IP 筛选器操作 “允许”
filterName IP 筛选器规则的名称。 字符串 (必需)
ipMask 一个字符串,其中包含规则的 CIDR 表示法中的 IP 地址范围。 字符串 (必需)

PrivateEndpointConnection

名称 说明
properties 专用终结点连接的属性 PrivateEndpointConnectionProperties (必需)

PrivateEndpointConnectionProperties

名称 说明
privateEndpoint 专用终结点连接的专用终结点属性 PrivateEndpoint
privateLinkServiceConnectionState 专用终结点连接的当前状态 PrivateLinkServiceConnectionState (必需)

PrivateEndpoint

此对象不包含部署期间要设置的任何属性。 所有属性均为 ReadOnly。

PrivateLinkServiceConnectionState

名称 说明
actionsRequired 专用终结点连接所需的操作 字符串
description 专用终结点连接的当前状态的说明 字符串 (必需)
status 专用终结点连接的状态 “已批准”
“Disconnected”
'Pending'
“已拒绝” (必需)

RoutingProperties

名称 说明
端点 与 IoT 中心基于路由规则将消息路由到的自定义终结点相关的属性。 付费中心的所有终结点类型中最多允许 10 个自定义终结点,免费中心的所有终结点类型中只允许 1 个自定义终结点。 RoutingEndpoints
扩充 IoT 中心应用于要传递到内置终结点和自定义终结点的消息的用户提供的扩充列表。 请参阅:https://aka.ms/telemetryoneventgrid EnrichmentProperties[]
fallbackRoute 当未满足“routes”节中指定的任何条件时,用作回退路由的路由的属性。 这是一个可选参数。 如果模板中不存在此属性,则默认禁用回退路由。 FallbackRouteProperties
routes IoT 中心用于将消息路由到内置终结点和自定义终结点的用户提供的路由规则列表。 付费中心最多允许 100 个路由规则,免费中心最多允许 5 个路由规则。 RouteProperties[]

RoutingEndpoints

名称 说明
cosmosDBSqlContainers IoT 中心根据路由规则将消息路由到的 Cosmos DB 容器终结点的列表。 RoutingCosmosDBSqlApiProperties[]
eventHubs IoT 中心根据路由规则将消息路由到的事件中心终结点列表。 此列表不包括内置事件中心终结点。 RoutingEventHubProperties[]
serviceBusQueues IoT 中心根据路由规则将消息路由到的服务总线队列终结点的列表。 RoutingServiceBusQueueEndpointProperties[]
serviceBusTopics IoT 中心根据路由规则将消息路由到的服务总线主题终结点的列表。 RoutingServiceBusTopicEndpointProperties[]
storageContainers IoT 中心根据路由规则将消息路由到的存储容器终结点的列表。 RoutingStorageContainerProperties[]

RoutingCosmosDBSqlApiProperties

名称 说明
authenticationType 用于对 cosmos DB sql 容器终结点进行身份验证的方法 “identityBased”
“keyBased”
containerName cosmos DB 数据库中 cosmos DB sql 容器的名称。 字符串 (必需)
databaseName cosmos DB 帐户中 cosmos DB 数据库的名称。 字符串 (必需)
endpointUri cosmos DB 帐户的 URL。 它必须包含协议 https:// 字符串 (必需)
标识 路由 cosmos DB 容器终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
partitionKeyName 与此 cosmos DB sql 容器关联的分区键的名称(如果存在)。 这是一个可选参数。 字符串
partitionKeyTemplate 用于生成用于此 cosmos DB sql 容器的合成分区键值的模板。 该模板必须至少包含以下占位符之一:{iothub}、{deviceid}、{DD}、{MM}和 {YYYY}。 最多可以指定一个占位符一次,但顺序和非占位符组件是任意的。 仅当指定 PartitionKeyName 时,此参数才是必需的。 字符串
primaryKey cosmos DB 帐户的主键。 字符串

约束:
敏感值。 作为安全参数传入。
resourceGroup cosmos DB 帐户的资源组的名称。 字符串
secondaryKey cosmos DB 帐户的辅助密钥。 字符串

约束:
敏感值。 作为安全参数传入。
subscriptionId cosmos DB 帐户的订阅标识符。 字符串

ManagedIdentity

名称 说明
userAssignedIdentity 用户分配的标识。 字符串

RoutingEventHubProperties

名称 说明
authenticationType 用于针对事件中心终结点进行身份验证的方法 “identityBased”
“keyBased”
connectionString 事件中心终结点的连接字符串。 字符串
endpointUri 事件中心终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 事件中心命名空间上的事件中心名称 string
id 事件中心终结点的 ID 字符串
标识 路由事件中心终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 事件中心终结点的资源组的名称。 字符串
subscriptionId 事件中心终结点的订阅标识符。 字符串

RoutingServiceBusQueueEndpointProperties

名称 说明
authenticationType 用于针对服务总线队列终结点进行身份验证的方法 “identityBased”
“keyBased”
connectionString 服务总线队列终结点的连接字符串。 字符串
endpointUri 服务总线队列终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 服务总线命名空间上的队列名称 string
id 服务总线队列终结点的 ID 字符串
标识 路由服务总线队列终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 名称不必与实际队列名称相同。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 服务总线队列终结点的资源组的名称。 字符串
subscriptionId 服务总线队列终结点的订阅标识符。 字符串

RoutingServiceBusTopicEndpointProperties

名称 说明
authenticationType 用于针对服务总线主题终结点进行身份验证的方法 “identityBased”
“keyBased”
connectionString 服务总线主题终结点的连接字符串。 字符串
endpointUri 服务总线主题终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 服务总线主题上的队列名称 string
id 服务总线主题终结点的 ID 字符串
标识 路由服务总线主题终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 名称不必与实际主题名称相同。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 服务总线主题终结点的资源组的名称。 字符串
subscriptionId 服务总线主题终结点的订阅标识符。 字符串

RoutingStorageContainerProperties

名称 说明
authenticationType 用于对存储终结点进行身份验证的方法 “identityBased”
“keyBased”
batchFrequencyInSeconds Blob 写入存储的时间间隔。 值应介于 60 到 720 秒之间。 默认值为 300 秒。 int

约束:
最小值 = 60
最大值 = 720
connectionString 存储帐户的连接字符串。 字符串
containerName 存储帐户中存储容器的名称。 字符串 (必需)
encoding 用于将消息序列化为 Blob 的编码。 支持的值是“avro”、“avrodeflate”和“JSON”。 默认值为“avro”。 “Avro”
“AvroDeflate”
“JSON”
endpointUri 存储终结点的 URL。 它必须包含协议 https:// 字符串
fileNameFormat Blob 的文件名格式。 默认格式为 {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}。 所有参数都是必需的,但可以重新排序。 string
id 存储容器终结点的 ID 字符串
标识 路由存储终结点的托管标识属性。 ManagedIdentity
maxChunkSizeInBytes 写入存储的每个 Blob 的最大字节数。 值应介于 10485760 (10MB) 到 524288000 (500MB) 之间。 默认值为 314572800 (300MB) 。 int

约束:
最小值 = 10485760
最大值 = 524288000
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 存储帐户的资源组的名称。 字符串
subscriptionId 存储帐户的订阅标识符。 字符串

EnrichmentProperties

名称 说明
endpointNames 对其应用扩充的终结点列表。消息的扩充。 string[] (必需的)

约束:
最小长度 = 1
key 扩充属性的键或名称。 字符串 (必需)
value 扩充属性的值。 字符串 (必需)

FallbackRouteProperties

名称 说明
condition 为应用回退路由而计算的条件。 如果未提供条件,则默认情况下其计算结果为 true。 有关语法,请参阅:/azure/iot-hub/iot-hub-devguide-query-language 字符串
endpointNames 满足条件的消息将路由到的终结点列表。 目前仅允许 1 个终结点。 string[] (必需的)

约束:
最小长度 = 1
最大长度 = 1
isEnabled 用于指定是否启用回退路由。 bool (必需)
name 路由的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符,并且必须是唯一的。 string
source 要向其应用路由规则的源。 例如,DeviceMessages “DeviceConnectionStateEvents”
“DeviceJobLifecycleEvents”
“DeviceLifecycleEvents”
“DeviceMessages”
“无效”
“TwinChangeEvents” (必需)

RouteProperties

名称 说明
condition 评估以应用路由规则的条件。 如果未提供任何条件,则默认情况下其计算结果为 true。 有关语法,请参阅:/azure/iot-hub/iot-hub-devguide-query-language 字符串
endpointNames 满足条件的消息将路由到的终结点列表。 目前只允许使用一个终结点。 string[] (必需的)

约束:
最小长度 = 1
最大长度 = 1
isEnabled 用于指定是否启用路由。 bool (必需)
name 路由的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符,并且必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
source 要应用路由规则的源,例如 DeviceMessages。 “DeviceConnectionStateEvents”
“DeviceJobLifecycleEvents”
“DeviceLifecycleEvents”
“DeviceMessages”
“无效”
“TwinChangeEvents” (必需)

IotHubPropertiesStorageEndpoints

名称 说明
{customized property} StorageEndpointProperties

StorageEndpointProperties

名称 说明
authenticationType 指定用于连接到存储帐户的身份验证类型。 “identityBased”
“keyBased”
connectionString 文件上传到的 Azure 存储帐户的连接字符串。 字符串 (必需)
containerName 在其中上传文件的根容器的名称。 容器不需要存在,但应可使用指定的 connectionString 进行创建。 字符串 (必需)
标识 用于文件上传的存储终结点的托管标识属性。 ManagedIdentity
sasTtlAsIso8601 IoT 中心生成的用于文件上传的 SAS URI 的有效时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-upload-notification-configuration-options。 字符串

IotHubSkuInfo

名称 说明
容量 预配的IoT 中心单位数。 请参阅:/azure/azure-subscription-service-limits#iot-hub-limits。 int
name SKU 的名称。 “B1”
“B2”
“B3”
“F1”
“S1”
“S2”
“S3” (必需)

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
创建 IOT 中心和 Ubuntu 边缘模拟器

部署到 Azure
此模板创建 IOT 中心和虚拟机 Ubuntu 边缘模拟器。
使用 ARM 模板创建IoT 中心、路由和查看消息

部署到 Azure
使用此模板部署IoT 中心和存储帐户。 运行应用以将消息发送到已路由到存储的中心,然后查看结果。
创建IoT 中心设备预配服务

部署到 Azure
使用此模板可以创建 IoT 中心和IoT 中心设备预配服务,并将这两个服务链接在一起。
创建IoT 中心和设备到云使用者组

部署到 Azure
通过此模板,可以部署具有设备到云和云到设备消息传送配置以及设备到云使用者组的IoT 中心实例。
为IoT 中心帐户、实例IoT 中心创建设备更新

部署到 Azure
此模板创建一个帐户,以及一个实例和一个用于链接实例的中心。 它使用必要的访问策略、路由和使用者组配置中心。
部署 MedTech 服务,包括Azure IoT 中心

部署到 Azure
MedTech 服务是 Azure Health Data Services 之一,旨在从多个设备引入设备数据,将设备数据转换为 FHIR 观察值,然后保留在 Azure Health Data Services FHIR 服务中。
使用 IoT 中心 (PAYG) 环境创建即用即付

部署到 Azure
使用此模板,可以部署一个即用即付 (PAYG) 时序见解环境,该环境配置为使用IoT 中心中的事件。

ARM 模板资源定义

可以使用面向的操作部署 IotHubs 资源类型:

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Devices/IotHubs 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Devices/IotHubs",
  "apiVersion": "2023-06-30",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "sku": {
    "capacity": "int",
    "name": "string"
  },
  "etag": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {}
    }
  },
  "properties": {
    "allowedFqdnList": [ "string" ],
    "authorizationPolicies": [
      {
        "keyName": "string",
        "primaryKey": "string",
        "rights": "string",
        "secondaryKey": "string",
        "keyName": "string",
        "primaryKey": "string",
        "rights": "string",
        "secondaryKey": "string"
      }
    ],
    "cloudToDevice": {
      "defaultTtlAsIso8601": "string",
      "feedback": {
        "lockDurationAsIso8601": "string",
        "maxDeliveryCount": "int",
        "ttlAsIso8601": "string"
      },
      "maxDeliveryCount": "int"
    },
    "comments": "string",
    "disableDeviceSAS": "bool",
    "disableLocalAuth": "bool",
    "disableModuleSAS": "bool",
    "enableDataResidency": "bool",
    "enableFileUploadNotifications": "bool",
    "eventHubEndpoints": {
      "{customized property}": {
        "partitionCount": "int",
        "retentionTimeInDays": "int"
      }
    },
    "features": "string",
    "ipFilterRules": [
      {
        "action": "string",
        "filterName": "string",
        "ipMask": "string"
      }
    ],
    "messagingEndpoints": {
      "{customized property}": {
        "lockDurationAsIso8601": "string",
        "maxDeliveryCount": "int",
        "ttlAsIso8601": "string"
      }
    },
    "minTlsVersion": "string",
    "networkRuleSets": {
      "applyToBuiltInEventHubEndpoint": "bool",
      "defaultAction": "string",
      "ipRules": [
        {
          "action": "Allow",
          "filterName": "string",
          "ipMask": "string"
        }
      ]
    },
    "privateEndpointConnections": [
      {
        "properties": {
          "privateEndpoint": {},
          "privateLinkServiceConnectionState": {
            "actionsRequired": "string",
            "description": "string",
            "status": "string"
          }
        }
      }
    ],
    "publicNetworkAccess": "string",
    "restrictOutboundNetworkAccess": "bool",
    "routing": {
      "endpoints": {
        "cosmosDBSqlContainers": [
          {
            "authenticationType": "string",
            "containerName": "string",
            "databaseName": "string",
            "endpointUri": "string",
            "identity": {
              "userAssignedIdentity": "string"
            },
            "name": "string",
            "partitionKeyName": "string",
            "partitionKeyTemplate": "string",
            "primaryKey": "string",
            "resourceGroup": "string",
            "secondaryKey": "string",
            "subscriptionId": "string"
          }
        ],
        "eventHubs": [
          {
            "authenticationType": "string",
            "connectionString": "string",
            "endpointUri": "string",
            "entityPath": "string",
            "id": "string",
            "identity": {
              "userAssignedIdentity": "string"
            },
            "name": "string",
            "resourceGroup": "string",
            "subscriptionId": "string"
          }
        ],
        "serviceBusQueues": [
          {
            "authenticationType": "string",
            "connectionString": "string",
            "endpointUri": "string",
            "entityPath": "string",
            "id": "string",
            "identity": {
              "userAssignedIdentity": "string"
            },
            "name": "string",
            "resourceGroup": "string",
            "subscriptionId": "string"
          }
        ],
        "serviceBusTopics": [
          {
            "authenticationType": "string",
            "connectionString": "string",
            "endpointUri": "string",
            "entityPath": "string",
            "id": "string",
            "identity": {
              "userAssignedIdentity": "string"
            },
            "name": "string",
            "resourceGroup": "string",
            "subscriptionId": "string"
          }
        ],
        "storageContainers": [
          {
            "authenticationType": "string",
            "batchFrequencyInSeconds": "int",
            "connectionString": "string",
            "containerName": "string",
            "encoding": "string",
            "endpointUri": "string",
            "fileNameFormat": "string",
            "id": "string",
            "identity": {
              "userAssignedIdentity": "string"
            },
            "maxChunkSizeInBytes": "int",
            "name": "string",
            "resourceGroup": "string",
            "subscriptionId": "string"
          }
        ]
      },
      "enrichments": [
        {
          "endpointNames": [ "string" ],
          "key": "string",
          "value": "string"
        }
      ],
      "fallbackRoute": {
        "condition": "string",
        "endpointNames": [ "string" ],
        "isEnabled": "bool",
        "name": "string",
        "source": "string"
      },
      "routes": [
        {
          "condition": "string",
          "endpointNames": [ "string" ],
          "isEnabled": "bool",
          "name": "string",
          "source": "string"
        }
      ]
    },
    "storageEndpoints": {
      "{customized property}": {
        "authenticationType": "string",
        "connectionString": "string",
        "containerName": "string",
        "identity": {
          "userAssignedIdentity": "string"
        },
        "sasTtlAsIso8601": "string"
      }
    }
  }
}

属性值

IotHubs

名称 说明 Value
type 资源类型 “Microsoft.Devices/IotHubs”
apiVersion 资源 API 版本 '2023-06-30'
name 资源名称 字符串 (必需)

字符限制:3-50

有效字符:
字母数字和连字符。

不能以连字符结尾。

资源名称在 Azure 中必须是唯一的。
location 资源位置。 字符串 (必需)
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
sku IotHub SKU 信息 IotHubSkuInfo (必需)
etag Etag 字段 是必需的。 如果在响应正文中提供,则还必须根据常规 ETag 约定将其作为标头提供。 字符串
标识 IotHub 的托管标识。 ArmIdentity
properties IotHub 属性 IotHubProperties

ArmIdentity

名称 说明 Value
type 用于资源的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”将从服务中删除任何标识。 “None”
“SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
userAssignedIdentities {ArmUserIdentity} 字典 ArmIdentityUserAssignedIdentities

ArmIdentityUserAssignedIdentities

名称 说明
{customized property} ArmUserIdentity

ArmUserIdentity

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

IotHubProperties

名称 说明
allowedFqdnList 允许的 FQDN 列表 (来自 Iot 中心的出口的完全限定域名) 。 string[]
authorizationPolicies 可用于保护与 IoT 中心的连接的共享访问策略。 SharedAccessSignatureAuthorizationRule[]
cloudToDevice IoT 中心云到设备的消息传送属性。 CloudToDeviceProperties
comments IoT 中心注释。 字符串
disableDeviceSAS 如果为 true,则所有设备 (包括 Edge 设备,但不包括) 作用域 SAS 密钥的模块,都不能用于身份验证。 bool
disableLocalAuth 如果为 true,则无法使用具有 Iot 中心范围的 SAS 密钥的 SAS 令牌进行身份验证。 bool
disableModuleSAS 如果为 true,则不能使用所有模块范围的 SAS 密钥进行身份验证。 bool
enableDataResidency 当设置为 true 时,此属性将启用数据驻留,从而禁用灾难恢复。 bool
enableFileUploadNotifications 如果为 True,则启用文件上传通知。 bool
eventHubEndpoints 与事件中心兼容的终结点属性。 此字典的唯一可能的键是事件。 在对 IoT 中心进行创建或更新调用时,此密钥必须存在于字典中。 IotHubPropertiesEventHubEndpoints
features 为 IoT 中心启用的功能和功能。 “DeviceManagement”
“None”
ipFilterRules IP 筛选器规则。 IpFilterRule[]
messagingEndpoints 文件上传通知队列的消息传送终结点属性。 IotHubPropertiesMessagingEndpoints
minTlsVersion 指定要对此中心支持的最低 TLS 版本。 可以设置为“1.2”,以拒绝使用低于 1.2 的 TLS 版本的客户端。 字符串
networkRuleSets IotHub 的网络规则集属性 NetworkRuleSetProperties
专用终结点 在此 IotHub 上创建的专用终结点连接 PrivateEndpointConnection[]
publicNetworkAccess 是否允许来自公用网络的请求 “Disabled”
“已启用”
restrictOutboundNetworkAccess 如果为 true,则来自 IotHub 的出口将限制为仅允许通过 allowedFqdnList 配置的 FQDN。 bool
路由 IoT 中心的路由相关属性。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging RoutingProperties
storageEndpoints 可在其中上传文件的 Azure 存储终结点列表。 目前只能配置一个 Azure 存储帐户,并且该帐户必须将其密钥作为$default。 指定多个存储帐户会导致引发错误。 当 enableFileUploadNotifications 属性设置为 True 时,不指定此属性的值会导致引发错误。 IotHubPropertiesStorageEndpoints

SharedAccessSignatureAuthorizationRule

名称 说明
keyName 共享访问策略的名称。 字符串 (必需)
primaryKey 主键。 字符串
权限 分配给共享访问策略的权限。 “DeviceConnect”
“RegistryRead”
“RegistryRead,DeviceConnect”
“RegistryRead,RegistryWrite”
“RegistryRead,RegistryWrite,DeviceConnect”
“RegistryRead, RegistryWrite, ServiceConnect”
“RegistryRead,RegistryWrite,ServiceConnect,DeviceConnect”
“RegistryRead, ServiceConnect”
“RegistryRead,ServiceConnect,DeviceConnect”
“RegistryWrite”
“RegistryWrite,DeviceConnect”
“RegistryWrite,ServiceConnect”
“RegistryWrite、ServiceConnect、DeviceConnect”
“ServiceConnect”
“ServiceConnect,DeviceConnect” (必需)
secondaryKey 辅助密钥。 字符串
keyName 共享访问策略的名称。 字符串 (必需)
primaryKey 主键。 字符串
权限 分配给共享访问策略的权限。 “DeviceConnect”
“RegistryRead”
“RegistryRead,DeviceConnect”
“RegistryRead,RegistryWrite”
“RegistryRead,RegistryWrite,DeviceConnect”
“RegistryRead, RegistryWrite, ServiceConnect”
“RegistryRead,RegistryWrite,ServiceConnect,DeviceConnect”
“RegistryRead, ServiceConnect”
“RegistryRead,ServiceConnect,DeviceConnect”
“RegistryWrite”
“RegistryWrite,DeviceConnect”
“RegistryWrite,ServiceConnect”
“RegistryWrite、ServiceConnect、DeviceConnect”
“ServiceConnect”
“ServiceConnect,DeviceConnect” (必需)
secondaryKey 辅助密钥。 字符串

CloudToDeviceProperties

名称 说明
defaultTtlAsIso8601 设备队列中云到设备消息的默认生存时间。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串
反馈 云到设备消息的反馈队列的属性。 FeedbackProperties
maxDeliveryCount 设备队列中云到设备消息的最大传递计数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 int

约束:
最小值 = 1
最大值 = 100

FeedbackProperties

名称 说明
lockDurationAsIso8601 反馈队列的锁定持续时间。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串
maxDeliveryCount IoT 中心尝试在反馈队列中传递消息的次数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 int

约束:
最小值 = 1
最大值 = 100
ttlAsIso8601 消息在 IoT 中心过期之前可以使用的时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串

IotHubPropertiesEventHubEndpoints

名称 说明
{customized property} EventHubProperties

EventHubProperties

名称 说明
partitionCount 用于在与事件中心兼容的终结点中接收设备到云消息的分区数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages。 int
retentionTimeInDays 设备到云消息的保留时间(以天为单位)。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages int

IpFilterRule

名称 说明
action 此规则捕获的请求的所需操作。 'Accept'
需要“拒绝” ()
filterName IP 筛选器规则的名称。 字符串 (必需)
ipMask 一个字符串,其中包含规则的 CIDR 表示法中的 IP 地址范围。 字符串 (必需)

IotHubPropertiesMessagingEndpoints

名称 说明
{customized property} MessagingEndpointProperties

MessagingEndpointProperties

名称 说明
lockDurationAsIso8601 锁定持续时间。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 字符串
maxDeliveryCount IoT 中心尝试传递消息的次数。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 int

约束:
最小值 = 1
最大值 = 100
ttlAsIso8601 消息在 IoT 中心过期之前可以使用的时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 字符串

NetworkRuleSetProperties

名称 说明
applyToBuiltInEventHubEndpoint 如果为 True,则网络规则集也应用于 IotHub 的 BuiltIn EventHub EndPoint bool (必需)
defaultAction 网络规则集的默认操作 “允许”
“拒绝”
ipRules IP 规则列表 NetworkRuleSetIpRule[] (必需的)

NetworkRuleSetIpRule

名称 说明
action IP 筛选器操作 “允许”
filterName IP 筛选器规则的名称。 字符串 (必需)
ipMask 包含规则的 CIDR 表示法中的 IP 地址范围的字符串。 字符串 (必需)

PrivateEndpointConnection

名称 说明
properties 专用终结点连接的属性 PrivateEndpointConnectionProperties (必需)

PrivateEndpointConnectionProperties

名称 说明
privateEndpoint 专用终结点连接的专用终结点属性 PrivateEndpoint
privateLinkServiceConnectionState 专用终结点连接的当前状态 PrivateLinkServiceConnectionState (必需)

PrivateEndpoint

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

PrivateLinkServiceConnectionState

名称 说明
actionsRequired 专用终结点连接所需的操作 字符串
description 专用终结点连接的当前状态的说明 字符串 (必需)
status 专用终结点连接的状态 “已批准”
“Disconnected”
“挂起”
“已拒绝” (必需)

RoutingProperties

名称 说明
端点 与 IoT 中心根据路由规则将消息路由到的自定义终结点相关的属性。 对于付费中心,所有终结点类型最多允许 10 个自定义终结点,免费中心的所有终结点类型中只允许 1 个自定义终结点。 RoutingEndpoints
扩充 IoT 中心应用于要传递到内置终结点和自定义终结点的消息的用户提供的扩充列表。 请参阅:https://aka.ms/telemetryoneventgrid EnrichmentProperties[]
fallbackRoute 当未满足“路由”部分中指定的条件时用作回退路由的路由的属性。 这是一个可选参数。 如果模板中不存在此属性,则默认禁用回退路由。 FallbackRouteProperties
routes IoT 中心用于将消息路由到内置终结点和自定义终结点的用户提供的路由规则列表。 付费中心最多允许 100 条路由规则,免费中心最多允许 5 条路由规则。 RouteProperties[]

RoutingEndpoints

名称 说明
cosmosDBSqlContainers IoT 中心根据路由规则将消息路由到的 Cosmos DB 容器终结点的列表。 RoutingCosmosDBSqlApiProperties[]
eventHubs IoT 中心根据路由规则将消息路由到的事件中心终结点列表。 此列表不包括内置的事件中心终结点。 RoutingEventHubProperties[]
serviceBusQueues IoT 中心根据路由规则将消息路由到的服务总线队列终结点的列表。 RoutingServiceBusQueueEndpointProperties[]
serviceBusTopics IoT 中心根据路由规则将消息路由到的服务总线主题终结点的列表。 RoutingServiceBusTopicEndpointProperties[]
storageContainers IoT 中心根据路由规则将消息路由到的存储容器终结点的列表。 RoutingStorageContainerProperties[]

RoutingCosmosDBSqlApiProperties

名称 说明
authenticationType 用于对 cosmos DB sql 容器终结点进行身份验证的方法 “identityBased”
'keyBased'
containerName cosmos DB 数据库中 cosmos DB sql 容器的名称。 字符串 (必需)
databaseName cosmos DB 帐户中 cosmos DB 数据库的名称。 字符串 (必需)
endpointUri cosmos DB 帐户的 URL。 它必须包含协议 https:// 字符串 (必需)
标识 路由 cosmos DB 容器终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
模式 = ^[A-Za-z0-9-._]{1,64}$
partitionKeyName 与此 cosmos DB sql 容器关联的分区键的名称(如果存在)。 这是一个可选参数。 字符串
partitionKeyTemplate 用于生成用于此 cosmos DB sql 容器的合成分区键值的模板。 模板必须至少包含以下占位符之一:{iothub}、{deviceid}、{DD}、{MM}和 {YYYY}。 任何一个占位符最多可以指定一次,但顺序和非占位符组件是任意的。 仅当指定 PartitionKeyName 时,才需要此参数。 字符串
primaryKey cosmos DB 帐户的主键。 字符串

约束:
敏感值。 作为安全参数传入。
resourceGroup cosmos DB 帐户的资源组的名称。 字符串
secondaryKey cosmos DB 帐户的辅助密钥。 字符串

约束:
敏感值。 作为安全参数传入。
subscriptionId cosmos DB 帐户的订阅标识符。 字符串

ManagedIdentity

名称 说明
userAssignedIdentity 用户分配的标识。 字符串

RoutingEventHubProperties

名称 说明
authenticationType 用于对事件中心终结点进行身份验证的方法 “identityBased”
'keyBased'
connectionString 事件中心终结点的连接字符串。 字符串
endpointUri 事件中心终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 事件中心命名空间上的事件中心名称 string
id 事件中心终结点的 ID 字符串
标识 路由事件中心终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
模式 = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 事件中心终结点的资源组的名称。 字符串
subscriptionId 事件中心终结点的订阅标识符。 字符串

RoutingServiceBusQueueEndpointProperties

名称 说明
authenticationType 用于对服务总线队列终结点进行身份验证的方法 “identityBased”
'keyBased'
connectionString 服务总线队列终结点的连接字符串。 字符串
endpointUri 服务总线队列终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 服务总线命名空间上的队列名称 string
id 服务总线队列终结点的 ID 字符串
标识 路由服务总线队列终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 该名称不必与实际队列名称相同。 字符串 (必需)

约束:
模式 = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 服务总线队列终结点的资源组的名称。 字符串
subscriptionId 服务总线队列终结点的订阅标识符。 字符串

RoutingServiceBusTopicEndpointProperties

名称 说明
authenticationType 用于对服务总线主题终结点进行身份验证的方法 “identityBased”
'keyBased'
connectionString 服务总线主题终结点的连接字符串。 字符串
endpointUri 服务总线主题终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 服务总线主题上的队列名称 string
id 服务总线主题终结点的 ID 字符串
标识 路由服务总线主题终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 名称不必与实际主题名称相同。 字符串 (必需)

约束:
模式 = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 服务总线主题终结点的资源组的名称。 字符串
subscriptionId 服务总线主题终结点的订阅标识符。 字符串

RoutingStorageContainerProperties

名称 说明
authenticationType 用于对存储终结点进行身份验证的方法 “identityBased”
'keyBased'
batchFrequencyInSeconds Blob 写入存储的时间间隔。 值应介于 60 到 720 秒之间。 默认值为 300 秒。 int

约束:
最小值 = 60
最大值 = 720
connectionString 存储帐户的连接字符串。 字符串
containerName 存储帐户中存储容器的名称。 字符串 (必需)
encoding 用于将消息序列化为 Blob 的编码。 支持的值是“avro”、“avrodeflate”和“JSON”。 默认值为“avro”。 “Avro”
“AvroDeflate”
“JSON”
endpointUri 存储终结点的 URL。 它必须包含协议 https:// 字符串
fileNameFormat Blob 的文件名格式。 默认格式为 {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}。 所有参数都是必需的,但可以重新排序。 string
id 存储容器终结点的 ID 字符串
标识 路由存储终结点的托管标识属性。 ManagedIdentity
maxChunkSizeInBytes 写入存储的每个 Blob 的最大字节数。 值应介于 10485760 (10MB) 到 524288000 (500MB) 之间。 默认值为 314572800 (300MB) 。 int

约束:
最小值 = 10485760
最大值 = 524288000
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 存储帐户的资源组的名称。 字符串
subscriptionId 存储帐户的订阅标识符。 字符串

EnrichmentProperties

名称 说明
endpointNames 对其应用扩充的终结点列表。消息的扩充。 string[] (必需的)

约束:
最小长度 = 1
key 扩充属性的键或名称。 字符串 (必需)
value 扩充属性的值。 字符串 (必需)

FallbackRouteProperties

名称 说明
condition 为应用回退路由而计算的条件。 如果未提供条件,则默认情况下其计算结果为 true。 有关语法,请参阅:/azure/iot-hub/iot-hub-devguide-query-language 字符串
endpointNames 满足条件的消息将路由到的终结点列表。 目前仅允许 1 个终结点。 string[] (必需的)

约束:
最小长度 = 1
最大长度 = 1
isEnabled 用于指定是否启用回退路由。 bool (必需)
name 路由的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符,并且必须是唯一的。 string
source 要向其应用路由规则的源。 例如,DeviceMessages “DeviceConnectionStateEvents”
“DeviceJobLifecycleEvents”
“DeviceLifecycleEvents”
“DeviceMessages”
“无效”
“TwinChangeEvents” (必需)

RouteProperties

名称 说明
condition 评估以应用路由规则的条件。 如果未提供任何条件,则默认情况下其计算结果为 true。 有关语法,请参阅:/azure/iot-hub/iot-hub-devguide-query-language 字符串
endpointNames 满足条件的消息将路由到的终结点列表。 目前只允许使用一个终结点。 string[] (必需的)

约束:
最小长度 = 1
最大长度 = 1
isEnabled 用于指定是否启用路由。 bool (必需)
name 路由的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符,并且必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
source 要应用路由规则的源,例如 DeviceMessages。 “DeviceConnectionStateEvents”
“DeviceJobLifecycleEvents”
“DeviceLifecycleEvents”
“DeviceMessages”
“无效”
“TwinChangeEvents” (必需)

IotHubPropertiesStorageEndpoints

名称 说明
{customized property} StorageEndpointProperties

StorageEndpointProperties

名称 说明
authenticationType 指定用于连接到存储帐户的身份验证类型。 “identityBased”
“keyBased”
connectionString 文件上传到的 Azure 存储帐户的连接字符串。 字符串 (必需)
containerName 在其中上传文件的根容器的名称。 容器不需要存在,但应可使用指定的 connectionString 进行创建。 字符串 (必需)
标识 用于文件上传的存储终结点的托管标识属性。 ManagedIdentity
sasTtlAsIso8601 IoT 中心生成的用于文件上传的 SAS URI 的有效时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-upload-notification-configuration-options。 字符串

IotHubSkuInfo

名称 说明
容量 预配的IoT 中心单位数。 请参阅:/azure/azure-subscription-service-limits#iot-hub-limits。 int
name SKU 的名称。 “B1”
“B2”
“B3”
“F1”
“S1”
“S2”
“S3” (必需)

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
创建 IOT 中心和 Ubuntu 边缘模拟器

部署到 Azure
此模板创建 IOT 中心和虚拟机 Ubuntu 边缘模拟器。
使用 ARM 模板创建IoT 中心、路由和查看消息

部署到 Azure
使用此模板部署IoT 中心和存储帐户。 运行应用以将消息发送到已路由到存储的中心,然后查看结果。
创建IoT 中心设备预配服务

部署到 Azure
使用此模板可以创建 IoT 中心和IoT 中心设备预配服务,并将这两个服务链接在一起。
创建IoT 中心和设备到云使用者组

部署到 Azure
通过此模板,可以部署具有设备到云和云到设备消息传送配置以及设备到云使用者组的IoT 中心实例。
为IoT 中心帐户、实例IoT 中心创建设备更新

部署到 Azure
此模板创建一个帐户,以及一个实例和一个用于链接实例的中心。 它使用必要的访问策略、路由和使用者组配置中心。
部署 MedTech 服务,包括Azure IoT 中心

部署到 Azure
MedTech 服务是 Azure Health Data Services 之一,旨在从多个设备引入设备数据,将设备数据转换为 FHIR 观察值,然后保留在 Azure Health Data Services FHIR 服务中。
使用 IoT 中心 (PAYG) 环境创建即用即付

部署到 Azure
使用此模板,可以部署一个即用即付 (PAYG) 时序见解环境,该环境配置为使用IoT 中心中的事件。

Terraform (AzAPI 提供程序) 资源定义

可以使用面向的操作部署 IotHubs 资源类型:

  • 资源组

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Devices/IotHubs 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Devices/IotHubs@2023-06-30"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type = "string"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      allowedFqdnList = [
        "string"
      ]
      authorizationPolicies = [
        {
          keyName = "string"
          primaryKey = "string"
          rights = "string"
          secondaryKey = "string"
          keyName = "string"
          primaryKey = "string"
          rights = "string"
          secondaryKey = "string"
        }
      ]
      cloudToDevice = {
        defaultTtlAsIso8601 = "string"
        feedback = {
          lockDurationAsIso8601 = "string"
          maxDeliveryCount = int
          ttlAsIso8601 = "string"
        }
        maxDeliveryCount = int
      }
      comments = "string"
      disableDeviceSAS = bool
      disableLocalAuth = bool
      disableModuleSAS = bool
      enableDataResidency = bool
      enableFileUploadNotifications = bool
      eventHubEndpoints = {
        {customized property} = {
          partitionCount = int
          retentionTimeInDays = int
        }
      }
      features = "string"
      ipFilterRules = [
        {
          action = "string"
          filterName = "string"
          ipMask = "string"
        }
      ]
      messagingEndpoints = {
        {customized property} = {
          lockDurationAsIso8601 = "string"
          maxDeliveryCount = int
          ttlAsIso8601 = "string"
        }
      }
      minTlsVersion = "string"
      networkRuleSets = {
        applyToBuiltInEventHubEndpoint = bool
        defaultAction = "string"
        ipRules = [
          {
            action = "Allow"
            filterName = "string"
            ipMask = "string"
          }
        ]
      }
      privateEndpointConnections = [
        {
          properties = {
            privateEndpoint = {}
            privateLinkServiceConnectionState = {
              actionsRequired = "string"
              description = "string"
              status = "string"
            }
          }
        }
      ]
      publicNetworkAccess = "string"
      restrictOutboundNetworkAccess = bool
      routing = {
        endpoints = {
          cosmosDBSqlContainers = [
            {
              authenticationType = "string"
              containerName = "string"
              databaseName = "string"
              endpointUri = "string"
              identity = {
                userAssignedIdentity = "string"
              }
              name = "string"
              partitionKeyName = "string"
              partitionKeyTemplate = "string"
              primaryKey = "string"
              resourceGroup = "string"
              secondaryKey = "string"
              subscriptionId = "string"
            }
          ]
          eventHubs = [
            {
              authenticationType = "string"
              connectionString = "string"
              endpointUri = "string"
              entityPath = "string"
              id = "string"
              identity = {
                userAssignedIdentity = "string"
              }
              name = "string"
              resourceGroup = "string"
              subscriptionId = "string"
            }
          ]
          serviceBusQueues = [
            {
              authenticationType = "string"
              connectionString = "string"
              endpointUri = "string"
              entityPath = "string"
              id = "string"
              identity = {
                userAssignedIdentity = "string"
              }
              name = "string"
              resourceGroup = "string"
              subscriptionId = "string"
            }
          ]
          serviceBusTopics = [
            {
              authenticationType = "string"
              connectionString = "string"
              endpointUri = "string"
              entityPath = "string"
              id = "string"
              identity = {
                userAssignedIdentity = "string"
              }
              name = "string"
              resourceGroup = "string"
              subscriptionId = "string"
            }
          ]
          storageContainers = [
            {
              authenticationType = "string"
              batchFrequencyInSeconds = int
              connectionString = "string"
              containerName = "string"
              encoding = "string"
              endpointUri = "string"
              fileNameFormat = "string"
              id = "string"
              identity = {
                userAssignedIdentity = "string"
              }
              maxChunkSizeInBytes = int
              name = "string"
              resourceGroup = "string"
              subscriptionId = "string"
            }
          ]
        }
        enrichments = [
          {
            endpointNames = [
              "string"
            ]
            key = "string"
            value = "string"
          }
        ]
        fallbackRoute = {
          condition = "string"
          endpointNames = [
            "string"
          ]
          isEnabled = bool
          name = "string"
          source = "string"
        }
        routes = [
          {
            condition = "string"
            endpointNames = [
              "string"
            ]
            isEnabled = bool
            name = "string"
            source = "string"
          }
        ]
      }
      storageEndpoints = {
        {customized property} = {
          authenticationType = "string"
          connectionString = "string"
          containerName = "string"
          identity = {
            userAssignedIdentity = "string"
          }
          sasTtlAsIso8601 = "string"
        }
      }
    }
    sku = {
      capacity = int
      name = "string"
    }
    etag = "string"
  })
}

属性值

IotHubs

名称 说明 Value
type 资源类型 “Microsoft.Devices/IotHubs@2023-06-30”
name 资源名称 字符串 (必需)

字符限制:3-50

有效字符:
字母数字和连字符。

不能以连字符结尾。

资源名称在 Azure 中必须是唯一的。
location 资源位置。 字符串 (必需)
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 资源标记。 标记名称和值的字典。
sku IotHub SKU 信息 IotHubSkuInfo (必需)
etag Etag 字段 是必需的。 如果在响应正文中提供,则还必须根据常规 ETag 约定将其作为标头提供。 字符串
标识 IotHub 的托管标识。 ArmIdentity
properties IotHub 属性 IotHubProperties

ArmIdentity

名称 说明 Value
type 用于资源的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”将从服务中删除任何标识。 “SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
identity_ids {ArmUserIdentity} 字典 用户标识 ID 数组。

ArmIdentityUserAssignedIdentities

名称 说明
{customized property} ArmUserIdentity

ArmUserIdentity

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

IotHubProperties

名称 说明
allowedFqdnList 允许的 FQDN 列表 (来自 Iot 中心的出口的完全限定域名) 。 string[]
authorizationPolicies 可用于保护与 IoT 中心的连接的共享访问策略。 SharedAccessSignatureAuthorizationRule[]
cloudToDevice IoT 中心云到设备的消息传送属性。 CloudToDeviceProperties
comments IoT 中心注释。 字符串
disableDeviceSAS 如果为 true,则所有设备 (包括 Edge 设备,但不包括) 作用域 SAS 密钥的模块,都不能用于身份验证。 bool
disableLocalAuth 如果为 true,则无法使用具有 Iot 中心范围的 SAS 密钥的 SAS 令牌进行身份验证。 bool
disableModuleSAS 如果为 true,则不能使用所有模块范围的 SAS 密钥进行身份验证。 bool
enableDataResidency 当设置为 true 时,此属性将启用数据驻留,从而禁用灾难恢复。 bool
enableFileUploadNotifications 如果为 True,则启用文件上传通知。 bool
eventHubEndpoints 与事件中心兼容的终结点属性。 此字典的唯一可能的键是事件。 在对 IoT 中心进行创建或更新调用时,此密钥必须存在于字典中。 IotHubPropertiesEventHubEndpoints
features 为 IoT 中心启用的功能和特性。 “DeviceManagement”
"None"
ipFilterRules IP 筛选器规则。 IpFilterRule[]
messagingEndpoints 文件上传通知队列的消息传送终结点属性。 IotHubPropertiesMessagingEndpoints
minTlsVersion 指定要为此中心支持的最低 TLS 版本。 可以设置为“1.2”,以拒绝使用低于 1.2 的 TLS 版本的客户端。 字符串
networkRuleSets IotHub 的网络规则集属性 NetworkRuleSetProperties
专用终结点 在此 IotHub 上创建的专用终结点连接 PrivateEndpointConnection[]
publicNetworkAccess 是否允许来自公用网络的请求 “Disabled”
“Enabled”
restrictOutboundNetworkAccess 如果为 true,则来自 IotHub 的出口将限制为仅允许通过 allowedFqdnList 配置的 FQDN。 bool
路由 IoT 中心的路由相关属性。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging RoutingProperties
storageEndpoints 可在其中上传文件的 Azure 存储终结点列表。 目前只能配置一个 Azure 存储帐户,并且该帐户必须将其密钥作为$default。 指定多个存储帐户会导致引发错误。 当 enableFileUploadNotifications 属性设置为 True 时,不指定此属性的值会导致引发错误。 IotHubPropertiesStorageEndpoints

SharedAccessSignatureAuthorizationRule

名称 说明
keyName 共享访问策略的名称。 字符串 (必需)
primaryKey 主键。 字符串
权限 分配给共享访问策略的权限。 “DeviceConnect”
“RegistryRead”
“RegistryRead, DeviceConnect”
“RegistryRead, RegistryWrite”
“RegistryRead,RegistryWrite,DeviceConnect”
“RegistryRead, RegistryWrite, ServiceConnect”
“RegistryRead、RegistryWrite、ServiceConnect、DeviceConnect”
“RegistryRead, ServiceConnect”
“RegistryRead,ServiceConnect,DeviceConnect”
“RegistryWrite”
“RegistryWrite, DeviceConnect”
“RegistryWrite, ServiceConnect”
“RegistryWrite,ServiceConnect,DeviceConnect”
“ServiceConnect”
“ServiceConnect,DeviceConnect” (必需)
secondaryKey 辅助密钥。 字符串
keyName 共享访问策略的名称。 字符串 (必需)
primaryKey 主键。 字符串
权限 分配给共享访问策略的权限。 “DeviceConnect”
“RegistryRead”
“RegistryRead, DeviceConnect”
“RegistryRead, RegistryWrite”
“RegistryRead,RegistryWrite,DeviceConnect”
“RegistryRead, RegistryWrite, ServiceConnect”
“RegistryRead、RegistryWrite、ServiceConnect、DeviceConnect”
“RegistryRead, ServiceConnect”
“RegistryRead,ServiceConnect,DeviceConnect”
“RegistryWrite”
“RegistryWrite, DeviceConnect”
“RegistryWrite, ServiceConnect”
“RegistryWrite,ServiceConnect,DeviceConnect”
“ServiceConnect”
“ServiceConnect,DeviceConnect” (必需)
secondaryKey 辅助密钥。 字符串

CloudToDeviceProperties

名称 说明
defaultTtlAsIso8601 设备队列中云到设备消息的默认生存时间。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串
反馈 云到设备消息的反馈队列的属性。 FeedbackProperties
maxDeliveryCount 设备队列中云到设备消息的最大传递计数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 int

约束:
最小值 = 1
最大值 = 100

FeedbackProperties

名称 说明
lockDurationAsIso8601 反馈队列的锁定持续时间。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串
maxDeliveryCount IoT 中心尝试在反馈队列上传递消息的次数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 int

约束:
最小值 = 1
最大值 = 100
ttlAsIso8601 消息在 IoT 中心过期之前可以使用的时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages。 字符串

IotHubPropertiesEventHubEndpoints

名称 说明
{customized property} EventHubProperties

EventHubProperties

名称 说明
partitionCount 在事件中心兼容的终结点中接收设备到云消息的分区数。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages。 int
retentionTimeInDays 设备到云消息的保留时间(以天为单位)。 请参阅:/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages int

IpFilterRule

名称 说明
action 此规则捕获的请求的所需操作。 "Accept"
需要“拒绝” ()
filterName IP 筛选器规则的名称。 字符串 (必需)
ipMask 包含规则的 CIDR 表示法中的 IP 地址范围的字符串。 字符串 (必需)

IotHubPropertiesMessagingEndpoints

名称 说明
{customized property} MessagingEndpointProperties

MessagingEndpointProperties

名称 说明
lockDurationAsIso8601 锁定持续时间。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 字符串
maxDeliveryCount IoT 中心尝试传递消息的次数。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 int

约束:
最小值 = 1
最大值 = 100
ttlAsIso8601 消息在 IoT 中心过期之前可以使用的时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload。 字符串

NetworkRuleSetProperties

名称 说明
applyToBuiltInEventHubEndpoint 如果为 True,则网络规则集也应用于 IotHub 的 BuiltIn EventHub EndPoint bool (必需)
defaultAction 网络规则集的默认操作 “允许”
“拒绝”
ipRules IP 规则列表 NetworkRuleSetIpRule[] (必需的)

NetworkRuleSetIpRule

名称 说明
action IP 筛选器操作 “允许”
filterName IP 筛选器规则的名称。 字符串 (必需)
ipMask 包含规则的 CIDR 表示法中的 IP 地址范围的字符串。 字符串 (必需)

PrivateEndpointConnection

名称 说明
properties 专用终结点连接的属性 PrivateEndpointConnectionProperties (必需)

PrivateEndpointConnectionProperties

名称 说明
privateEndpoint 专用终结点连接的专用终结点属性 PrivateEndpoint
privateLinkServiceConnectionState 专用终结点连接的当前状态 PrivateLinkServiceConnectionState (必需)

PrivateEndpoint

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

PrivateLinkServiceConnectionState

名称 说明
actionsRequired 专用终结点连接所需的操作 字符串
description 专用终结点连接的当前状态的说明 字符串 (必需)
status 专用终结点连接的状态 “已批准”
“已断开连接”
“挂起”
“已拒绝” (必需)

RoutingProperties

名称 说明
端点 与 IoT 中心根据路由规则将消息路由到的自定义终结点相关的属性。 对于付费中心,所有终结点类型最多允许 10 个自定义终结点,免费中心的所有终结点类型中只允许 1 个自定义终结点。 RoutingEndpoints
扩充 IoT 中心应用于要传递到内置终结点和自定义终结点的消息的用户提供的扩充列表。 请参阅:https://aka.ms/telemetryoneventgrid EnrichmentProperties[]
fallbackRoute 当未满足“路由”部分中指定的条件时用作回退路由的路由的属性。 这是一个可选参数。 如果模板中不存在此属性,则默认禁用回退路由。 FallbackRouteProperties
routes IoT 中心用于将消息路由到内置终结点和自定义终结点的用户提供的路由规则列表。 付费中心最多允许 100 条路由规则,免费中心最多允许 5 条路由规则。 RouteProperties[]

RoutingEndpoints

名称 说明
cosmosDBSqlContainers IoT 中心根据路由规则将消息路由到的 Cosmos DB 容器终结点的列表。 RoutingCosmosDBSqlApiProperties[]
eventHubs IoT 中心根据路由规则将消息路由到的事件中心终结点列表。 此列表不包括内置的事件中心终结点。 RoutingEventHubProperties[]
serviceBusQueues IoT 中心根据路由规则将消息路由到的服务总线队列终结点的列表。 RoutingServiceBusQueueEndpointProperties[]
serviceBusTopics IoT 中心根据路由规则将消息路由到的服务总线主题终结点的列表。 RoutingServiceBusTopicEndpointProperties[]
storageContainers IoT 中心根据路由规则将消息路由到的存储容器终结点的列表。 RoutingStorageContainerProperties[]

RoutingCosmosDBSqlApiProperties

名称 说明
authenticationType 用于对 cosmos DB sql 容器终结点进行身份验证的方法 “identityBased”
“keyBased”
containerName cosmos DB 数据库中 cosmos DB sql 容器的名称。 字符串 (必需)
databaseName cosmos DB 帐户中 cosmos DB 数据库的名称。 字符串 (必需)
endpointUri cosmos DB 帐户的 URL。 它必须包含协议 https:// 字符串 (必需)
标识 路由 cosmos DB 容器终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
partitionKeyName 与此 cosmos DB sql 容器关联的分区键的名称(如果存在)。 这是一个可选参数。 字符串
partitionKeyTemplate 用于生成用于此 cosmos DB sql 容器的合成分区键值的模板。 该模板必须至少包含以下占位符之一:{iothub}、{deviceid}、{DD}、{MM}和 {YYYY}。 最多可以指定一个占位符一次,但顺序和非占位符组件是任意的。 仅当指定 PartitionKeyName 时,此参数才是必需的。 字符串
primaryKey cosmos DB 帐户的主键。 字符串

约束:
敏感值。 作为安全参数传入。
resourceGroup cosmos DB 帐户的资源组的名称。 字符串
secondaryKey cosmos DB 帐户的辅助密钥。 字符串

约束:
敏感值。 作为安全参数传入。
subscriptionId cosmos DB 帐户的订阅标识符。 字符串

ManagedIdentity

名称 说明
userAssignedIdentity 用户分配的标识。 字符串

RoutingEventHubProperties

名称 说明
authenticationType 用于针对事件中心终结点进行身份验证的方法 “identityBased”
“keyBased”
connectionString 事件中心终结点的连接字符串。 字符串
endpointUri 事件中心终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 事件中心命名空间上的事件中心名称 string
id 事件中心终结点的 ID 字符串
标识 路由事件中心终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 事件中心终结点的资源组的名称。 字符串
subscriptionId 事件中心终结点的订阅标识符。 字符串

RoutingServiceBusQueueEndpointProperties

名称 说明
authenticationType 用于针对服务总线队列终结点进行身份验证的方法 “identityBased”
“keyBased”
connectionString 服务总线队列终结点的连接字符串。 字符串
endpointUri 服务总线队列终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 服务总线命名空间上的队列名称 string
id 服务总线队列终结点的 ID 字符串
标识 路由服务总线队列终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 名称不必与实际队列名称相同。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 服务总线队列终结点的资源组的名称。 字符串
subscriptionId 服务总线队列终结点的订阅标识符。 字符串

RoutingServiceBusTopicEndpointProperties

名称 说明
authenticationType 用于针对服务总线主题终结点进行身份验证的方法 “identityBased”
“keyBased”
connectionString 服务总线主题终结点的连接字符串。 字符串
endpointUri 服务总线主题终结点的 URL。 它必须包含协议 sb:// 字符串
entityPath 服务总线主题上的队列名称 string
id 服务总线主题终结点的 ID 字符串
标识 路由服务总线主题终结点的托管标识属性。 ManagedIdentity
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 名称不必与实际主题名称相同。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 服务总线主题终结点的资源组的名称。 字符串
subscriptionId 服务总线主题终结点的订阅标识符。 字符串

RoutingStorageContainerProperties

名称 说明
authenticationType 用于对存储终结点进行身份验证的方法 “identityBased”
“keyBased”
batchFrequencyInSeconds Blob 写入存储的时间间隔。 值应介于 60 到 720 秒之间。 默认值为 300 秒。 int

约束:
最小值 = 60
最大值 = 720
connectionString 存储帐户的连接字符串。 字符串
containerName 存储帐户中存储容器的名称。 字符串 (必需)
encoding 用于将消息序列化为 Blob 的编码。 支持的值是“avro”、“avrodeflate”和“JSON”。 默认值为“avro”。 “Avro”
“AvroDeflate”
“JSON”
endpointUri 存储终结点的 URL。 它必须包含协议 https:// 字符串
fileNameFormat Blob 的文件名格式。 默认格式为 {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}。 所有参数都是必需的,但可以重新排序。 string
id 存储容器终结点的 ID 字符串
标识 路由存储终结点的托管标识属性。 ManagedIdentity
maxChunkSizeInBytes 写入存储的每个 Blob 的最大字节数。 值应介于 10485760 (10MB) 到 524288000 (500MB) 之间。 默认值为 314572800 (300MB) 。 int

约束:
最小值 = 10485760
最大值 = 524288000
name 标识此终结点的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符。 保留以下名称:events、fileNotifications $default。 终结点名称在终结点类型中必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
resourceGroup 存储帐户的资源组的名称。 字符串
subscriptionId 存储帐户的订阅标识符。 字符串

EnrichmentProperties

名称 说明
endpointNames 对其应用扩充的终结点列表。消息的扩充。 string[] (必需的)

约束:
最小长度 = 1
key 扩充属性的键或名称。 字符串 (必需)
value 扩充属性的值。 字符串 (必需)

FallbackRouteProperties

名称 说明
condition 为应用回退路由而计算的条件。 如果未提供条件,则默认情况下其计算结果为 true。 有关语法,请参阅:/azure/iot-hub/iot-hub-devguide-query-language 字符串
endpointNames 满足条件的消息将路由到的终结点列表。 目前仅允许 1 个终结点。 string[] (必需的)

约束:
最小长度 = 1
最大长度 = 1
isEnabled 用于指定是否启用回退路由。 bool (必需)
name 路由的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符,并且必须是唯一的。 string
source 要向其应用路由规则的源。 例如,DeviceMessages “DeviceConnectionStateEvents”
“DeviceJobLifecycleEvents”
“DeviceLifecycleEvents”
“DeviceMessages”
“无效”
“TwinChangeEvents” (必需)

RouteProperties

名称 说明
condition 评估以应用路由规则的条件。 如果未提供任何条件,则默认情况下其计算结果为 true。 有关语法,请参阅:/azure/iot-hub/iot-hub-devguide-query-language 字符串
endpointNames 满足条件的消息将路由到的终结点列表。 目前只允许使用一个终结点。 string[] (必需的)

约束:
最小长度 = 1
最大长度 = 1
isEnabled 用于指定是否启用路由。 bool (必需)
name 路由的名称。 名称只能包含字母数字字符、句点、下划线、连字符,最大长度为 64 个字符,并且必须是唯一的。 字符串 (必需)

约束:
Pattern = ^[A-Za-z0-9-._]{1,64}$
source 要应用路由规则的源,例如 DeviceMessages。 “DeviceConnectionStateEvents”
“DeviceJobLifecycleEvents”
“DeviceLifecycleEvents”
“DeviceMessages”
“无效”
“TwinChangeEvents” (必需)

IotHubPropertiesStorageEndpoints

名称 说明
{customized property} StorageEndpointProperties

StorageEndpointProperties

名称 说明
authenticationType 指定用于连接到存储帐户的身份验证类型。 “identityBased”
“keyBased”
connectionString 文件上传到的 Azure 存储帐户的连接字符串。 字符串 (必需)
containerName 在其中上传文件的根容器的名称。 容器不需要存在,但应可使用指定的 connectionString 进行创建。 字符串 (必需)
标识 用于文件上传的存储终结点的托管标识属性。 ManagedIdentity
sasTtlAsIso8601 IoT 中心生成的用于文件上传的 SAS URI 的有效时间段。 请参阅:/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-upload-notification-configuration-options。 字符串

IotHubSkuInfo

名称 说明
容量 预配的IoT 中心单位数。 请参阅:/azure/azure-subscription-service-limits#iot-hub-limits。 int
name SKU 的名称。 “B1”
“B2”
“B3”
"F1"
“S1”
“S2”
“S3” (必需)