Skip to main content

vaults

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

Overview

Namevaults
TypeResource
Idazure.key_vault.vaults

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
accessPoliciesarrayAn array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. When createMode is set to recover, access policies are not required. Otherwise, access policies are required.
createModestringThe vault's create mode to indicate whether the vault need to be recovered or not. Known values are: "recover" and "default". (recover, default)
enablePurgeProtectionbooleanProperty specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value.
enableRbacAuthorizationbooleanProperty that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC.
enableSoftDeletebooleanProperty to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true by default. Once set to true, it cannot be reverted to false.
enabledForDeploymentbooleanProperty to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault.
enabledForDiskEncryptionbooleanProperty to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys.
enabledForTemplateDeploymentbooleanProperty to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault.
hsmPoolResourceIdstringThe resource id of HSM Pool.
locationstringAzure location of the key vault resource.
networkAclsobjectRules governing the accessibility of the key vault from specific network locations.
privateEndpointConnectionsarrayList of private endpoint connections associated with the key vault.
provisioningStatestringProvisioning state of the vault. Known values are: "Succeeded" and "RegisteringDns". (Succeeded, RegisteringDns)
publicNetworkAccessstringProperty to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are present we will not honor the rules.
skuobjectSKU details. Required.
softDeleteRetentionInDaysintegersoftDelete data retention days. It accepts >=7 and <=90.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectTags assigned to the key vault resource.
tenantIdstringThe Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Required.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
vaultUristringThe URI of the vault for performing operations on keys and secrets.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, vault_name, subscription_idGets the specified Azure key vault.
get_deletedselectvault_name, location, subscription_idGets the deleted Azure key vault.
check_name_availabilityselectsubscription_idChecks that the vault name is valid and is not already in use.
list_by_resource_groupselectresource_group_name, subscription_id$topThe List operation gets information about the vaults associated with the subscription and within the specified resource group.
listselectsubscription_id$topThe List operation gets information about the vaults associated with the subscription.
create_or_updateinsertresource_group_name, vault_name, subscription_id, location, propertiesCreate or update a key vault in the specified subscription.
updateupdateresource_group_name, vault_name, subscription_idUpdate a key vault in the specified subscription.
create_or_updatereplaceresource_group_name, vault_name, subscription_id, location, propertiesCreate or update a key vault in the specified subscription.
deletedeleteresource_group_name, vault_name, subscription_idDeletes the specified Azure key vault.
list_by_subscriptionexecsubscription_id$topThe List operation gets information about the vaults associated with the subscription.
list_deletedexecsubscription_idGets information about the deleted vaults in a subscription.
update_access_policyexecresource_group_name, vault_name, operation_kind, subscription_id, propertiesUpdate access policies in a key vault in the specified subscription.
purge_deletedexecvault_name, location, subscription_idPermanently deletes the specified vault. aka Purges the deleted Azure key vault.

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
locationstringThe name of the Azure region. Required.
operation_kindstringName of the operation. Known values are: "add", "replace", and "remove". Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
vault_namestringThe name of the vault. Required.
$topintegerMaximum number of results to return. Default value is None.

SELECT examples

Gets the specified Azure key vault.

SELECT
id,
name,
accessPolicies,
createMode,
enablePurgeProtection,
enableRbacAuthorization,
enableSoftDelete,
enabledForDeployment,
enabledForDiskEncryption,
enabledForTemplateDeployment,
hsmPoolResourceId,
location,
networkAcls,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
sku,
softDeleteRetentionInDays,
systemData,
tags,
tenantId,
type,
vaultUri
FROM azure.key_vault.vaults
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND vault_name = '{{ vault_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a key vault in the specified subscription.

INSERT INTO azure.key_vault.vaults (
location,
tags,
properties,
resource_group_name,
vault_name,
subscription_id
)
SELECT
'{{ location }}' /* required */,
'{{ tags }}',
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ vault_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Update a key vault in the specified subscription.

UPDATE azure.key_vault.vaults
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND vault_name = '{{ vault_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update a key vault in the specified subscription.

REPLACE azure.key_vault.vaults
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND vault_name = '{{ vault_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

Deletes the specified Azure key vault.

DELETE FROM azure.key_vault.vaults
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND vault_name = '{{ vault_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

The List operation gets information about the vaults associated with the subscription.

EXEC azure.key_vault.vaults.list_by_subscription 
@subscription_id='{{ subscription_id }}' --required,
@$top='{{ $top }}'
;