Skip to main content

resource_keys

Creates, updates, deletes, gets or lists a resource_keys resource.

Overview

Nameresource_keys
TypeResource
Idazure.iot_hub.resource_keys

Fields

The following fields are returned by SELECT queries:

This is a synchronous operation. The body contains a JSON-serialized array of shared access policies, including keys, that you can use to access the IoT hub endpoints.

NameDatatypeDescription
keyNamestringThe name of the shared access policy.
primaryKeystringThe primary key.
rightsstringThe permissions assigned to the shared access policy.
secondaryKeystringThe secondary key.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubscriptionId, resourceGroupName, resourceNameapi-versionGet the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

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.

NameDatatypeDescription
resourceGroupNamestringThe name of the resource group that contains the IoT hub.
resourceNamestringThe name of the IoT hub.
subscriptionIdstringThe subscription identifier.
api-versionstringThe version of the API.

SELECT examples

Get the security metadata for 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.resource_keys
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND api-version = '{{ api-version }}'
;