Skip to content
Docs Try Aspire

AzureKeyVaultResource Methods

Class Methods 3 members
A resource that represents an Azure Key Vault.
AddAsExistingResource(AzureResourceInfrastructure) Section titled AddAsExistingResource(AzureResourceInfrastructure) override ProvisionableResource
Adds a new Primitives.ProvisionableResource into infra. The new resource represents a reference to the current Azure.AzureProvisioningResource via https://learn.microsoft.com/azure/azure-resource-manager/bicep/existing-resource.
public class AzureKeyVaultResource
{
public override ProvisionableResource AddAsExistingResource(
AzureResourceInfrastructure infra)
{
// ...
}
}
infra AzureResourceInfrastructure The Azure.AzureResourceInfrastructure to add the existing resource into.
ProvisionableResource A new Primitives.ProvisionableResource, typically using the FromExisting method on the derived Primitives.ProvisionableResource class.
GetConnectionStringAsync(CancellationToken) Section titled GetConnectionStringAsync(CancellationToken) ValueTask<string?>
Gets the connection string for the Azure Key Vault resource.
public class AzureKeyVaultResource
{
public ValueTask<string?> GetConnectionStringAsync(
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
cancellationToken CancellationToken optional A Threading.CancellationToken to observe while waiting for the task to complete.
ValueTask<string?> The connection string for the Azure Key Vault resource.
GetSecret(string) Section titled GetSecret(string) IAzureKeyVaultSecretReference
Gets a secret reference for the specified secret name.
public class AzureKeyVaultResource
{
public IAzureKeyVaultSecretReference GetSecret(
string secretName)
{
// ...
}
}
secretName string
ArgumentException