1. Packages
  2. Azure Native
  3. API Docs
  4. keyvault
  5. getSecret
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

azure-native.keyvault.getSecret

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

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.

Uses Azure REST API version 2024-11-01.

Other available API versions: 2023-02-01, 2023-07-01, 2024-04-01-preview, 2024-12-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native keyvault [ApiVersion]. See the version guide for details.

Using getSecret

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSecret(args: GetSecretArgs, opts?: InvokeOptions): Promise<GetSecretResult>
function getSecretOutput(args: GetSecretOutputArgs, opts?: InvokeOptions): Output<GetSecretResult>
Copy
def get_secret(resource_group_name: Optional[str] = None,
               secret_name: Optional[str] = None,
               vault_name: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetSecretResult
def get_secret_output(resource_group_name: Optional[pulumi.Input[str]] = None,
               secret_name: Optional[pulumi.Input[str]] = None,
               vault_name: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetSecretResult]
Copy
func LookupSecret(ctx *Context, args *LookupSecretArgs, opts ...InvokeOption) (*LookupSecretResult, error)
func LookupSecretOutput(ctx *Context, args *LookupSecretOutputArgs, opts ...InvokeOption) LookupSecretResultOutput
Copy

> Note: This function is named LookupSecret in the Go SDK.

public static class GetSecret 
{
    public static Task<GetSecretResult> InvokeAsync(GetSecretArgs args, InvokeOptions? opts = null)
    public static Output<GetSecretResult> Invoke(GetSecretInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSecretResult> getSecret(GetSecretArgs args, InvokeOptions options)
public static Output<GetSecretResult> getSecret(GetSecretArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure-native:keyvault:getSecret
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group to which the vault belongs.
SecretName
This property is required.
Changes to this property will trigger replacement.
string
The name of the secret.
VaultName
This property is required.
Changes to this property will trigger replacement.
string
The name of the vault.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group to which the vault belongs.
SecretName
This property is required.
Changes to this property will trigger replacement.
string
The name of the secret.
VaultName
This property is required.
Changes to this property will trigger replacement.
string
The name of the vault.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group to which the vault belongs.
secretName
This property is required.
Changes to this property will trigger replacement.
String
The name of the secret.
vaultName
This property is required.
Changes to this property will trigger replacement.
String
The name of the vault.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group to which the vault belongs.
secretName
This property is required.
Changes to this property will trigger replacement.
string
The name of the secret.
vaultName
This property is required.
Changes to this property will trigger replacement.
string
The name of the vault.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Resource Group to which the vault belongs.
secret_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the secret.
vault_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the vault.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group to which the vault belongs.
secretName
This property is required.
Changes to this property will trigger replacement.
String
The name of the secret.
vaultName
This property is required.
Changes to this property will trigger replacement.
String
The name of the vault.

getSecret Result

The following output properties are available:

AzureApiVersion string
The Azure API version of the resource.
Id string
Fully qualified identifier of the key vault resource.
Location string
Azure location of the key vault resource.
Name string
Name of the key vault resource.
Properties Pulumi.AzureNative.KeyVault.Outputs.SecretPropertiesResponse
Properties of the secret
Tags Dictionary<string, string>
Tags assigned to the key vault resource.
Type string
Resource type of the key vault resource.
AzureApiVersion string
The Azure API version of the resource.
Id string
Fully qualified identifier of the key vault resource.
Location string
Azure location of the key vault resource.
Name string
Name of the key vault resource.
Properties SecretPropertiesResponse
Properties of the secret
Tags map[string]string
Tags assigned to the key vault resource.
Type string
Resource type of the key vault resource.
azureApiVersion String
The Azure API version of the resource.
id String
Fully qualified identifier of the key vault resource.
location String
Azure location of the key vault resource.
name String
Name of the key vault resource.
properties SecretPropertiesResponse
Properties of the secret
tags Map<String,String>
Tags assigned to the key vault resource.
type String
Resource type of the key vault resource.
azureApiVersion string
The Azure API version of the resource.
id string
Fully qualified identifier of the key vault resource.
location string
Azure location of the key vault resource.
name string
Name of the key vault resource.
properties SecretPropertiesResponse
Properties of the secret
tags {[key: string]: string}
Tags assigned to the key vault resource.
type string
Resource type of the key vault resource.
azure_api_version str
The Azure API version of the resource.
id str
Fully qualified identifier of the key vault resource.
location str
Azure location of the key vault resource.
name str
Name of the key vault resource.
properties SecretPropertiesResponse
Properties of the secret
tags Mapping[str, str]
Tags assigned to the key vault resource.
type str
Resource type of the key vault resource.
azureApiVersion String
The Azure API version of the resource.
id String
Fully qualified identifier of the key vault resource.
location String
Azure location of the key vault resource.
name String
Name of the key vault resource.
properties Property Map
Properties of the secret
tags Map<String>
Tags assigned to the key vault resource.
type String
Resource type of the key vault resource.

Supporting Types

SecretAttributesResponse

Created This property is required. int
Creation time in seconds since 1970-01-01T00:00:00Z.
Updated This property is required. int
Last updated time in seconds since 1970-01-01T00:00:00Z.
Enabled bool
Determines whether the object is enabled.
Expires int
Expiry date in seconds since 1970-01-01T00:00:00Z.
NotBefore int
Not before date in seconds since 1970-01-01T00:00:00Z.
Created This property is required. int
Creation time in seconds since 1970-01-01T00:00:00Z.
Updated This property is required. int
Last updated time in seconds since 1970-01-01T00:00:00Z.
Enabled bool
Determines whether the object is enabled.
Expires int
Expiry date in seconds since 1970-01-01T00:00:00Z.
NotBefore int
Not before date in seconds since 1970-01-01T00:00:00Z.
created This property is required. Integer
Creation time in seconds since 1970-01-01T00:00:00Z.
updated This property is required. Integer
Last updated time in seconds since 1970-01-01T00:00:00Z.
enabled Boolean
Determines whether the object is enabled.
expires Integer
Expiry date in seconds since 1970-01-01T00:00:00Z.
notBefore Integer
Not before date in seconds since 1970-01-01T00:00:00Z.
created This property is required. number
Creation time in seconds since 1970-01-01T00:00:00Z.
updated This property is required. number
Last updated time in seconds since 1970-01-01T00:00:00Z.
enabled boolean
Determines whether the object is enabled.
expires number
Expiry date in seconds since 1970-01-01T00:00:00Z.
notBefore number
Not before date in seconds since 1970-01-01T00:00:00Z.
created This property is required. int
Creation time in seconds since 1970-01-01T00:00:00Z.
updated This property is required. int
Last updated time in seconds since 1970-01-01T00:00:00Z.
enabled bool
Determines whether the object is enabled.
expires int
Expiry date in seconds since 1970-01-01T00:00:00Z.
not_before int
Not before date in seconds since 1970-01-01T00:00:00Z.
created This property is required. Number
Creation time in seconds since 1970-01-01T00:00:00Z.
updated This property is required. Number
Last updated time in seconds since 1970-01-01T00:00:00Z.
enabled Boolean
Determines whether the object is enabled.
expires Number
Expiry date in seconds since 1970-01-01T00:00:00Z.
notBefore Number
Not before date in seconds since 1970-01-01T00:00:00Z.

SecretPropertiesResponse

SecretUri This property is required. string
The URI to retrieve the current version of the secret.
SecretUriWithVersion This property is required. string
The URI to retrieve the specific version of the secret.
Attributes Pulumi.AzureNative.KeyVault.Inputs.SecretAttributesResponse
The attributes of the secret.
ContentType string
The content type of the secret.
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.
SecretUri This property is required. string
The URI to retrieve the current version of the secret.
SecretUriWithVersion This property is required. string
The URI to retrieve the specific version of the secret.
Attributes SecretAttributesResponse
The attributes of the secret.
ContentType string
The content type of the secret.
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.
secretUri This property is required. String
The URI to retrieve the current version of the secret.
secretUriWithVersion This property is required. String
The URI to retrieve the specific version of the secret.
attributes SecretAttributesResponse
The attributes of the secret.
contentType String
The content type of the secret.
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.
secretUri This property is required. string
The URI to retrieve the current version of the secret.
secretUriWithVersion This property is required. string
The URI to retrieve the specific version of the secret.
attributes SecretAttributesResponse
The attributes of the secret.
contentType string
The content type of the secret.
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.
secret_uri This property is required. str
The URI to retrieve the current version of the secret.
secret_uri_with_version This property is required. str
The URI to retrieve the specific version of the secret.
attributes SecretAttributesResponse
The attributes of the secret.
content_type str
The content type of the secret.
value str
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.
secretUri This property is required. String
The URI to retrieve the current version of the secret.
secretUriWithVersion This property is required. String
The URI to retrieve the specific version of the secret.
attributes Property Map
The attributes of the secret.
contentType String
The content type of the secret.
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.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi