1. Packages
  2. Azure Classic
  3. API Docs
  4. keyvault
  5. getSecrets

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.keyvault.getSecrets

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to retrieve a list of secret names from an existing Key Vault Secret.

Using getSecrets

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 getSecrets(args: GetSecretsArgs, opts?: InvokeOptions): Promise<GetSecretsResult>
function getSecretsOutput(args: GetSecretsOutputArgs, opts?: InvokeOptions): Output<GetSecretsResult>
Copy
def get_secrets(key_vault_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetSecretsResult
def get_secrets_output(key_vault_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetSecretsResult]
Copy
func GetSecrets(ctx *Context, args *GetSecretsArgs, opts ...InvokeOption) (*GetSecretsResult, error)
func GetSecretsOutput(ctx *Context, args *GetSecretsOutputArgs, opts ...InvokeOption) GetSecretsResultOutput
Copy

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

public static class GetSecrets 
{
    public static Task<GetSecretsResult> InvokeAsync(GetSecretsArgs args, InvokeOptions? opts = null)
    public static Output<GetSecretsResult> Invoke(GetSecretsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSecretsResult> getSecrets(GetSecretsArgs args, InvokeOptions options)
public static Output<GetSecretsResult> getSecrets(GetSecretsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:keyvault/getSecrets:getSecrets
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

KeyVaultId This property is required. string

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.

KeyVaultId This property is required. string

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.

keyVaultId This property is required. String

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.

keyVaultId This property is required. string

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.

key_vault_id This property is required. str

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.

keyVaultId This property is required. String

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.

getSecrets Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
KeyVaultId string
Names List<string>
List containing names of secrets that exist in this Key Vault.
Secrets List<GetSecretsSecret>
One or more secrets blocks as defined below.
Id string
The provider-assigned unique ID for this managed resource.
KeyVaultId string
Names []string
List containing names of secrets that exist in this Key Vault.
Secrets []GetSecretsSecret
One or more secrets blocks as defined below.
id String
The provider-assigned unique ID for this managed resource.
keyVaultId String
names List<String>
List containing names of secrets that exist in this Key Vault.
secrets List<GetSecretsSecret>
One or more secrets blocks as defined below.
id string
The provider-assigned unique ID for this managed resource.
keyVaultId string
names string[]
List containing names of secrets that exist in this Key Vault.
secrets GetSecretsSecret[]
One or more secrets blocks as defined below.
id str
The provider-assigned unique ID for this managed resource.
key_vault_id str
names Sequence[str]
List containing names of secrets that exist in this Key Vault.
secrets Sequence[GetSecretsSecret]
One or more secrets blocks as defined below.
id String
The provider-assigned unique ID for this managed resource.
keyVaultId String
names List<String>
List containing names of secrets that exist in this Key Vault.
secrets List<Property Map>
One or more secrets blocks as defined below.

Supporting Types

GetSecretsSecret

Enabled This property is required. bool
Whether this secret is enabled.
Id This property is required. string
The ID of this secret.
Name This property is required. string
The name of secret.
Tags This property is required. Dictionary<string, string>
The tags of this secret.
Enabled This property is required. bool
Whether this secret is enabled.
Id This property is required. string
The ID of this secret.
Name This property is required. string
The name of secret.
Tags This property is required. map[string]string
The tags of this secret.
enabled This property is required. Boolean
Whether this secret is enabled.
id This property is required. String
The ID of this secret.
name This property is required. String
The name of secret.
tags This property is required. Map<String,String>
The tags of this secret.
enabled This property is required. boolean
Whether this secret is enabled.
id This property is required. string
The ID of this secret.
name This property is required. string
The name of secret.
tags This property is required. {[key: string]: string}
The tags of this secret.
enabled This property is required. bool
Whether this secret is enabled.
id This property is required. str
The ID of this secret.
name This property is required. str
The name of secret.
tags This property is required. Mapping[str, str]
The tags of this secret.
enabled This property is required. Boolean
Whether this secret is enabled.
id This property is required. String
The ID of this secret.
name This property is required. String
The name of secret.
tags This property is required. Map<String>
The tags of this secret.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi