共用方式為


IPolicyAssignmentsOperations.UpdateWithHttpMessagesAsync Method

Definition

Updates a policy assignment.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment>> UpdateWithHttpMessagesAsync (string scope, string policyAssignmentName, Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignmentUpdate parameters, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateWithHttpMessagesAsync : string * string * Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignmentUpdate * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment>>
Public Function UpdateWithHttpMessagesAsync (scope As String, policyAssignmentName As String, parameters As PolicyAssignmentUpdate, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of PolicyAssignment))

Parameters

scope
String

The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

policyAssignmentName
String

The name of the policy assignment.

parameters
PolicyAssignmentUpdate

Parameters for policy assignment patch request.

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Exceptions

Thrown when the operation returned an invalid status code

Thrown when unable to deserialize the response

Thrown when a required parameter is null

Remarks

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.

Applies to