certificates
Creates, updates, deletes, gets or lists a certificates resource.
Overview
| Name | certificates |
| Type | Resource |
| Id | azure.key_vault_certificates.certificates |
Fields
The following fields are returned by SELECT queries:
- get_certificate
- get_certificates
| Name | Datatype | Description |
|---|---|---|
id | string | The certificate id. |
attributes | object | The certificate attributes. |
cer | string (byte) | CER contents of x509 certificate. |
contentType | string | The content type of the secret. eg. 'application/x-pem-file' or 'application/x-pkcs12'. |
kid | string | The key id. |
policy | object | The management policy. |
preserveCertOrder | boolean | Specifies whether the certificate chain preserves its original order. The default value is false, which sets the leaf certificate at index 0. |
sid | string | The secret id. |
tags | object | Application specific metadata in the form of key-value pairs. |
x5t | string (byte) | Thumbprint of the certificate. |
| Name | Datatype | Description |
|---|---|---|
id | string | Certificate identifier. |
attributes | object | The certificate management attributes. |
tags | object | Application specific metadata in the form of key-value pairs. |
x5t | string (byte) | Thumbprint of the certificate. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_certificate | select | certificate_name, certificate_version, vault_name | Gets information about a certificate. Gets information about a specific certificate. This operation requires the certificates/get permission. | |
get_certificates | select | vault_name | maxresults, includePending | List certificates in a specified key vault. The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. |
create_certificate | insert | certificate_name, vault_name | Creates a new certificate. If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. | |
update_certificate | update | certificate_name, certificate_version, vault_name | Updates the specified attributes associated with the given certificate. The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. | |
delete_certificate | delete | certificate_name, vault_name | Deletes a certificate from a specified key vault. Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. | |
backup_certificate | exec | certificate_name, vault_name | Backs up the specified certificate. Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. | |
restore_certificate | exec | vault_name, value | Restores a backed up certificate to a vault. Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. |
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 |
|---|---|---|
certificate_name | string | The name of the certificate. Required. |
certificate_version | string | The version of the certificate. Required. |
vault_name | string | Key vault name. (default: ) |
includePending | boolean | Specifies whether to include certificates which are not completely provisioned. Default value is None. |
maxresults | integer | Maximum number of results to return in a page. If not specified the service will return up to 25 results. Default value is None. |
SELECT examples
- get_certificate
- get_certificates
Gets information about a certificate. Gets information about a specific certificate. This operation requires the certificates/get permission.
SELECT
id,
attributes,
cer,
contentType,
kid,
policy,
preserveCertOrder,
sid,
tags,
x5t
FROM azure.key_vault_certificates.certificates
WHERE certificate_name = '{{ certificate_name }}' -- required
AND certificate_version = '{{ certificate_version }}' -- required
AND vault_name = '{{ vault_name }}' -- required
;
List certificates in a specified key vault. The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
SELECT
id,
attributes,
tags,
x5t
FROM azure.key_vault_certificates.certificates
WHERE vault_name = '{{ vault_name }}' -- required
AND maxresults = '{{ maxresults }}'
AND includePending = '{{ includePending }}'
;
INSERT examples
- create_certificate
- Manifest
Creates a new certificate. If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
INSERT INTO azure.key_vault_certificates.certificates (
policy,
attributes,
tags,
preserveCertOrder,
certificate_name,
vault_name
)
SELECT
'{{ policy }}',
'{{ attributes }}',
'{{ tags }}',
{{ preserveCertOrder }},
'{{ certificate_name }}',
'{{ vault_name }}'
RETURNING
id,
request_id,
cancellation_requested,
csr,
error,
issuer,
preserveCertOrder,
status,
status_details,
target
;
# Description fields are for documentation purposes
- name: certificates
props:
- name: certificate_name
value: "{{ certificate_name }}"
description: Required parameter for the certificates resource.
- name: vault_name
value: "{{ vault_name }}"
description: Required parameter for the certificates resource.
- name: policy
description: |
The management policy for the certificate.
value:
id: "{{ id }}"
key_props:
exportable: {{ exportable }}
kty: "{{ kty }}"
key_size: {{ key_size }}
reuse_key: {{ reuse_key }}
crv: "{{ crv }}"
secret_props:
contentType: "{{ contentType }}"
x509_props:
subject: "{{ subject }}"
ekus:
- "{{ ekus }}"
sans:
emails:
- "{{ emails }}"
dns_names:
- "{{ dns_names }}"
upns:
- "{{ upns }}"
uris:
- "{{ uris }}"
ipAddresses:
- "{{ ipAddresses }}"
key_usage:
- "{{ key_usage }}"
validity_months: {{ validity_months }}
lifetime_actions:
- trigger:
lifetime_percentage: {{ lifetime_percentage }}
days_before_expiry: {{ days_before_expiry }}
action:
action_type: "{{ action_type }}"
issuer:
name: "{{ name }}"
cty: "{{ cty }}"
cert_transparency: {{ cert_transparency }}
attributes:
enabled: {{ enabled }}
nbf: "{{ nbf }}"
exp: "{{ exp }}"
created: "{{ created }}"
updated: "{{ updated }}"
recoverableDays: {{ recoverableDays }}
recoveryLevel: "{{ recoveryLevel }}"
platformManaged:
certificateUsage: "{{ certificateUsage }}"
metadata: "{{ metadata }}"
- name: attributes
description: |
The attributes of the certificate (optional).
value:
enabled: {{ enabled }}
nbf: "{{ nbf }}"
exp: "{{ exp }}"
created: "{{ created }}"
updated: "{{ updated }}"
recoverableDays: {{ recoverableDays }}
recoveryLevel: "{{ recoveryLevel }}"
- name: tags
value: "{{ tags }}"
description: |
Application specific metadata in the form of key-value pairs.
- name: preserveCertOrder
value: {{ preserveCertOrder }}
description: |
Specifies whether the certificate chain preserves its original order. The default value is false, which sets the leaf certificate at index 0.
UPDATE examples
- update_certificate
Updates the specified attributes associated with the given certificate. The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission.
UPDATE azure.key_vault_certificates.certificates
SET
policy = '{{ policy }}',
attributes = '{{ attributes }}',
tags = '{{ tags }}'
WHERE
certificate_name = '{{ certificate_name }}' --required
AND certificate_version = '{{ certificate_version }}' --required
AND vault_name = '{{ vault_name }}' --required
RETURNING
id,
attributes,
cer,
contentType,
kid,
policy,
preserveCertOrder,
sid,
tags,
x5t;
DELETE examples
- delete_certificate
Deletes a certificate from a specified key vault. Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
DELETE FROM azure.key_vault_certificates.certificates
WHERE certificate_name = '{{ certificate_name }}' --required
AND vault_name = '{{ vault_name }}' --required
;
Lifecycle Methods
- backup_certificate
- restore_certificate
Backs up the specified certificate. Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.
EXEC azure.key_vault_certificates.certificates.backup_certificate
@certificate_name='{{ certificate_name }}' --required,
@vault_name='{{ vault_name }}' --required
;
Restores a backed up certificate to a vault. Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.
EXEC azure.key_vault_certificates.certificates.restore_certificate
@vault_name='{{ vault_name }}' --required
@@json=
'{
"value": "{{ value }}"
}'
;