IKeyVaultClient.SetSecretWithHttpMessagesAsync(String, String, String, IDictionary<String,String>, String, SecretAttributes, Dictionary<String,List<String>>, CancellationToken) Method

Definition

Sets a secret in a specified key vault.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.SecretBundle>> SetSecretWithHttpMessagesAsync (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.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = null);
abstract member SetSecretWithHttpMessagesAsync : string * string * string * System.Collections.Generic.IDictionary<string, string> * string * Microsoft.Azure.KeyVault.Models.SecretAttributes * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.SecretBundle>>

Parameters

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.

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Task<Microsoft.Rest.Azure.AzureOperationResponse<SecretBundle>>

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.

Applies to