共用方式為


PolicyAssignmentResource.UpdateAsync Method

Definition

Overloads

UpdateAsync(PolicyAssignmentPatch, CancellationToken)

This operation updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Update
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
UpdateAsync(WaitUntil, PolicyAssignmentData, CancellationToken)

This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Create

UpdateAsync(PolicyAssignmentPatch, CancellationToken)

Source:
PolicyAssignmentResource.cs
Source:
PolicyAssignmentResource.cs

This operation updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Update
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.PolicyAssignmentResource>> UpdateAsync (Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch patch, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateAsync : Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.PolicyAssignmentResource>>
override this.UpdateAsync : Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.PolicyAssignmentResource>>
Public Overridable Function UpdateAsync (patch As PolicyAssignmentPatch, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of PolicyAssignmentResource))

Parameters

patch
PolicyAssignmentPatch

Parameters for policy assignment patch request.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

patch is null.

Applies to

UpdateAsync(WaitUntil, PolicyAssignmentData, CancellationToken)

Source:
PolicyAssignmentResource.cs
Source:
PolicyAssignmentResource.cs

This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Create
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.PolicyAssignmentResource>> UpdateAsync (Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.PolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateAsync : Azure.WaitUntil * Azure.ResourceManager.Resources.PolicyAssignmentData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.PolicyAssignmentResource>>
override this.UpdateAsync : Azure.WaitUntil * Azure.ResourceManager.Resources.PolicyAssignmentData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.PolicyAssignmentResource>>
Public Overridable Function UpdateAsync (waitUntil As WaitUntil, data As PolicyAssignmentData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of PolicyAssignmentResource))

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

data
PolicyAssignmentData

Parameters for the policy assignment.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

data is null.

Applies to