你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

BatchAccountOperationsExtensions.RegenerateKeyAsync 方法

定义

重新生成 Batch 帐户的指定帐户密钥。

public static System.Threading.Tasks.Task<Microsoft.Azure.Management.Batch.Models.BatchAccountKeys> RegenerateKeyAsync (this Microsoft.Azure.Management.Batch.IBatchAccountOperations operations, string resourceGroupName, string accountName, Microsoft.Azure.Management.Batch.Models.AccountKeyType keyName, System.Threading.CancellationToken cancellationToken = default);
static member RegenerateKeyAsync : Microsoft.Azure.Management.Batch.IBatchAccountOperations * string * string * Microsoft.Azure.Management.Batch.Models.AccountKeyType * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Management.Batch.Models.BatchAccountKeys>
<Extension()>
Public Function RegenerateKeyAsync (operations As IBatchAccountOperations, resourceGroupName As String, accountName As String, keyName As AccountKeyType, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BatchAccountKeys)

参数

operations
IBatchAccountOperations

此扩展方法的操作组。

resourceGroupName
String

包含 Batch 帐户的资源组的名称。

accountName
String

Batch 帐户的名称。

keyName
AccountKeyType

要重新生成的帐户密钥的类型。 可能的值包括:“Primary”、“Secondary”

cancellationToken
CancellationToken

取消标记。

返回

注解

此操作仅适用于包含“SharedKey”的 allowedAuthenticationModes 的 Batch 帐户。 如果 Batch 帐户在其 allowedAuthenticationMode 中不包含“SharedKey”,则客户端无法使用共享密钥进行身份验证,并且必须改用其他 allowedAuthenticationModes。 在这种情况下,重新生成密钥将失败。

适用于