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

ManagementLocksOperationsExtensions.CreateOrUpdateAtSubscriptionLevelAsync 方法

定义

在订阅级别创建或更新管理锁。

public static System.Threading.Tasks.Task<Microsoft.Azure.Management.ResourceManager.Models.ManagementLockObject> CreateOrUpdateAtSubscriptionLevelAsync (this Microsoft.Azure.Management.ResourceManager.IManagementLocksOperations operations, string lockName, Microsoft.Azure.Management.ResourceManager.Models.ManagementLockObject parameters, System.Threading.CancellationToken cancellationToken = default);
static member CreateOrUpdateAtSubscriptionLevelAsync : Microsoft.Azure.Management.ResourceManager.IManagementLocksOperations * string * Microsoft.Azure.Management.ResourceManager.Models.ManagementLockObject * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Management.ResourceManager.Models.ManagementLockObject>
<Extension()>
Public Function CreateOrUpdateAtSubscriptionLevelAsync (operations As IManagementLocksOperations, lockName As String, parameters As ManagementLockObject, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ManagementLockObject)

参数

operations
IManagementLocksOperations

此扩展方法的操作组。

lockName
String

锁的名称。 锁名称最多可以包含 260 个字符。 它不能包含 <、、 &> :、?、/或任何控制字符。

parameters
ManagementLockObject

管理锁参数。

cancellationToken
CancellationToken

取消标记。

返回

注解

在父作用域应用锁时,所有子资源将继承同一个锁。 若要创建管理锁,必须有权访问 Microsoft.Authorization/* 或 Microsoft.Authorization/locks/* 操作。 在内置角色中,只有“所有者”和“用户访问管理员”有权执行这些操作。

适用于