Skip to main content

keys

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

Overview

Namekeys
TypeResource
Idazure.key_vault.keys

Fields

The following fields are returned by SELECT queries:

The retrieved key.

NameDatatypeDescription
idstringFully qualified identifier of the key vault resource.
namestringName of the key vault resource.
locationstringAzure location of the key vault resource.
propertiesobjectThe properties of the key.
tagsobjectTags assigned to the key vault resource.
typestringResource type of the key vault resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, vaultName, keyNameGets the current version of the specified key from the specified key vault.
listselectsubscriptionId, resourceGroupName, vaultNameLists the keys in the specified key vault.
create_if_not_existinsertsubscriptionId, resourceGroupName, vaultName, 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.
resourceGroupNamestringThe name of the resource group which contains the specified key vault.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
vaultNamestringThe name of the key vault which contains the key to be created.

SELECT examples

Gets the current version of the specified key from the specified key vault.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.key_vault.keys
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND vaultName = '{{ vaultName }}' -- 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.keys (
data__tags,
data__properties,
subscriptionId,
resourceGroupName,
vaultName,
keyName
)
SELECT
'{{ tags }}',
'{{ properties }}' /* required */,
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ vaultName }}',
'{{ keyName }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;