다음을 통해 공유


SecretClient Constructors

Definition

Overloads

SecretClient()

Initializes a new instance of the SecretClient class for mocking.

SecretClient(Uri, TokenCredential)

Initializes a new instance of the SecretClient class for the specified vault.

SecretClient(Uri, TokenCredential, SecretClientOptions)

Initializes a new instance of the SecretClient class for the specified vault.

SecretClient()

Source:
SecretClient.cs
Source:
SecretClient.cs

Initializes a new instance of the SecretClient class for mocking.

protected SecretClient ();
Protected Sub New ()

Applies to

SecretClient(Uri, TokenCredential)

Source:
SecretClient.cs
Source:
SecretClient.cs

Initializes a new instance of the SecretClient class for the specified vault.

public SecretClient (Uri vaultUri, Azure.Core.TokenCredential credential);
new Azure.Security.KeyVault.Secrets.SecretClient : Uri * Azure.Core.TokenCredential -> Azure.Security.KeyVault.Secrets.SecretClient
Public Sub New (vaultUri As Uri, credential As TokenCredential)

Parameters

vaultUri
Uri

A Uri to the vault on which the client operates. Appears as "DNS Name" in the Azure portal. If you have a secret Uri, use KeyVaultSecretIdentifier to parse the VaultUri and other information. You should validate that this URI references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details.

credential
TokenCredential

A TokenCredential used to authenticate requests to the vault, such as DefaultAzureCredential.

Exceptions

vaultUri or credential is null.

Applies to

SecretClient(Uri, TokenCredential, SecretClientOptions)

Source:
SecretClient.cs
Source:
SecretClient.cs

Initializes a new instance of the SecretClient class for the specified vault.

public SecretClient (Uri vaultUri, Azure.Core.TokenCredential credential, Azure.Security.KeyVault.Secrets.SecretClientOptions options);
new Azure.Security.KeyVault.Secrets.SecretClient : Uri * Azure.Core.TokenCredential * Azure.Security.KeyVault.Secrets.SecretClientOptions -> Azure.Security.KeyVault.Secrets.SecretClient
Public Sub New (vaultUri As Uri, credential As TokenCredential, options As SecretClientOptions)

Parameters

vaultUri
Uri

A Uri to the vault on which the client operates. Appears as "DNS Name" in the Azure portal. If you have a secret Uri, use KeyVaultSecretIdentifier to parse the VaultUri and other information. You should validate that this URI references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details.

credential
TokenCredential

A TokenCredential used to authenticate requests to the vault, such as DefaultAzureCredential.

options
SecretClientOptions

SecretClientOptions that allow to configure the management of the request sent to Key Vault.

Exceptions

vaultUri or credential is null.

Applies to