Skip to main content

managed_hsm_keys

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

Overview

Namemanaged_hsm_keys
TypeResource
Idazure.key_vault.managed_hsm_keys

Fields

The following fields are returned by SELECT queries:

The retrieved key.

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
namestringThe name of the resource
propertiesobjectThe properties of the key.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, name, keyNameGets the current version of the specified key from the specified managed HSM.
listselectsubscriptionId, resourceGroupName, nameLists the keys in the specified managed HSM.
create_if_not_existinsertsubscriptionId, resourceGroupName, name, keyName, data__propertiesCreates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.

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
keyNamestringThe name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
namestringThe name of the Managed HSM Pool within the specified resource group.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

SELECT examples

Gets the current version of the specified key from the specified managed HSM.

SELECT
id,
name,
properties,
tags,
type
FROM azure.key_vault.managed_hsm_keys
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND name = '{{ name }}' -- required
AND keyName = '{{ keyName }}' -- required
;

INSERT examples

Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.

INSERT INTO azure.key_vault.managed_hsm_keys (
data__tags,
data__properties,
subscriptionId,
resourceGroupName,
name,
keyName
)
SELECT
'{{ tags }}',
'{{ properties }}' /* required */,
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ name }}',
'{{ keyName }}'
RETURNING
id,
name,
properties,
tags,
type
;