Iot Hub Resource - Create Or Update

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}?api-version=2023-06-30

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group that contains the IoT hub.

resourceName
path True

string

The name of the IoT hub.

subscriptionId
path True

string

The subscription identifier.

api-version
query True

string

The version of the API.

Request Header

Name Required Type Description
If-Match

string

ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub.

Request Body

Name Required Type Description
location True

string

The resource location.

sku True

IotHubSkuInfo

IotHub SKU info

etag

string

The Etag field is not required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.

identity

ArmIdentity

The managed identities for the IotHub.

properties

IotHubProperties

IotHub properties

tags

object

The resource tags.

Responses

Name Type Description
200 OK

IotHubDescription

This is returned as a response to the status polling request for the create or update operation. The body contains the resource representation that indicates a transitional provisioning state.

201 Created

IotHubDescription

This is a long running operation. The operation returns a 201 if the validation is complete. The response includes an Azure-AsyncOperation header that contains a status URL. Clients are expected to poll the status URL for the status of the operation. If successful, the operation returns HTTP status code of 201 (OK).

Other Status Codes

ErrorDetails

DefaultErrorResponse

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

IotHubResource_AddCosmosDbEndpoint
IotHubResource_CreateOrUpdate

IotHubResource_AddCosmosDbEndpoint

Sample request

PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub?api-version=2023-06-30

{
  "location": "centraluseuap",
  "tags": {},
  "etag": "AAAAAAFD6M4=",
  "properties": {
    "ipFilterRules": [],
    "networkRuleSets": {
      "defaultAction": "Deny",
      "applyToBuiltInEventHubEndpoint": true,
      "ipRules": [
        {
          "filterName": "rule1",
          "action": "Allow",
          "ipMask": "131.117.159.53"
        },
        {
          "filterName": "rule2",
          "action": "Allow",
          "ipMask": "157.55.59.128/25"
        }
      ]
    },
    "eventHubEndpoints": {
      "events": {
        "retentionTimeInDays": 1,
        "partitionCount": 2
      }
    },
    "routing": {
      "endpoints": {
        "serviceBusQueues": [],
        "serviceBusTopics": [],
        "eventHubs": [],
        "storageContainers": [],
        "cosmosDBSqlContainers": [
          {
            "primaryKey": "<primary-key>",
            "secondaryKey": "<secondary-key>",
            "authenticationType": "keyBased",
            "containerName": "test",
            "databaseName": "systemstore",
            "endpointUri": "https://test-systemstore-test2.documents.azure.com",
            "name": "endpointcosmos",
            "partitionKeyName": "keystamped",
            "partitionKeyTemplate": "{deviceid}-{YYYY}-{MM}",
            "resourceGroup": "rg-test",
            "subscriptionId": "<subscription-id>"
          }
        ]
      },
      "routes": [],
      "fallbackRoute": {
        "name": "$fallback",
        "source": "DeviceMessages",
        "condition": "true",
        "endpointNames": [
          "events"
        ],
        "isEnabled": true
      }
    },
    "storageEndpoints": {
      "$default": {
        "sasTtlAsIso8601": "PT1H",
        "connectionString": "",
        "containerName": ""
      }
    },
    "messagingEndpoints": {
      "fileNotifications": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "enableFileUploadNotifications": false,
    "cloudToDevice": {
      "maxDeliveryCount": 10,
      "defaultTtlAsIso8601": "PT1H",
      "feedback": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "features": "None",
    "minTlsVersion": "1.2",
    "enableDataResidency": false
  },
  "sku": {
    "name": "S1",
    "capacity": 1
  }
}

Sample response

{
  "id": "/subscriptions/ae24ff83-d2ca-4fc8-9717-05dae4bba489/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub",
  "name": "testHub",
  "type": "Microsoft.Devices/IotHubs",
  "location": "centraluseuap",
  "tags": {},
  "etag": "AAAAAAFD6M4=",
  "properties": {
    "state": "Active",
    "provisioningState": "Succeeded",
    "ipFilterRules": [
      {
        "filterName": "rule1",
        "action": "Accept",
        "ipMask": "131.117.159.53"
      },
      {
        "filterName": "rule2",
        "action": "Accept",
        "ipMask": "157.55.59.128/25"
      }
    ],
    "networkRuleSets": {
      "defaultAction": "Deny",
      "applyToBuiltInEventHubEndpoint": true,
      "ipRules": [
        {
          "filterName": "rule1",
          "action": "Allow",
          "ipMask": "131.117.159.53"
        },
        {
          "filterName": "rule2",
          "action": "Allow",
          "ipMask": "157.55.59.128/25"
        }
      ]
    },
    "hostName": "iot-dps-cit-hub-1.azure-devices.net",
    "eventHubEndpoints": {
      "events": {
        "retentionTimeInDays": 1,
        "partitionCount": 2,
        "partitionIds": [
          "0",
          "1"
        ],
        "path": "iot-dps-cit-hub-1",
        "endpoint": "sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"
      }
    },
    "routing": {
      "endpoints": {
        "serviceBusQueues": [],
        "serviceBusTopics": [],
        "eventHubs": [],
        "storageContainers": [],
        "cosmosDBSqlContainers": [
          {
            "id": "009208fa-9cb7-4b90-bfbd-f40086e766c9",
            "authenticationType": "keyBased",
            "containerName": "test",
            "databaseName": "systemstore",
            "endpointUri": "https://test-systemstore-test2.documents.azure.com",
            "name": "endpointcosmos",
            "partitionKeyName": "keystamped",
            "partitionKeyTemplate": "{deviceid}-{YYYY}-{MM}",
            "resourceGroup": "rg-test",
            "subscriptionId": "<subscription-id>"
          }
        ]
      },
      "routes": [],
      "fallbackRoute": {
        "name": "$fallback",
        "source": "DeviceMessages",
        "condition": "true",
        "endpointNames": [
          "events"
        ],
        "isEnabled": true
      }
    },
    "storageEndpoints": {
      "$default": {
        "sasTtlAsIso8601": "PT1H",
        "connectionString": "",
        "containerName": ""
      }
    },
    "messagingEndpoints": {
      "fileNotifications": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "enableFileUploadNotifications": false,
    "cloudToDevice": {
      "maxDeliveryCount": 10,
      "defaultTtlAsIso8601": "PT1H",
      "feedback": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "features": "None",
    "minTlsVersion": "1.2",
    "enableDataResidency": false
  },
  "sku": {
    "name": "S1",
    "tier": "Standard",
    "capacity": 1
  },
  "systemData": {
    "createdAt": "2021-01-30T00:28:38.963Z"
  }
}
{
  "id": "/subscriptions/ae24ff83-d2ca-4fc8-9717-05dae4bba489/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub",
  "name": "testHub",
  "type": "Microsoft.Devices/IotHubs",
  "location": "centraluseuap",
  "tags": {},
  "etag": "AAAAAAFD6M4=",
  "properties": {
    "state": "Active",
    "provisioningState": "Succeeded",
    "ipFilterRules": [
      {
        "filterName": "rule1",
        "action": "Accept",
        "ipMask": "131.117.159.53"
      },
      {
        "filterName": "rule2",
        "action": "Accept",
        "ipMask": "157.55.59.128/25"
      }
    ],
    "networkRuleSets": {
      "defaultAction": "Deny",
      "applyToBuiltInEventHubEndpoint": true,
      "ipRules": [
        {
          "filterName": "rule1",
          "action": "Allow",
          "ipMask": "131.117.159.53"
        },
        {
          "filterName": "rule2",
          "action": "Allow",
          "ipMask": "157.55.59.128/25"
        }
      ]
    },
    "hostName": "iot-dps-cit-hub-1.azure-devices.net",
    "eventHubEndpoints": {
      "events": {
        "retentionTimeInDays": 1,
        "partitionCount": 2,
        "partitionIds": [
          "0",
          "1"
        ],
        "path": "iot-dps-cit-hub-1",
        "endpoint": "sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"
      }
    },
    "routing": {
      "endpoints": {
        "serviceBusQueues": [],
        "serviceBusTopics": [],
        "eventHubs": [],
        "storageContainers": [],
        "cosmosDBSqlContainers": [
          {
            "id": "009208fa-9cb7-4b90-bfbd-f40086e766c9",
            "authenticationType": "keyBased",
            "containerName": "test",
            "databaseName": "systemstore",
            "endpointUri": "https://test-systemstore-test2.documents.azure.com",
            "name": "endpointcosmos",
            "partitionKeyName": "keystamped",
            "partitionKeyTemplate": "{deviceid}-{YYYY}-{MM}",
            "resourceGroup": "rg-test",
            "subscriptionId": "<subscription-id>"
          }
        ]
      },
      "routes": [],
      "fallbackRoute": {
        "name": "$fallback",
        "source": "DeviceMessages",
        "condition": "true",
        "endpointNames": [
          "events"
        ],
        "isEnabled": true
      }
    },
    "storageEndpoints": {
      "$default": {
        "sasTtlAsIso8601": "PT1H",
        "connectionString": "",
        "containerName": ""
      }
    },
    "messagingEndpoints": {
      "fileNotifications": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "enableFileUploadNotifications": false,
    "cloudToDevice": {
      "maxDeliveryCount": 10,
      "defaultTtlAsIso8601": "PT1H",
      "feedback": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "features": "None",
    "minTlsVersion": "1.2",
    "enableDataResidency": false
  },
  "sku": {
    "name": "S1",
    "tier": "Standard",
    "capacity": 1
  },
  "systemData": {
    "createdAt": "2021-01-30T00:28:38.963Z"
  }
}

IotHubResource_CreateOrUpdate

Sample request

PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub?api-version=2023-06-30

{
  "location": "centraluseuap",
  "tags": {},
  "etag": "AAAAAAFD6M4=",
  "properties": {
    "ipFilterRules": [],
    "networkRuleSets": {
      "defaultAction": "Deny",
      "applyToBuiltInEventHubEndpoint": true,
      "ipRules": [
        {
          "filterName": "rule1",
          "action": "Allow",
          "ipMask": "131.117.159.53"
        },
        {
          "filterName": "rule2",
          "action": "Allow",
          "ipMask": "157.55.59.128/25"
        }
      ]
    },
    "eventHubEndpoints": {
      "events": {
        "retentionTimeInDays": 1,
        "partitionCount": 2
      }
    },
    "routing": {
      "endpoints": {
        "serviceBusQueues": [],
        "serviceBusTopics": [],
        "eventHubs": [],
        "storageContainers": []
      },
      "routes": [],
      "fallbackRoute": {
        "name": "$fallback",
        "source": "DeviceMessages",
        "condition": "true",
        "endpointNames": [
          "events"
        ],
        "isEnabled": true
      }
    },
    "storageEndpoints": {
      "$default": {
        "sasTtlAsIso8601": "PT1H",
        "connectionString": "",
        "containerName": ""
      }
    },
    "messagingEndpoints": {
      "fileNotifications": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "enableFileUploadNotifications": false,
    "cloudToDevice": {
      "maxDeliveryCount": 10,
      "defaultTtlAsIso8601": "PT1H",
      "feedback": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "features": "None",
    "minTlsVersion": "1.2",
    "enableDataResidency": false
  },
  "sku": {
    "name": "S1",
    "capacity": 1
  }
}

Sample response

{
  "id": "/subscriptions/ae24ff83-d2ca-4fc8-9717-05dae4bba489/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub",
  "name": "testHub",
  "type": "Microsoft.Devices/IotHubs",
  "location": "centraluseuap",
  "tags": {},
  "etag": "AAAAAAFD6M4=",
  "properties": {
    "state": "Active",
    "provisioningState": "Succeeded",
    "ipFilterRules": [
      {
        "filterName": "rule1",
        "action": "Accept",
        "ipMask": "131.117.159.53"
      },
      {
        "filterName": "rule2",
        "action": "Accept",
        "ipMask": "157.55.59.128/25"
      }
    ],
    "networkRuleSets": {
      "defaultAction": "Deny",
      "applyToBuiltInEventHubEndpoint": true,
      "ipRules": [
        {
          "filterName": "rule1",
          "action": "Allow",
          "ipMask": "131.117.159.53"
        },
        {
          "filterName": "rule2",
          "action": "Allow",
          "ipMask": "157.55.59.128/25"
        }
      ]
    },
    "hostName": "iot-dps-cit-hub-1.azure-devices.net",
    "eventHubEndpoints": {
      "events": {
        "retentionTimeInDays": 1,
        "partitionCount": 2,
        "partitionIds": [
          "0",
          "1"
        ],
        "path": "iot-dps-cit-hub-1",
        "endpoint": "sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"
      }
    },
    "routing": {
      "endpoints": {
        "serviceBusQueues": [],
        "serviceBusTopics": [],
        "eventHubs": [],
        "storageContainers": []
      },
      "routes": [],
      "fallbackRoute": {
        "name": "$fallback",
        "source": "DeviceMessages",
        "condition": "true",
        "endpointNames": [
          "events"
        ],
        "isEnabled": true
      }
    },
    "storageEndpoints": {
      "$default": {
        "sasTtlAsIso8601": "PT1H",
        "connectionString": "",
        "containerName": ""
      }
    },
    "messagingEndpoints": {
      "fileNotifications": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "enableFileUploadNotifications": false,
    "cloudToDevice": {
      "maxDeliveryCount": 10,
      "defaultTtlAsIso8601": "PT1H",
      "feedback": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "features": "None",
    "minTlsVersion": "1.2",
    "enableDataResidency": false
  },
  "sku": {
    "name": "S1",
    "tier": "Standard",
    "capacity": 1
  },
  "systemData": {
    "createdAt": "2021-01-30T00:28:38.963Z"
  }
}
{
  "id": "/subscriptions/ae24ff83-d2ca-4fc8-9717-05dae4bba489/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub",
  "name": "testHub",
  "type": "Microsoft.Devices/IotHubs",
  "location": "centraluseuap",
  "tags": {},
  "etag": "AAAAAAFD6M4=",
  "properties": {
    "state": "Active",
    "provisioningState": "Succeeded",
    "ipFilterRules": [
      {
        "filterName": "rule1",
        "action": "Accept",
        "ipMask": "131.117.159.53"
      },
      {
        "filterName": "rule2",
        "action": "Accept",
        "ipMask": "157.55.59.128/25"
      }
    ],
    "networkRuleSets": {
      "defaultAction": "Deny",
      "applyToBuiltInEventHubEndpoint": true,
      "ipRules": [
        {
          "filterName": "rule1",
          "action": "Allow",
          "ipMask": "131.117.159.53"
        },
        {
          "filterName": "rule2",
          "action": "Allow",
          "ipMask": "157.55.59.128/25"
        }
      ]
    },
    "hostName": "iot-dps-cit-hub-1.azure-devices.net",
    "eventHubEndpoints": {
      "events": {
        "retentionTimeInDays": 1,
        "partitionCount": 2,
        "partitionIds": [
          "0",
          "1"
        ],
        "path": "iot-dps-cit-hub-1",
        "endpoint": "sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"
      }
    },
    "routing": {
      "endpoints": {
        "serviceBusQueues": [],
        "serviceBusTopics": [],
        "eventHubs": [],
        "storageContainers": []
      },
      "routes": [],
      "fallbackRoute": {
        "name": "$fallback",
        "source": "DeviceMessages",
        "condition": "true",
        "endpointNames": [
          "events"
        ],
        "isEnabled": true
      }
    },
    "storageEndpoints": {
      "$default": {
        "sasTtlAsIso8601": "PT1H",
        "connectionString": "",
        "containerName": ""
      }
    },
    "messagingEndpoints": {
      "fileNotifications": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "enableFileUploadNotifications": false,
    "cloudToDevice": {
      "maxDeliveryCount": 10,
      "defaultTtlAsIso8601": "PT1H",
      "feedback": {
        "lockDurationAsIso8601": "PT1M",
        "ttlAsIso8601": "PT1H",
        "maxDeliveryCount": 10
      }
    },
    "features": "None",
    "minTlsVersion": "1.2",
    "enableDataResidency": false
  },
  "sku": {
    "name": "S1",
    "tier": "Standard",
    "capacity": 1
  },
  "systemData": {
    "createdAt": "2021-01-30T00:28:38.963Z"
  }
}

Definitions

Name Description
AccessRights

The permissions assigned to the shared access policy.

ArmIdentity
ArmUserIdentity
AuthenticationType

Specifies authentication type being used for connecting to the storage account.

authenticationType

Method used to authenticate against the service bus queue endpoint

Capabilities

The capabilities and features enabled for the IoT hub.

CloudToDeviceProperties

The IoT hub cloud-to-device messaging properties.

createdByType

The type of identity that created the resource.

DefaultAction

Default Action for Network Rule Set

EnrichmentProperties

The properties of an enrichment that your IoT hub applies to messages delivered to endpoints.

ErrorDetails

Error details.

EventHubProperties

The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub.

FallbackRouteProperties

The properties of the fallback route. IoT Hub uses these properties when it routes messages to the fallback endpoint.

FeedbackProperties

The properties of the feedback queue for cloud-to-device messages.

IotHubDescription

The description of the IoT hub.

IotHubLocationDescription

Public representation of one of the locations where a resource is provisioned.

IotHubProperties

The properties of an IoT hub.

IotHubReplicaRoleType

The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to.

IotHubSku

The name of the SKU.

IotHubSkuInfo

Information about the SKU of the IoT hub.

IotHubSkuTier

The billing tier for the IoT hub.

IpFilterActionType

The desired action for requests captured by this rule.

IpFilterRule

The IP filter rules for the IoT hub.

ManagedIdentity

The properties of the Managed identity.

MessagingEndpointProperties

The properties of the messaging endpoints used by this IoT hub.

NetworkRuleIPAction

IP Filter Action

NetworkRuleSetIpRule

IP Rule to be applied as part of Network Rule Set

NetworkRuleSetProperties

Network Rule Set Properties of IotHub

PrivateEndpoint

The private endpoint property of a private endpoint connection

PrivateEndpointConnection

The private endpoint connection of an IotHub

PrivateEndpointConnectionProperties

The properties of a private endpoint connection

PrivateLinkServiceConnectionState

The current state of a private endpoint connection

PrivateLinkServiceConnectionStatus

The status of a private endpoint connection

PublicNetworkAccess

Whether requests from Public Network are allowed

ResourceIdentityType

The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.

RouteProperties

The properties of a routing rule that your IoT hub uses to route messages to endpoints.

RoutingCosmosDBSqlApiProperties

The properties related to a cosmos DB sql container endpoint.

RoutingEndpoints

The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs.

RoutingEventHubProperties

The properties related to an event hub endpoint.

RoutingProperties

The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging

RoutingServiceBusQueueEndpointProperties

The properties related to service bus queue endpoint types.

RoutingServiceBusTopicEndpointProperties

The properties related to service bus topic endpoint types.

RoutingSource

The source that the routing rule is to be applied to, such as DeviceMessages.

RoutingStorageContainerProperties

The properties related to a storage container endpoint.

SharedAccessSignatureAuthorizationRule

The properties of an IoT hub shared access policy.

StorageEndpointProperties

The properties of the Azure Storage endpoint for file upload.

systemData

Metadata pertaining to creation and last modification of the resource.

AccessRights

The permissions assigned to the shared access policy.

Name Type Description
DeviceConnect

string

RegistryRead

string

RegistryRead, DeviceConnect

string

RegistryRead, RegistryWrite

string

RegistryRead, RegistryWrite, DeviceConnect

string

RegistryRead, RegistryWrite, ServiceConnect

string

RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect

string

RegistryRead, ServiceConnect

string

RegistryRead, ServiceConnect, DeviceConnect

string

RegistryWrite

string

RegistryWrite, DeviceConnect

string

RegistryWrite, ServiceConnect

string

RegistryWrite, ServiceConnect, DeviceConnect

string

ServiceConnect

string

ServiceConnect, DeviceConnect

string

ArmIdentity

Name Type Description
principalId

string

Principal Id

tenantId

string

Tenant Id

type

ResourceIdentityType

The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.

userAssignedIdentities

<string,  ArmUserIdentity>

ArmUserIdentity

Name Type Description
clientId

string

principalId

string

AuthenticationType

Specifies authentication type being used for connecting to the storage account.

Name Type Description
identityBased

string

keyBased

string

authenticationType

Method used to authenticate against the service bus queue endpoint

Name Type Description
identityBased

string

keyBased

string

Capabilities

The capabilities and features enabled for the IoT hub.

Name Type Description
DeviceManagement

string

None

string

CloudToDeviceProperties

The IoT hub cloud-to-device messaging properties.

Name Type Description
defaultTtlAsIso8601

string

The default time to live for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.

feedback

FeedbackProperties

The properties of the feedback queue for cloud-to-device messages.

maxDeliveryCount

integer

The max delivery count for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

DefaultAction

Default Action for Network Rule Set

Name Type Description
Allow

string

Deny

string

EnrichmentProperties

The properties of an enrichment that your IoT hub applies to messages delivered to endpoints.

Name Type Description
endpointNames

string[]

The list of endpoints for which the enrichment is applied to the message.

key

string

The key or name for the enrichment property.

value

string

The value for the enrichment property.

ErrorDetails

Error details.

Name Type Description
code

string

The error code.

details

string

The error details.

httpStatusCode

string

The HTTP status code.

message

string

The error message.

EventHubProperties

The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub.

Name Type Description
endpoint

string

The Event Hub-compatible endpoint.

partitionCount

integer

The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages.

partitionIds

string[]

The partition ids in the Event Hub-compatible endpoint.

path

string

The Event Hub-compatible name.

retentionTimeInDays

integer

The retention time for device-to-cloud messages in days. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages

FallbackRouteProperties

The properties of the fallback route. IoT Hub uses these properties when it routes messages to the fallback endpoint.

Name Type Description
condition

string

The condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language

endpointNames

string[]

The list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed.

isEnabled

boolean

Used to specify whether the fallback route is enabled.

name

string

The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.

source

RoutingSource

The source to which the routing rule is to be applied to. For example, DeviceMessages

FeedbackProperties

The properties of the feedback queue for cloud-to-device messages.

Name Type Description
lockDurationAsIso8601

string

The lock duration for the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.

maxDeliveryCount

integer

The number of times the IoT hub attempts to deliver a message on the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.

ttlAsIso8601

string

The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.

IotHubDescription

The description of the IoT hub.

Name Type Description
etag

string

The Etag field is not required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.

id

string

The resource identifier.

identity

ArmIdentity

The managed identities for the IotHub.

location

string

The resource location.

name

string

The resource name.

properties

IotHubProperties

IotHub properties

sku

IotHubSkuInfo

IotHub SKU info

systemData

systemData

The system meta data relating to this resource.

tags

object

The resource tags.

type

string

The resource type.

IotHubLocationDescription

Public representation of one of the locations where a resource is provisioned.

Name Type Description
location

string

The name of the Azure region

role

IotHubReplicaRoleType

The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to.

IotHubProperties

The properties of an IoT hub.

Name Type Description
allowedFqdnList

string[]

List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub.

authorizationPolicies

SharedAccessSignatureAuthorizationRule[]

The shared access policies you can use to secure a connection to the IoT hub.

cloudToDevice

CloudToDeviceProperties

The IoT hub cloud-to-device messaging properties.

comments

string

IoT hub comments.

disableDeviceSAS

boolean

If true, all device(including Edge devices but excluding modules) scoped SAS keys cannot be used for authentication.

disableLocalAuth

boolean

If true, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication.

disableModuleSAS

boolean

If true, all module scoped SAS keys cannot be used for authentication.

enableDataResidency

boolean

This property when set to true, will enable data residency, thus, disabling disaster recovery.

enableFileUploadNotifications

boolean

If True, file upload notifications are enabled.

eventHubEndpoints

<string,  EventHubProperties>

The Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub.

features

Capabilities

The capabilities and features enabled for the IoT hub.

hostName

string

The name of the host.

ipFilterRules

IpFilterRule[]

The IP filter rules.

locations

IotHubLocationDescription[]

Primary and secondary location for iot hub

messagingEndpoints

<string,  MessagingEndpointProperties>

The messaging endpoint properties for the file upload notification queue.

minTlsVersion

string

Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients that use a TLS version below 1.2 to be rejected.

networkRuleSets

NetworkRuleSetProperties

Network Rule Set Properties of IotHub

privateEndpointConnections

PrivateEndpointConnection[]

Private endpoint connections created on this IotHub

provisioningState

string

The provisioning state.

publicNetworkAccess

PublicNetworkAccess

Whether requests from Public Network are allowed

restrictOutboundNetworkAccess

boolean

If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList.

routing

RoutingProperties

The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging

state

string

The hub state.

storageEndpoints

<string,  StorageEndpointProperties>

The list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown.

IotHubReplicaRoleType

The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to.

Name Type Description
primary

string

secondary

string

IotHubSku

The name of the SKU.

Name Type Description
B1

string

B2

string

B3

string

F1

string

S1

string

S2

string

S3

string

IotHubSkuInfo

Information about the SKU of the IoT hub.

Name Type Description
capacity

integer

The number of provisioned IoT Hub units. See: https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits.

name

IotHubSku

The name of the SKU.

tier

IotHubSkuTier

The billing tier for the IoT hub.

IotHubSkuTier

The billing tier for the IoT hub.

Name Type Description
Basic

string

Free

string

Standard

string

IpFilterActionType

The desired action for requests captured by this rule.

Name Type Description
Accept

string

Reject

string

IpFilterRule

The IP filter rules for the IoT hub.

Name Type Description
action

IpFilterActionType

The desired action for requests captured by this rule.

filterName

string

The name of the IP filter rule.

ipMask

string

A string that contains the IP address range in CIDR notation for the rule.

ManagedIdentity

The properties of the Managed identity.

Name Type Description
userAssignedIdentity

string

The user assigned identity.

MessagingEndpointProperties

The properties of the messaging endpoints used by this IoT hub.

Name Type Description
lockDurationAsIso8601

string

The lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.

maxDeliveryCount

integer

The number of times the IoT hub attempts to deliver a message. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.

ttlAsIso8601

string

The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.

NetworkRuleIPAction

IP Filter Action

Name Type Description
Allow

string

NetworkRuleSetIpRule

IP Rule to be applied as part of Network Rule Set

Name Type Default value Description
action

NetworkRuleIPAction

Allow

IP Filter Action

filterName

string

Name of the IP filter rule.

ipMask

string

A string that contains the IP address range in CIDR notation for the rule.

NetworkRuleSetProperties

Network Rule Set Properties of IotHub

Name Type Default value Description
applyToBuiltInEventHubEndpoint

boolean

If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub

defaultAction

DefaultAction

Deny

Default Action for Network Rule Set

ipRules

NetworkRuleSetIpRule[]

List of IP Rules

PrivateEndpoint

The private endpoint property of a private endpoint connection

Name Type Description
id

string

The resource identifier.

PrivateEndpointConnection

The private endpoint connection of an IotHub

Name Type Description
id

string

The resource identifier.

name

string

The resource name.

properties

PrivateEndpointConnectionProperties

The properties of a private endpoint connection

type

string

The resource type.

PrivateEndpointConnectionProperties

The properties of a private endpoint connection

Name Type Description
privateEndpoint

PrivateEndpoint

The private endpoint property of a private endpoint connection

privateLinkServiceConnectionState

PrivateLinkServiceConnectionState

The current state of a private endpoint connection

PrivateLinkServiceConnectionState

The current state of a private endpoint connection

Name Type Description
actionsRequired

string

Actions required for a private endpoint connection

description

string

The description for the current state of a private endpoint connection

status

PrivateLinkServiceConnectionStatus

The status of a private endpoint connection

PrivateLinkServiceConnectionStatus

The status of a private endpoint connection

Name Type Description
Approved

string

Disconnected

string

Pending

string

Rejected

string

PublicNetworkAccess

Whether requests from Public Network are allowed

Name Type Description
Disabled

string

Enabled

string

ResourceIdentityType

The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.

Name Type Description
None

string

SystemAssigned

string

SystemAssigned, UserAssigned

string

UserAssigned

string

RouteProperties

The properties of a routing rule that your IoT hub uses to route messages to endpoints.

Name Type Description
condition

string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language

endpointNames

string[]

The list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed.

isEnabled

boolean

Used to specify whether a route is enabled.

name

string

The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.

source

RoutingSource

The source that the routing rule is to be applied to, such as DeviceMessages.

RoutingCosmosDBSqlApiProperties

The properties related to a cosmos DB sql container endpoint.

Name Type Description
authenticationType

authenticationType

Method used to authenticate against the cosmos DB sql container endpoint

containerName

string

The name of the cosmos DB sql container in the cosmos DB database.

databaseName

string

The name of the cosmos DB database in the cosmos DB account.

endpointUri

string

The url of the cosmos DB account. It must include the protocol https://

id

string

Id of the cosmos DB sql container endpoint

identity

ManagedIdentity

Managed identity properties of routing cosmos DB container endpoint.

name

string

The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types.

partitionKeyName

string

The name of the partition key associated with this cosmos DB sql container if one exists. This is an optional parameter.

partitionKeyTemplate

string

The template for generating a synthetic partition key value for use with this cosmos DB sql container. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified.

primaryKey

string

The primary key of the cosmos DB account.

resourceGroup

string

The name of the resource group of the cosmos DB account.

secondaryKey

string

The secondary key of the cosmos DB account.

subscriptionId

string

The subscription identifier of the cosmos DB account.

RoutingEndpoints

The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs.

Name Type Description
cosmosDBSqlContainers

RoutingCosmosDBSqlApiProperties[]

The list of Cosmos DB container endpoints that IoT hub routes messages to, based on the routing rules.

eventHubs

RoutingEventHubProperties[]

The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint.

serviceBusQueues

RoutingServiceBusQueueEndpointProperties[]

The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules.

serviceBusTopics

RoutingServiceBusTopicEndpointProperties[]

The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules.

storageContainers

RoutingStorageContainerProperties[]

The list of storage container endpoints that IoT hub routes messages to, based on the routing rules.

RoutingEventHubProperties

The properties related to an event hub endpoint.

Name Type Description
authenticationType

authenticationType

Method used to authenticate against the event hub endpoint

connectionString

string

The connection string of the event hub endpoint.

endpointUri

string

The url of the event hub endpoint. It must include the protocol sb://

entityPath

string

Event hub name on the event hub namespace

id

string

Id of the event hub endpoint

identity

ManagedIdentity

Managed identity properties of routing event hub endpoint.

name

string

The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types.

resourceGroup

string

The name of the resource group of the event hub endpoint.

subscriptionId

string

The subscription identifier of the event hub endpoint.

RoutingProperties

The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging

Name Type Description
endpoints

RoutingEndpoints

The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs.

enrichments

EnrichmentProperties[]

The list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid

fallbackRoute

FallbackRouteProperties

The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not present in the template, the fallback route is disabled by default.

routes

RouteProperties[]

The list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs.

RoutingServiceBusQueueEndpointProperties

The properties related to service bus queue endpoint types.

Name Type Description
authenticationType

authenticationType

Method used to authenticate against the service bus queue endpoint

connectionString

string

The connection string of the service bus queue endpoint.

endpointUri

string

The url of the service bus queue endpoint. It must include the protocol sb://

entityPath

string

Queue name on the service bus namespace

id

string

Id of the service bus queue endpoint

identity

ManagedIdentity

Managed identity properties of routing service bus queue endpoint.

name

string

The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue name.

resourceGroup

string

The name of the resource group of the service bus queue endpoint.

subscriptionId

string

The subscription identifier of the service bus queue endpoint.

RoutingServiceBusTopicEndpointProperties

The properties related to service bus topic endpoint types.

Name Type Description
authenticationType

authenticationType

Method used to authenticate against the service bus topic endpoint

connectionString

string

The connection string of the service bus topic endpoint.

endpointUri

string

The url of the service bus topic endpoint. It must include the protocol sb://

entityPath

string

Queue name on the service bus topic

id

string

Id of the service bus topic endpoint

identity

ManagedIdentity

Managed identity properties of routing service bus topic endpoint.

name

string

The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual topic name.

resourceGroup

string

The name of the resource group of the service bus topic endpoint.

subscriptionId

string

The subscription identifier of the service bus topic endpoint.

RoutingSource

The source that the routing rule is to be applied to, such as DeviceMessages.

Name Type Description
DeviceConnectionStateEvents

string

DeviceJobLifecycleEvents

string

DeviceLifecycleEvents

string

DeviceMessages

string

Invalid

string

TwinChangeEvents

string

RoutingStorageContainerProperties

The properties related to a storage container endpoint.

Name Type Description
authenticationType

authenticationType

Method used to authenticate against the storage endpoint

batchFrequencyInSeconds

integer

Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.

connectionString

string

The connection string of the storage account.

containerName

string

The name of storage container in the storage account.

encoding enum:
  • Avro
  • AvroDeflate
  • JSON

Encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'.

endpointUri

string

The url of the storage endpoint. It must include the protocol https://

fileNameFormat

string

File name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered.

id

string

Id of the storage container endpoint

identity

ManagedIdentity

Managed identity properties of routing storage endpoint.

maxChunkSizeInBytes

integer

Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).

name

string

The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types.

resourceGroup

string

The name of the resource group of the storage account.

subscriptionId

string

The subscription identifier of the storage account.

SharedAccessSignatureAuthorizationRule

The properties of an IoT hub shared access policy.

Name Type Description
keyName

string

The name of the shared access policy.

primaryKey

string

The primary key.

rights

AccessRights

The permissions assigned to the shared access policy.

secondaryKey

string

The secondary key.

StorageEndpointProperties

The properties of the Azure Storage endpoint for file upload.

Name Type Description
authenticationType

AuthenticationType

Specifies authentication type being used for connecting to the storage account.

connectionString

string

The connection string for the Azure Storage account to which files are uploaded.

containerName

string

The name of the root container where you upload files. The container need not exist but should be creatable using the connectionString specified.

identity

ManagedIdentity

Managed identity properties of storage endpoint for file upload.

sasTtlAsIso8601

string

The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.