Udostępnij za pośrednictwem


KeyVaultClient.SetSecretWithHttpMessagesAsync 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 = default, string contentType = default, Microsoft.Azure.KeyVault.Models.SecretAttributes secretAttributes = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
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>>
override this.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>>
Public Function SetSecretWithHttpMessagesAsync (vaultBaseUrl As String, secretName As String, value As String, Optional tags As IDictionary(Of String, String) = Nothing, Optional contentType As String = Nothing, Optional secretAttributes As SecretAttributes = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of 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>>

Headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Implements

Exceptions

Thrown when the operation returned an invalid status code

Thrown when unable to deserialize the response

Thrown when a required parameter is null

Thrown when a required parameter is null

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