iot_hub_resource
Creates, updates, deletes, gets or lists an iot_hub_resource resource.
Overview
| Name | iot_hub_resource |
| Type | Resource |
| Id | azure.iot_hub.iot_hub_resource |
Fields
The following fields are returned by SELECT queries:
- get_event_hub_consumer_group
- list_event_hub_consumer_groups
- get_job
- get_keys_for_key_name
- get
- get_endpoint_health
- list_by_resource_group
- check_name_availability
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
etag | string | The etag. |
properties | object | The tags. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
etag | string | The etag. |
properties | object | The tags. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
endTimeUtc | string (date-time) | The time the job stopped processing. |
failureReason | string | If status == failed, this string containing the reason for the failure. |
jobId | string | The job identifier. |
parentJobId | string | The job identifier of the parent job, if any. |
startTimeUtc | string (date-time) | The start time of the job. |
status | string | The status of the job. Known values are: "unknown", "enqueued", "running", "completed", "failed", and "cancelled". (unknown, enqueued, running, completed, failed, cancelled) |
statusMessage | string | The status message for the job. |
type | string | The type of the job. Known values are: "unknown", "export", "import", "backup", "readDeviceProperties", "writeDeviceProperties", "updateDeviceConfiguration", "rebootDevice", "factoryResetDevice", and "firmwareUpdate". (unknown, export, import, backup, readDeviceProperties, writeDeviceProperties, updateDeviceConfiguration, rebootDevice, factoryResetDevice, firmwareUpdate) |
| Name | Datatype | Description |
|---|---|---|
keyName | string | The name of the shared access policy. Required. |
primaryKey | string | The primary key. |
rights | string | The permissions assigned to the shared access policy. Required. Known values are: "RegistryRead", "RegistryWrite", "ServiceConnect", "DeviceConnect", "RegistryRead, RegistryWrite", "RegistryRead, ServiceConnect", "RegistryRead, DeviceConnect", "RegistryWrite, ServiceConnect", "RegistryWrite, DeviceConnect", "ServiceConnect, DeviceConnect", "RegistryRead, RegistryWrite, ServiceConnect", "RegistryRead, RegistryWrite, DeviceConnect", "RegistryRead, ServiceConnect, DeviceConnect", "RegistryWrite, ServiceConnect, DeviceConnect", and "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect". (RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect, RegistryRead, RegistryWrite, RegistryRead, ServiceConnect, RegistryRead, DeviceConnect, RegistryWrite, ServiceConnect, RegistryWrite, DeviceConnect, ServiceConnect, DeviceConnect, RegistryRead, RegistryWrite, ServiceConnect, RegistryRead, RegistryWrite, DeviceConnect, RegistryRead, ServiceConnect, DeviceConnect, RegistryWrite, ServiceConnect, DeviceConnect, RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect) |
secondaryKey | string | The secondary key. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allowedFqdnList | array | List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. |
authorizationPolicies | array | The shared access policies you can use to secure a connection to the IoT hub. |
cloudToDevice | object | The IoT hub cloud-to-device messaging properties. |
comments | string | IoT hub comments. |
deviceHostName | string | The name of the device host. Supports secure connections over TLS 1.3. |
deviceRegistry | object | Represents properties related to the Azure Device Registry (ADR). |
deviceStreams | object | The device streams properties of iothub. |
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. |
encryption | object | The encryption properties for the IoT hub. |
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. |
eventHubEndpoints | object | 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 | string | The capabilities and features enabled for the IoT hub. Known values are: "None" and "DeviceManagement". (None, DeviceManagement) |
hostName | string | The name of the host. |
identity | object | The managed identities for the IotHub. |
iotHubDetails | object | Set of additional read-only properties for the IoT hub. |
ipFilterRules | array | The IP filter rules. |
ipVersion | string | This property specifies the IP Version the hub is currently utilizing. Known values are: "ipv4", "ipv6", and "ipv4ipv6". (ipv4, ipv6, ipv4ipv6) |
location | string | The geo-location where the resource lives. Required. |
locations | array | Primary and secondary location for iot hub. |
messagingEndpoints | object | 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 | object | Network Rule Set Properties of IotHub. |
privateEndpointConnections | array | Private endpoint connections created on this IotHub. |
provisioningState | string | The provisioning state. |
publicNetworkAccess | string | Whether requests from Public Network are allowed. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
restrictOutboundNetworkAccess | boolean | If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList. |
rootCertificate | object | This property store root certificate related information. |
routing | object | The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging _. |
serviceHostName | string | The name of the service host. Supports secure connections over TLS 1.3. |
sku | object | IotHub SKU info. Required. |
state | string | The hub state. |
storageEndpoints | object | 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
endpointId | string | Id of the endpoint. |
healthStatus | string | Health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint. Known values are: "unknown", "healthy", "degraded", "unhealthy", and "dead". (unknown, healthy, degraded, unhealthy, dead) |
lastKnownError | string | Last error obtained when a message failed to be delivered to iot hub. |
lastKnownErrorTime | string (date-time) | Time at which the last known error occurred. |
lastSendAttemptTime | string (date-time) | Last time iot hub tried to send a message to the endpoint. |
lastSuccessfulSendAttemptTime | string (date-time) | Last time iot hub successfully sent a message to the endpoint. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allowedFqdnList | array | List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. |
authorizationPolicies | array | The shared access policies you can use to secure a connection to the IoT hub. |
cloudToDevice | object | The IoT hub cloud-to-device messaging properties. |
comments | string | IoT hub comments. |
deviceHostName | string | The name of the device host. Supports secure connections over TLS 1.3. |
deviceRegistry | object | Represents properties related to the Azure Device Registry (ADR). |
deviceStreams | object | The device streams properties of iothub. |
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. |
encryption | object | The encryption properties for the IoT hub. |
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. |
eventHubEndpoints | object | 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 | string | The capabilities and features enabled for the IoT hub. Known values are: "None" and "DeviceManagement". (None, DeviceManagement) |
hostName | string | The name of the host. |
identity | object | The managed identities for the IotHub. |
iotHubDetails | object | Set of additional read-only properties for the IoT hub. |
ipFilterRules | array | The IP filter rules. |
ipVersion | string | This property specifies the IP Version the hub is currently utilizing. Known values are: "ipv4", "ipv6", and "ipv4ipv6". (ipv4, ipv6, ipv4ipv6) |
location | string | The geo-location where the resource lives. Required. |
locations | array | Primary and secondary location for iot hub. |
messagingEndpoints | object | 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 | object | Network Rule Set Properties of IotHub. |
privateEndpointConnections | array | Private endpoint connections created on this IotHub. |
provisioningState | string | The provisioning state. |
publicNetworkAccess | string | Whether requests from Public Network are allowed. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
restrictOutboundNetworkAccess | boolean | If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList. |
rootCertificate | object | This property store root certificate related information. |
routing | object | The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging _. |
serviceHostName | string | The name of the service host. Supports secure connections over TLS 1.3. |
sku | object | IotHub SKU info. Required. |
state | string | The hub state. |
storageEndpoints | object | 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
message | string | The detailed reason message. |
nameAvailable | boolean | The value which indicates whether the provided name is available. |
reason | string | The reason for unavailability. Known values are: "Invalid" and "AlreadyExists". (Invalid, AlreadyExists) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allowedFqdnList | array | List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. |
authorizationPolicies | array | The shared access policies you can use to secure a connection to the IoT hub. |
cloudToDevice | object | The IoT hub cloud-to-device messaging properties. |
comments | string | IoT hub comments. |
deviceHostName | string | The name of the device host. Supports secure connections over TLS 1.3. |
deviceRegistry | object | Represents properties related to the Azure Device Registry (ADR). |
deviceStreams | object | The device streams properties of iothub. |
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. |
encryption | object | The encryption properties for the IoT hub. |
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. |
eventHubEndpoints | object | 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 | string | The capabilities and features enabled for the IoT hub. Known values are: "None" and "DeviceManagement". (None, DeviceManagement) |
hostName | string | The name of the host. |
identity | object | The managed identities for the IotHub. |
iotHubDetails | object | Set of additional read-only properties for the IoT hub. |
ipFilterRules | array | The IP filter rules. |
ipVersion | string | This property specifies the IP Version the hub is currently utilizing. Known values are: "ipv4", "ipv6", and "ipv4ipv6". (ipv4, ipv6, ipv4ipv6) |
location | string | The geo-location where the resource lives. Required. |
locations | array | Primary and secondary location for iot hub. |
messagingEndpoints | object | 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 | object | Network Rule Set Properties of IotHub. |
privateEndpointConnections | array | Private endpoint connections created on this IotHub. |
provisioningState | string | The provisioning state. |
publicNetworkAccess | string | Whether requests from Public Network are allowed. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
restrictOutboundNetworkAccess | boolean | If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList. |
rootCertificate | object | This property store root certificate related information. |
routing | object | The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging _. |
serviceHostName | string | The name of the service host. Supports secure connections over TLS 1.3. |
sku | object | IotHub SKU info. Required. |
state | string | The hub state. |
storageEndpoints | object | 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_event_hub_consumer_group | select | resource_group_name, resource_name, event_hub_endpoint_name, name, subscription_id | Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. | |
list_event_hub_consumer_groups | select | resource_group_name, resource_name, event_hub_endpoint_name, subscription_id | Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. | |
get_job | select | resource_group_name, resource_name, job_id, subscription_id | Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry . Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry . | |
get_keys_for_key_name | select | resource_group_name, resource_name, key_name, subscription_id | Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . | |
get | select | resource_group_name, resource_name, subscription_id | Get the non-security related metadata of an IoT hub. Get the non-security related metadata of an IoT hub. | |
get_endpoint_health | select | resource_group_name, iot_hub_name, subscription_id | Get the health for routing endpoints. Get the health for routing endpoints. | |
list_by_resource_group | select | resource_group_name, subscription_id | Get all the IoT hubs in a resource group. Get all the IoT hubs in a resource group. | |
check_name_availability | select | subscription_id | Check if an IoT hub name is available. Check if an IoT hub name is available. | |
list_by_subscription | select | subscription_id | Get all the IoT hubs in a subscription. Get all the IoT hubs in a subscription. | |
create_or_update | insert | resource_group_name, resource_name, subscription_id, location, sku | Create or update the metadata of an IoT hub. 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. | |
update | update | resource_group_name, resource_name, subscription_id | Update an existing IoT Hubs tags. Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. | |
create_or_update | replace | resource_group_name, resource_name, subscription_id, location, sku | Create or update the metadata of an IoT hub. 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. | |
delete | delete | resource_group_name, resource_name, subscription_id | Delete an IoT hub. Delete an IoT hub. | |
list_jobs | exec | resource_group_name, resource_name, subscription_id | Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry . Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry . | |
list_keys | exec | resource_group_name, resource_name, subscription_id | Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . | |
get_valid_skus | exec | resource_group_name, resource_name, subscription_id | Get the list of valid SKUs for an IoT hub. Get the list of valid SKUs for an IoT hub. | |
get_quota_metrics | exec | resource_group_name, resource_name, subscription_id | Get the quota metrics for an IoT hub. Get the quota metrics for an IoT hub. | |
get_stats | exec | resource_group_name, resource_name, subscription_id | Get the statistics from an IoT hub. Get the statistics from an IoT hub. | |
create_event_hub_consumer_group | exec | resource_group_name, resource_name, event_hub_endpoint_name, name, subscription_id, properties | Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. | |
delete_event_hub_consumer_group | exec | resource_group_name, resource_name, event_hub_endpoint_name, name, subscription_id | Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. | |
test_all_routes | exec | iot_hub_name, resource_group_name, subscription_id | Test all routes. Test all routes configured in this Iot Hub. | |
test_route | exec | iot_hub_name, resource_group_name, subscription_id, route | Test the new route. Test the new route for this Iot Hub. | |
export_devices | exec | resource_group_name, resource_name, subscription_id, exportBlobContainerUri, excludeKeys | Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities . Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities . | |
import_devices | exec | resource_group_name, resource_name, subscription_id, inputBlobContainerUri, outputBlobContainerUri | Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities . Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities . |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
event_hub_endpoint_name | string | The name of the EventHubEndpoint. Required. |
iot_hub_name | string | Required. |
job_id | string | The job identifier. Required. |
key_name | string | The name of the shared access policy. Required. |
name | string | The name of the consumer group to retrieve. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
resource_name | string | The name of the IoT hub. Required. |
subscription_id | string |
SELECT examples
- get_event_hub_consumer_group
- list_event_hub_consumer_groups
- get_job
- get_keys_for_key_name
- get
- get_endpoint_health
- list_by_resource_group
- check_name_availability
- list_by_subscription
Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.
SELECT
id,
name,
etag,
properties,
systemData,
type
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND event_hub_endpoint_name = '{{ event_hub_endpoint_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.
SELECT
id,
name,
etag,
properties,
systemData,
type
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND event_hub_endpoint_name = '{{ event_hub_endpoint_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry . Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry .
SELECT
endTimeUtc,
failureReason,
jobId,
parentJobId,
startTimeUtc,
status,
statusMessage,
type
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND job_id = '{{ job_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security .
SELECT
keyName,
primaryKey,
rights,
secondaryKey
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND key_name = '{{ key_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get the non-security related metadata of an IoT hub. Get the non-security related metadata of an IoT hub.
SELECT
id,
name,
allowedFqdnList,
authorizationPolicies,
cloudToDevice,
comments,
deviceHostName,
deviceRegistry,
deviceStreams,
disableDeviceSAS,
disableLocalAuth,
disableModuleSAS,
enableDataResidency,
enableFileUploadNotifications,
encryption,
etag,
eventHubEndpoints,
features,
hostName,
identity,
iotHubDetails,
ipFilterRules,
ipVersion,
location,
locations,
messagingEndpoints,
minTlsVersion,
networkRuleSets,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
restrictOutboundNetworkAccess,
rootCertificate,
routing,
serviceHostName,
sku,
state,
storageEndpoints,
systemData,
tags,
type
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get the health for routing endpoints. Get the health for routing endpoints.
SELECT
endpointId,
healthStatus,
lastKnownError,
lastKnownErrorTime,
lastSendAttemptTime,
lastSuccessfulSendAttemptTime
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND iot_hub_name = '{{ iot_hub_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get all the IoT hubs in a resource group. Get all the IoT hubs in a resource group.
SELECT
id,
name,
allowedFqdnList,
authorizationPolicies,
cloudToDevice,
comments,
deviceHostName,
deviceRegistry,
deviceStreams,
disableDeviceSAS,
disableLocalAuth,
disableModuleSAS,
enableDataResidency,
enableFileUploadNotifications,
encryption,
etag,
eventHubEndpoints,
features,
hostName,
identity,
iotHubDetails,
ipFilterRules,
ipVersion,
location,
locations,
messagingEndpoints,
minTlsVersion,
networkRuleSets,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
restrictOutboundNetworkAccess,
rootCertificate,
routing,
serviceHostName,
sku,
state,
storageEndpoints,
systemData,
tags,
type
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Check if an IoT hub name is available. Check if an IoT hub name is available.
SELECT
message,
nameAvailable,
reason
FROM azure.iot_hub.iot_hub_resource
WHERE subscription_id = '{{ subscription_id }}' -- required
;
Get all the IoT hubs in a subscription. Get all the IoT hubs in a subscription.
SELECT
id,
name,
allowedFqdnList,
authorizationPolicies,
cloudToDevice,
comments,
deviceHostName,
deviceRegistry,
deviceStreams,
disableDeviceSAS,
disableLocalAuth,
disableModuleSAS,
enableDataResidency,
enableFileUploadNotifications,
encryption,
etag,
eventHubEndpoints,
features,
hostName,
identity,
iotHubDetails,
ipFilterRules,
ipVersion,
location,
locations,
messagingEndpoints,
minTlsVersion,
networkRuleSets,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
restrictOutboundNetworkAccess,
rootCertificate,
routing,
serviceHostName,
sku,
state,
storageEndpoints,
systemData,
tags,
type
FROM azure.iot_hub.iot_hub_resource
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update the metadata of an IoT hub. 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.
INSERT INTO azure.iot_hub.iot_hub_resource (
tags,
location,
properties,
etag,
sku,
identity,
resource_group_name,
resource_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ etag }}',
'{{ sku }}' /* required */,
'{{ identity }}',
'{{ resource_group_name }}',
'{{ resource_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: iot_hub_resource
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the iot_hub_resource resource.
- name: resource_name
value: "{{ resource_name }}"
description: Required parameter for the iot_hub_resource resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the iot_hub_resource resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
IotHub properties.
value:
authorizationPolicies:
- keyName: "{{ keyName }}"
primaryKey: "{{ primaryKey }}"
secondaryKey: "{{ secondaryKey }}"
rights: "{{ rights }}"
disableLocalAuth: {{ disableLocalAuth }}
disableDeviceSAS: {{ disableDeviceSAS }}
disableModuleSAS: {{ disableModuleSAS }}
restrictOutboundNetworkAccess: {{ restrictOutboundNetworkAccess }}
allowedFqdnList:
- "{{ allowedFqdnList }}"
publicNetworkAccess: "{{ publicNetworkAccess }}"
ipFilterRules:
- filterName: "{{ filterName }}"
action: "{{ action }}"
ipMask: "{{ ipMask }}"
networkRuleSets:
defaultAction: "{{ defaultAction }}"
applyToBuiltInEventHubEndpoint: {{ applyToBuiltInEventHubEndpoint }}
ipRules:
- filterName: "{{ filterName }}"
action: "{{ action }}"
ipMask: "{{ ipMask }}"
minTlsVersion: "{{ minTlsVersion }}"
privateEndpointConnections:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
systemData:
createdBy: "{{ createdBy }}"
createdByType: "{{ createdByType }}"
createdAt: "{{ createdAt }}"
lastModifiedBy: "{{ lastModifiedBy }}"
lastModifiedByType: "{{ lastModifiedByType }}"
lastModifiedAt: "{{ lastModifiedAt }}"
properties:
privateEndpoint:
id: "{{ id }}"
privateLinkServiceConnectionState:
status: "{{ status }}"
description: "{{ description }}"
actionsRequired: "{{ actionsRequired }}"
provisioningState: "{{ provisioningState }}"
state: "{{ state }}"
hostName: "{{ hostName }}"
deviceHostName: "{{ deviceHostName }}"
serviceHostName: "{{ serviceHostName }}"
eventHubEndpoints: "{{ eventHubEndpoints }}"
routing:
endpoints:
serviceBusQueues:
- id: "{{ id }}"
connectionString: "{{ connectionString }}"
endpointUri: "{{ endpointUri }}"
entityPath: "{{ entityPath }}"
authenticationType: "{{ authenticationType }}"
identity:
userAssignedIdentity: "{{ userAssignedIdentity }}"
name: "{{ name }}"
subscriptionId: "{{ subscriptionId }}"
resourceGroup: "{{ resourceGroup }}"
serviceBusTopics:
- id: "{{ id }}"
connectionString: "{{ connectionString }}"
endpointUri: "{{ endpointUri }}"
entityPath: "{{ entityPath }}"
authenticationType: "{{ authenticationType }}"
identity:
userAssignedIdentity: "{{ userAssignedIdentity }}"
name: "{{ name }}"
subscriptionId: "{{ subscriptionId }}"
resourceGroup: "{{ resourceGroup }}"
eventHubs:
- id: "{{ id }}"
connectionString: "{{ connectionString }}"
endpointUri: "{{ endpointUri }}"
entityPath: "{{ entityPath }}"
authenticationType: "{{ authenticationType }}"
identity:
userAssignedIdentity: "{{ userAssignedIdentity }}"
name: "{{ name }}"
subscriptionId: "{{ subscriptionId }}"
resourceGroup: "{{ resourceGroup }}"
storageContainers:
- id: "{{ id }}"
connectionString: "{{ connectionString }}"
endpointUri: "{{ endpointUri }}"
authenticationType: "{{ authenticationType }}"
identity:
userAssignedIdentity: "{{ userAssignedIdentity }}"
name: "{{ name }}"
subscriptionId: "{{ subscriptionId }}"
resourceGroup: "{{ resourceGroup }}"
containerName: "{{ containerName }}"
fileNameFormat: "{{ fileNameFormat }}"
batchFrequencyInSeconds: {{ batchFrequencyInSeconds }}
maxChunkSizeInBytes: {{ maxChunkSizeInBytes }}
encoding: "{{ encoding }}"
cosmosDBSqlContainers:
- name: "{{ name }}"
id: "{{ id }}"
subscriptionId: "{{ subscriptionId }}"
resourceGroup: "{{ resourceGroup }}"
endpointUri: "{{ endpointUri }}"
authenticationType: "{{ authenticationType }}"
identity:
userAssignedIdentity: "{{ userAssignedIdentity }}"
primaryKey: "{{ primaryKey }}"
secondaryKey: "{{ secondaryKey }}"
databaseName: "{{ databaseName }}"
containerName: "{{ containerName }}"
partitionKeyName: "{{ partitionKeyName }}"
partitionKeyTemplate: "{{ partitionKeyTemplate }}"
routes:
- name: "{{ name }}"
source: "{{ source }}"
condition: "{{ condition }}"
endpointNames: "{{ endpointNames }}"
isEnabled: {{ isEnabled }}
fallbackRoute:
name: "{{ name }}"
source: "{{ source }}"
condition: "{{ condition }}"
endpointNames:
- "{{ endpointNames }}"
isEnabled: {{ isEnabled }}
enrichments:
- key: "{{ key }}"
value: "{{ value }}"
endpointNames: "{{ endpointNames }}"
storageEndpoints: "{{ storageEndpoints }}"
messagingEndpoints: "{{ messagingEndpoints }}"
enableFileUploadNotifications: {{ enableFileUploadNotifications }}
cloudToDevice:
maxDeliveryCount: {{ maxDeliveryCount }}
defaultTtlAsIso8601: "{{ defaultTtlAsIso8601 }}"
feedback:
lockDurationAsIso8601: "{{ lockDurationAsIso8601 }}"
ttlAsIso8601: "{{ ttlAsIso8601 }}"
maxDeliveryCount: {{ maxDeliveryCount }}
comments: "{{ comments }}"
deviceStreams:
streamingEndpoints:
- "{{ streamingEndpoints }}"
features: "{{ features }}"
encryption:
keySource: "{{ keySource }}"
keyVaultProperties:
- keyIdentifier: "{{ keyIdentifier }}"
identity:
userAssignedIdentity: "{{ userAssignedIdentity }}"
locations:
- location: "{{ location }}"
role: "{{ role }}"
enableDataResidency: {{ enableDataResidency }}
rootCertificate:
enableRootCertificateV2: {{ enableRootCertificateV2 }}
lastUpdatedTimeUtc: "{{ lastUpdatedTimeUtc }}"
ipVersion: "{{ ipVersion }}"
deviceRegistry:
namespaceResourceId: "{{ namespaceResourceId }}"
identityResourceId: "{{ identityResourceId }}"
iotHubDetails:
gatewayVersion: "{{ gatewayVersion }}"
- name: etag
value: "{{ etag }}"
description: |
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.
- name: sku
description: |
IotHub SKU info. Required.
value:
name: "{{ name }}"
tier: "{{ tier }}"
capacity: {{ capacity }}
- name: identity
description: |
The managed identities for the IotHub.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
UPDATE examples
- update
Update an existing IoT Hubs tags. Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method.
UPDATE azure.iot_hub.iot_hub_resource
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Create or update the metadata of an IoT hub. 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.
REPLACE azure.iot_hub.iot_hub_resource
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
etag = '{{ etag }}',
sku = '{{ sku }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND sku = '{{ sku }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type;
DELETE examples
- delete
Delete an IoT hub. Delete an IoT hub.
DELETE FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- list_jobs
- list_keys
- get_valid_skus
- get_quota_metrics
- get_stats
- create_event_hub_consumer_group
- delete_event_hub_consumer_group
- test_all_routes
- test_route
- export_devices
- import_devices
Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry . Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry .
EXEC azure.iot_hub.iot_hub_resource.list_jobs
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security .
EXEC azure.iot_hub.iot_hub_resource.list_keys
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Get the list of valid SKUs for an IoT hub. Get the list of valid SKUs for an IoT hub.
EXEC azure.iot_hub.iot_hub_resource.get_valid_skus
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Get the quota metrics for an IoT hub. Get the quota metrics for an IoT hub.
EXEC azure.iot_hub.iot_hub_resource.get_quota_metrics
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Get the statistics from an IoT hub. Get the statistics from an IoT hub.
EXEC azure.iot_hub.iot_hub_resource.get_stats
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
EXEC azure.iot_hub.iot_hub_resource.create_event_hub_consumer_group
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@event_hub_endpoint_name='{{ event_hub_endpoint_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
EXEC azure.iot_hub.iot_hub_resource.delete_event_hub_consumer_group
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@event_hub_endpoint_name='{{ event_hub_endpoint_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Test all routes. Test all routes configured in this Iot Hub.
EXEC azure.iot_hub.iot_hub_resource.test_all_routes
@iot_hub_name='{{ iot_hub_name }}' --required,
@resource_group_name='{{ resource_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"routingSource": "{{ routingSource }}",
"message": "{{ message }}",
"twin": "{{ twin }}"
}'
;
Test the new route. Test the new route for this Iot Hub.
EXEC azure.iot_hub.iot_hub_resource.test_route
@iot_hub_name='{{ iot_hub_name }}' --required,
@resource_group_name='{{ resource_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"message": "{{ message }}",
"route": "{{ route }}",
"twin": "{{ twin }}"
}'
;
Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities . Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities .
EXEC azure.iot_hub.iot_hub_resource.export_devices
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"exportBlobContainerUri": "{{ exportBlobContainerUri }}",
"excludeKeys": {{ excludeKeys }},
"exportBlobName": "{{ exportBlobName }}",
"authenticationType": "{{ authenticationType }}",
"identity": "{{ identity }}",
"includeConfigurations": {{ includeConfigurations }},
"configurationsBlobName": "{{ configurationsBlobName }}"
}'
;
Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities . Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities .
EXEC azure.iot_hub.iot_hub_resource.import_devices
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"inputBlobContainerUri": "{{ inputBlobContainerUri }}",
"outputBlobContainerUri": "{{ outputBlobContainerUri }}",
"inputBlobName": "{{ inputBlobName }}",
"outputBlobName": "{{ outputBlobName }}",
"authenticationType": "{{ authenticationType }}",
"identity": "{{ identity }}",
"includeConfigurations": {{ includeConfigurations }},
"configurationsBlobName": "{{ configurationsBlobName }}"
}'
;