We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to access information about an existing Key Vault Key.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.KeyVault.GetKey.InvokeAsync(new Azure.KeyVault.GetKeyArgs
{
Name = "secret-sauce",
KeyVaultId = data.Azurerm_key_vault.Existing.Id,
}));
this.KeyType = example.Apply(example => example.KeyType);
}
[Output("keyType")]
public Output<string> KeyType { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/keyvault"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := keyvault.LookupKey(ctx, &keyvault.LookupKeyArgs{
Name: "secret-sauce",
KeyVaultId: data.Azurerm_key_vault.Existing.Id,
}, nil)
if err != nil {
return err
}
ctx.Export("keyType", example.KeyType)
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.keyvault.getKey({
name: "secret-sauce",
keyVaultId: data.azurerm_key_vault.existing.id,
});
export const keyType = example.then(example => example.keyType);
import pulumi
import pulumi_azure as azure
example = azure.keyvault.get_key(name="secret-sauce",
key_vault_id=data["azurerm_key_vault"]["existing"]["id"])
pulumi.export("keyType", example.key_type)
Example coming soon!
Using getKey
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 getKey(args: GetKeyArgs, opts?: InvokeOptions): Promise<GetKeyResult>
function getKeyOutput(args: GetKeyOutputArgs, opts?: InvokeOptions): Output<GetKeyResult>def get_key(key_vault_id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKeyResult
def get_key_output(key_vault_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKeyResult]func LookupKey(ctx *Context, args *LookupKeyArgs, opts ...InvokeOption) (*LookupKeyResult, error)
func LookupKeyOutput(ctx *Context, args *LookupKeyOutputArgs, opts ...InvokeOption) LookupKeyResultOutput> Note: This function is named LookupKey in the Go SDK.
public static class GetKey
{
public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
public static Output<GetKeyResult> Invoke(GetKeyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
public static Output<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
fn::invoke:
function: azure:keyvault/getKey:getKey
arguments:
# arguments dictionaryThe following arguments are supported:
- Key
Vault stringId - Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource. - Name string
- Specifies the name of the Key Vault Key.
- Key
Vault stringId - Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource. - Name string
- Specifies the name of the Key Vault Key.
- key
Vault StringId - Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource. - name String
- Specifies the name of the Key Vault Key.
- key
Vault stringId - Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource. - name string
- Specifies the name of the Key Vault Key.
- key_
vault_ strid - Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource. - name str
- Specifies the name of the Key Vault Key.
- key
Vault StringId - Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource. - name String
- Specifies the name of the Key Vault Key.
getKey Result
The following output properties are available:
- Curve string
- The EC Curve name of this Key Vault Key.
- E string
- The RSA public exponent of this Key Vault Key.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Opts List<string> - A list of JSON web key operations assigned to this Key Vault Key
- Key
Size int - Specifies the Size of this Key Vault Key.
- Key
Type string - Specifies the Key Type of this Key Vault Key
- Key
Vault stringId - N string
- The RSA modulus of this Key Vault Key.
- Name string
- Public
Key stringOpenssh - The OpenSSH encoded public key of this Key Vault Key.
- Public
Key stringPem - The PEM encoded public key of this Key Vault Key.
- Dictionary<string, string>
- A mapping of tags assigned to this Key Vault Key.
- Version string
- The current version of the Key Vault Key.
- Versionless
Id string - The Base ID of the Key Vault Key.
- X string
- The EC X component of this Key Vault Key.
- Y string
- The EC Y component of this Key Vault Key.
- Curve string
- The EC Curve name of this Key Vault Key.
- E string
- The RSA public exponent of this Key Vault Key.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Opts []string - A list of JSON web key operations assigned to this Key Vault Key
- Key
Size int - Specifies the Size of this Key Vault Key.
- Key
Type string - Specifies the Key Type of this Key Vault Key
- Key
Vault stringId - N string
- The RSA modulus of this Key Vault Key.
- Name string
- Public
Key stringOpenssh - The OpenSSH encoded public key of this Key Vault Key.
- Public
Key stringPem - The PEM encoded public key of this Key Vault Key.
- map[string]string
- A mapping of tags assigned to this Key Vault Key.
- Version string
- The current version of the Key Vault Key.
- Versionless
Id string - The Base ID of the Key Vault Key.
- X string
- The EC X component of this Key Vault Key.
- Y string
- The EC Y component of this Key Vault Key.
- curve String
- The EC Curve name of this Key Vault Key.
- e String
- The RSA public exponent of this Key Vault Key.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Opts List<String> - A list of JSON web key operations assigned to this Key Vault Key
- key
Size Integer - Specifies the Size of this Key Vault Key.
- key
Type String - Specifies the Key Type of this Key Vault Key
- key
Vault StringId - n String
- The RSA modulus of this Key Vault Key.
- name String
- public
Key StringOpenssh - The OpenSSH encoded public key of this Key Vault Key.
- public
Key StringPem - The PEM encoded public key of this Key Vault Key.
- Map<String,String>
- A mapping of tags assigned to this Key Vault Key.
- version String
- The current version of the Key Vault Key.
- versionless
Id String - The Base ID of the Key Vault Key.
- x String
- The EC X component of this Key Vault Key.
- y String
- The EC Y component of this Key Vault Key.
- curve string
- The EC Curve name of this Key Vault Key.
- e string
- The RSA public exponent of this Key Vault Key.
- id string
- The provider-assigned unique ID for this managed resource.
- key
Opts string[] - A list of JSON web key operations assigned to this Key Vault Key
- key
Size number - Specifies the Size of this Key Vault Key.
- key
Type string - Specifies the Key Type of this Key Vault Key
- key
Vault stringId - n string
- The RSA modulus of this Key Vault Key.
- name string
- public
Key stringOpenssh - The OpenSSH encoded public key of this Key Vault Key.
- public
Key stringPem - The PEM encoded public key of this Key Vault Key.
- {[key: string]: string}
- A mapping of tags assigned to this Key Vault Key.
- version string
- The current version of the Key Vault Key.
- versionless
Id string - The Base ID of the Key Vault Key.
- x string
- The EC X component of this Key Vault Key.
- y string
- The EC Y component of this Key Vault Key.
- curve str
- The EC Curve name of this Key Vault Key.
- e str
- The RSA public exponent of this Key Vault Key.
- id str
- The provider-assigned unique ID for this managed resource.
- key_
opts Sequence[str] - A list of JSON web key operations assigned to this Key Vault Key
- key_
size int - Specifies the Size of this Key Vault Key.
- key_
type str - Specifies the Key Type of this Key Vault Key
- key_
vault_ strid - n str
- The RSA modulus of this Key Vault Key.
- name str
- public_
key_ stropenssh - The OpenSSH encoded public key of this Key Vault Key.
- public_
key_ strpem - The PEM encoded public key of this Key Vault Key.
- Mapping[str, str]
- A mapping of tags assigned to this Key Vault Key.
- version str
- The current version of the Key Vault Key.
- versionless_
id str - The Base ID of the Key Vault Key.
- x str
- The EC X component of this Key Vault Key.
- y str
- The EC Y component of this Key Vault Key.
- curve String
- The EC Curve name of this Key Vault Key.
- e String
- The RSA public exponent of this Key Vault Key.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Opts List<String> - A list of JSON web key operations assigned to this Key Vault Key
- key
Size Number - Specifies the Size of this Key Vault Key.
- key
Type String - Specifies the Key Type of this Key Vault Key
- key
Vault StringId - n String
- The RSA modulus of this Key Vault Key.
- name String
- public
Key StringOpenssh - The OpenSSH encoded public key of this Key Vault Key.
- public
Key StringPem - The PEM encoded public key of this Key Vault Key.
- Map<String>
- A mapping of tags assigned to this Key Vault Key.
- version String
- The current version of the Key Vault Key.
- versionless
Id String - The Base ID of the Key Vault Key.
- x String
- The EC X component of this Key Vault Key.
- y String
- The EC Y component of this Key Vault Key.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
