共用方式為


KeyVaultClientExtensions.UpdateSecretAsync Method

Definition

Overloads

UpdateSecretAsync(IKeyVaultClient, String, String, SecretAttributes, Dictionary<String,String>, CancellationToken)

Updates the attributes associated with the specified secret

UpdateSecretAsync(IKeyVaultClient, String, String, String, String, SecretAttributes, IDictionary<String,String>, CancellationToken)

Updates the attributes associated with a specified secret in a given key vault.

UpdateSecretAsync(IKeyVaultClient, String, String, SecretAttributes, Dictionary<String,String>, CancellationToken)

Source:
KeyVaultClientExtensions.cs

Updates the attributes associated with the specified secret

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.SecretBundle> UpdateSecretAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string secretIdentifier, string contentType = default, Microsoft.Azure.KeyVault.Models.SecretAttributes secretAttributes = default, System.Collections.Generic.Dictionary<string,string> tags = default, System.Threading.CancellationToken cancellationToken = default);
static member UpdateSecretAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * Microsoft.Azure.KeyVault.Models.SecretAttributes * System.Collections.Generic.Dictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.SecretBundle>
<Extension()>
Public Function UpdateSecretAsync (operations As IKeyVaultClient, secretIdentifier As String, Optional contentType As String = Nothing, Optional secretAttributes As SecretAttributes = Nothing, Optional tags As Dictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SecretBundle)

Parameters

operations
IKeyVaultClient
secretIdentifier
String

The URL of the secret

contentType
String

Type of the secret value such as password.

secretAttributes
SecretAttributes

Attributes for the secret. For more information on possible attributes, see SecretAttributes.

tags
Dictionary<String,String>

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

cancellationToken
CancellationToken

Optional cancellation token

Returns

A response message containing the updated secret

Applies to

UpdateSecretAsync(IKeyVaultClient, String, String, String, String, SecretAttributes, IDictionary<String,String>, CancellationToken)

Source:
KeyVaultClientExtensions.cs

Updates the attributes associated with a specified secret in a given key vault.

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.SecretBundle> UpdateSecretAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string secretName, string secretVersion, string contentType = default, Microsoft.Azure.KeyVault.Models.SecretAttributes secretAttributes = default, System.Collections.Generic.IDictionary<string,string> tags = default, System.Threading.CancellationToken cancellationToken = default);
static member UpdateSecretAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * string * string * Microsoft.Azure.KeyVault.Models.SecretAttributes * System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.SecretBundle>
<Extension()>
Public Function UpdateSecretAsync (operations As IKeyVaultClient, vaultBaseUrl As String, secretName As String, secretVersion As String, Optional contentType As String = Nothing, Optional secretAttributes As SecretAttributes = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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.

secretVersion
String

The version of the secret.

contentType
String

Type of the secret value such as a password.

secretAttributes
SecretAttributes

The secret management attributes.

tags
IDictionary<String,String>

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

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.

Applies to