secrets
Creates, updates, deletes, gets or lists a secrets resource.
Overview
| Name | secrets |
| Type | Resource |
| Id | azure.key_vault.secrets |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
attributes | object | The attributes of the secret. |
contentType | string | The content type of the secret. |
location | string | Azure location of the key vault resource. |
secretUri | string | The URI to retrieve the current version of the secret. |
secretUriWithVersion | string | The URI to retrieve the specific version of the secret. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags assigned to the key vault resource. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
value | string | The 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
attributes | object | The attributes of the secret. |
contentType | string | The content type of the secret. |
location | string | Azure location of the key vault resource. |
secretUri | string | The URI to retrieve the current version of the secret. |
secretUriWithVersion | string | The URI to retrieve the specific version of the secret. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags assigned to the key vault resource. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
value | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, vault_name, secret_name, subscription_id | 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. | |
list | select | resource_group_name, vault_name, subscription_id | $top | The 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_update | insert | resource_group_name, vault_name, secret_name, subscription_id, properties | 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. | |
update | update | resource_group_name, vault_name, secret_name, subscription_id | 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. | |
create_or_update | replace | resource_group_name, vault_name, secret_name, subscription_id, properties | 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. |
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 |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
secret_name | string | The name of the secret. Required. |
subscription_id | string | |
vault_name | string | The name of the vault. Required. |
$top | integer | Maximum number of results to return. Default value is None. |
SELECT examples
- get
- list
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
;
The 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.
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 subscription_id = '{{ subscription_id }}' -- required
AND $top = '{{ $top }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: secrets
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the secrets resource.
- name: vault_name
value: "{{ vault_name }}"
description: Required parameter for the secrets resource.
- name: secret_name
value: "{{ secret_name }}"
description: Required parameter for the secrets resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the secrets resource.
- name: tags
value: "{{ tags }}"
description: |
The tags that will be assigned to the secret.
- name: properties
description: |
Properties of the secret. Required.
value:
value: "{{ value }}"
contentType: "{{ contentType }}"
attributes:
enabled: {{ enabled }}
nbf: "{{ nbf }}"
exp: "{{ exp }}"
created: "{{ created }}"
updated: "{{ updated }}"
secretUri: "{{ secretUri }}"
secretUriWithVersion: "{{ secretUriWithVersion }}"
UPDATE examples
- update
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
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;