resource_keys_for_key_names
Creates, updates, deletes, gets or lists a resource_keys_for_key_names
resource.
Overview
Name | resource_keys_for_key_names |
Type | Resource |
Id | azure.iot_hub.resource_keys_for_key_names |
Fields
The following fields are returned by SELECT
queries:
- get
This is a synchronous operation. The body contains a JSON-serialized shared access policy, including keys, that you can use to access one or more IoT hub endpoints.
Name | Datatype | Description |
---|---|---|
keyName | string | The name of the shared access policy. |
primaryKey | string | The primary key. |
rights | string | The permissions assigned to the shared access policy. |
secondaryKey | string | The secondary key. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , resourceName , keyName | api-version | 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. |
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 |
---|---|---|
keyName | string | The name of the shared access policy. |
resourceGroupName | string | The name of the resource group that contains the IoT hub. |
resourceName | string | The name of the IoT hub. |
subscriptionId | string | The subscription identifier. |
api-version | string | The version of the API. |
SELECT
examples
- get
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.resource_keys_for_key_names
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND keyName = '{{ keyName }}' -- required
AND api-version = '{{ api-version }}'
;