KeyVaultClientExtensions.SetSecretAsync(IKeyVaultClient, String, String, String, IDictionary<String,String>, String, SecretAttributes, CancellationToken) Method

Definition

Sets a secret in a specified key vault.

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.SecretBundle> SetSecretAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string secretName, string value, System.Collections.Generic.IDictionary<string,string> tags = null, string contentType = null, Microsoft.Azure.KeyVault.Models.SecretAttributes secretAttributes = null, System.Threading.CancellationToken cancellationToken = null);
static member SetSecretAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * string * System.Collections.Generic.IDictionary<string, string> * string * Microsoft.Azure.KeyVault.Models.SecretAttributes * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.SecretBundle>

Parameters

operations
IKeyVaultClient

The operations group for this extension method.

vaultBaseUrl
String

The vault name, for example https://myvault.vault.azure.net.

secretName
String

The name of the secret.

value
String

The value of the secret.

tags
IDictionary<String,String>

Application specific metadata in the form of key-value pairs.

contentType
String

Type of the secret value such as a password.

secretAttributes
SecretAttributes

The secret management attributes.

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

The SET operation adds a secret to the Azure Key Vault. If the named secret

already exists, Azure Key Vault creates a new version of that secret. This

operation requires the secrets/set permission.

Applies to