Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

SecretClient Constructors

Definition

Namespace:
Azure.Security.KeyVault.Secrets
Assembly:
Azure.Security.KeyVault.Secrets.dll
Package:
Azure.Security.KeyVault.Secrets v4.11.0
Package:
Azure.Security.KeyVault.Secrets v4.8.0-beta.1

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
SecretClient()

Initializes a new instance of the SecretClient class for mocking.

SecretClient(SecretClientSettings)

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

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(SecretClientSettings)

Source:
SecretClient.cs

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

public SecretClient(Azure.Security.KeyVault.Secrets.SecretClientSettings settings);
new Azure.Security.KeyVault.Secrets.SecretClient : Azure.Security.KeyVault.Secrets.SecretClientSettings -> Azure.Security.KeyVault.Secrets.SecretClient
Public Sub New (settings As SecretClientSettings)

Parameters

settings
SecretClientSettings

The SecretClientSettings used to configure the client.

Exceptions

settings is null, or the endpoint or credential in the settings is null.

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


Feedback

Was this page helpful?