az keyvault certificate

Manage Key Vault certificates.

Commands

Name Description Type Status
az keyvault certificate create

Create a certificate version from an explicit policy.

Core Preview
az keyvault certificate delete

Soft-delete all versions of a certificate.

Core Preview
az keyvault certificate download

Download a public certificate as PEM or DER.

Core Preview
az keyvault certificate import

Import a PFX or PEM certificate with its private key.

Core Preview
az keyvault certificate list

List certificate metadata across all pages.

Core Preview
az keyvault certificate list-versions

List all versions of a certificate.

Core Preview
az keyvault certificate set-attributes

Update supplied certificate attributes, tags or policy.

Core Preview
az keyvault certificate show

Read a public certificate and metadata.

Core Preview

az keyvault certificate create

Preview

Create a certificate version from an explicit policy.

Start issuance using exactly one of --policy (classic CLI or REST policy JSON, including @file) or --policy-file (UTF-8 JSON). Requires certificates/create and certificates/get when waiting. Known issuers are polled at the named pending endpoint. Default timeout is 300 seconds; --timeout accepts 1-3600 seconds. --no-wait and issuer Unknown return pending immediately. Returns a certificate operation with classic CLI field names, not a certificate bundle. Local timeout or cancellation does not cancel server issuance. External signing/CSR merge requires another tool.

az keyvault certificate create --name
                               [--enabled]
                               [--expires]
                               [--no-wait]
                               [--not-before]
                               [--policy]
                               [--policy-file]
                               [--profile]
                               [--tags]
                               [--timeout]
                               [--vault-name]
                               [--vault-url]

Examples

Create a self-signed certificate

az keyvault certificate create --vault-name myvault --name app-tls --policy '{"issuer_parameters":{"name":"Self"},"key_properties":{"key_type":"RSA","key_size":2048,"exportable":false},"secret_properties":{"content_type":"application/x-pkcs12"},"x509_certificate_properties":{"subject":"CN=app.example","validity_in_months":12}}'

Start issuance without waiting

az keyvault certificate create --vault-name myvault --name app-tls --policy-file ./policy.json --no-wait

Required Parameters

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--enabled

Whether the certificate is enabled: true or false.

--expires

Expiration timestamp in UTC.

--no-wait

Return the creation operation without polling.

--not-before

Not-before timestamp in UTC.

--policy

Certificate policy JSON using classic CLI or REST field names; @file is supported.

--policy-file

UTF-8 JSON policy file. Use instead of policy JSON.

--profile

Use the named connection profile.

--tags

Tags in NAME=VALUE form.

--timeout

Creation timeout in seconds, from 1 to 3600. Default: 300.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate delete

Preview

Soft-delete all versions of a certificate.

Delete the name, all versions and associated policy. Requires certificates/delete and explicit --yes. Returns service recovery metadata without deleted-state polling. Never purges or alters vault retention settings. Recovery is not exposed in the CLI.

az keyvault certificate delete --name
                               [--profile]
                               [--vault-name]
                               [--vault-url]
                               [--yes]

Examples

Confirm deletion

az keyvault certificate delete --vault-name myvault --name app-tls --yes

Required Parameters

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--profile

Use the named connection profile.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

--yes

Confirm deletion of all certificate versions.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate download

Preview

Download a public certificate as PEM or DER.

Write the latest or specified version's public X509 certificate to a new file. Requires certificates/get. --encoding accepts PEM (default) or DER. Existing destinations are never overwritten. Validates the certificate before file creation. Never reads a backing secret or exports a private key.

az keyvault certificate download --file
                                 --name
                                 [--encoding]
                                 [--profile]
                                 [--vault-name]
                                 [--vault-url]
                                 [--version]

Examples

Download DER

az keyvault certificate download --vault-name myvault --name app-tls --file ./app.cer --encoding DER

Required Parameters

--file

New destination for the public certificate.

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--encoding

Public certificate encoding: PEM (default) or DER.

--profile

Use the named connection profile.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

--version

certificate version. Omit for latest.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate import

Preview

Import a PFX or PEM certificate with its private key.

Import a PFX/PKCS#12 file or PEM containing a certificate and PKCS#8 private key. Requires certificates/import. Files are limited to 1 MiB. Use either --password or --password-file, not both. Prefer --password-file to avoid shell history and process-argument exposure; the file must contain the exact UTF-8 password with no extra newline. Protect and remove input files according to local policy. Request payloads/passwords are excluded from diagnostics. Optional policy content type must match the file. Public-only imports and pending-CSR merge are not supported. Output never contains the private key or password.

az keyvault certificate import --file
                               --name
                               [--enabled]
                               [--expires]
                               [--not-before]
                               [--password]
                               [--password-file]
                               [--policy]
                               [--policy-file]
                               [--profile]
                               [--tags]
                               [--vault-name]
                               [--vault-url]

Examples

Import encrypted PFX

az keyvault certificate import --vault-name myvault --name app-tls --file ./app.pfx --password-file ./password.txt

Required Parameters

--file

PFX or PEM file containing a private key.

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--enabled

Whether the certificate is enabled: true or false.

--expires

Expiration timestamp in UTC.

--not-before

Not-before timestamp in UTC.

--password

Certificate password. Prefer --password-file to avoid exposing it in shell history.

--password-file

UTF-8 password file. Contents, including newlines, are preserved.

--policy

Certificate policy JSON using classic CLI or REST field names; @file is supported.

--policy-file

UTF-8 JSON policy file. Use instead of policy JSON.

--profile

Use the named connection profile.

--tags

Tags in NAME=VALUE form.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate list

Preview

List certificate metadata across all pages.

Requires certificates/list. --maxresults is page size from 1 to 25, not total count. Omit it for the service default. --include-pending true includes incomplete certificates; explicit false is preserved. Cross-vault continuation links are rejected.

az keyvault certificate list [--include-pending]
                             [--maxresults]
                             [--profile]
                             [--vault-name]
                             [--vault-url]

Examples

List certificates

az keyvault certificate list --vault-name myvault --maxresults 25 --include-pending true

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--include-pending

Include certificates that are not completely provisioned.

--maxresults

Page size from 1 to 25. All pages are returned.

--profile

Use the named connection profile.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate list-versions

Preview

List all versions of a certificate.

Enumerate version metadata across all pages. Requires certificates/list. --maxresults is page size from 1 to 25, not total limit. No private key or backing secret is retrieved.

az keyvault certificate list-versions --name
                                      [--maxresults]
                                      [--profile]
                                      [--vault-name]
                                      [--vault-url]

Examples

List versions

az keyvault certificate list-versions --vault-name myvault --name app-tls --maxresults 1

Required Parameters

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--maxresults

Page size from 1 to 25. All pages are returned.

--profile

Use the named connection profile.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate set-attributes

Preview

Update supplied certificate attributes, tags or policy.

Preserve omitted attributes and explicit false. At least one change is required. --policy/--policy-file accepts classic CLI or REST field names and updates the name-wide policy; --version applies only to attribute changes. Policy is sent before attributes; the requests are not transactional. Policy-only update reads the latest certificate afterward. Requires certificates/update and certificates/get for that follow-up read. Dates are supported through January 2038.

az keyvault certificate set-attributes --name
                                       [--enabled]
                                       [--expires]
                                       [--not-before]
                                       [--policy]
                                       [--policy-file]
                                       [--profile]
                                       [--tags]
                                       [--vault-name]
                                       [--vault-url]
                                       [--version]

Examples

Disable a certificate

az keyvault certificate set-attributes --vault-name myvault --name app-tls --enabled false

Update policy

az keyvault certificate set-attributes --vault-name myvault --name app-tls --policy '{"x509_certificate_properties":{"validity_in_months":12}}'

Required Parameters

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--enabled

Whether the certificate is enabled: true or false.

--expires

Expiration timestamp in UTC.

--not-before

Not-before timestamp in UTC.

--policy

Certificate policy JSON using classic CLI or REST field names; @file is supported.

--policy-file

UTF-8 JSON policy file. Use instead of policy JSON.

--profile

Use the named connection profile.

--tags

Tags in NAME=VALUE form.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

--version

certificate version. Omit for latest.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az keyvault certificate show

Preview

Read a public certificate and metadata.

Get the latest certificate or an explicit --version. Requires certificates/get. Returns public bytes, policy, attributes and references. Does not follow backing secret/key references or export a private key.

az keyvault certificate show --name
                             [--profile]
                             [--vault-name]
                             [--vault-url]
                             [--version]

Examples

Show latest

az keyvault certificate show --vault-name myvault --name app-tls

Required Parameters

--name

certificate name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--profile

Use the named connection profile.

--vault-name

Azure public-cloud vault name.

--vault-url

Root HTTPS vault URL. Use instead of vault name.

--version

certificate version. Omit for latest.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.