Skip to main content

secrets

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

Overview

Namesecrets
TypeResource
Idazure.key_vault.secrets

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.
attributesobjectThe attributes of the secret.
contentTypestringThe content type of the secret.
locationstringAzure location of the key vault resource.
secretUristringThe URI to retrieve the current version of the secret.
secretUriWithVersionstringThe URI to retrieve the specific version of the secret.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectTags assigned to the key vault resource.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
valuestringThe value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, vault_name, secret_name, subscription_idGets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
listselectresource_group_name, vault_name, subscription_id$topThe List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
create_or_updateinsertresource_group_name, vault_name, secret_name, subscription_id, propertiesCreate or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
updateupdateresource_group_name, vault_name, secret_name, subscription_idUpdate a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
create_or_updatereplaceresource_group_name, vault_name, secret_name, subscription_id, propertiesCreate or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

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
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
secret_namestringThe name of the secret. 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 secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

SELECT
id,
name,
attributes,
contentType,
location,
secretUri,
secretUriWithVersion,
systemData,
tags,
type,
value
FROM azure.key_vault.secrets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND vault_name = '{{ vault_name }}' -- required
AND secret_name = '{{ secret_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

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

UPDATE examples

Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

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

REPLACE examples

Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

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