Share via


DataCollectionRuleCollection.CreateOrUpdateAsync Method

Definition

Creates or updates a data collection rule.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}
  • Operation Id: DataCollectionRules_Create
  • Default Api Version: 2022-06-01
  • Resource: DataCollectionRuleResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.DataCollectionRuleResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string dataCollectionRuleName, Azure.ResourceManager.Monitor.DataCollectionRuleData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Monitor.DataCollectionRuleData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.DataCollectionRuleResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Monitor.DataCollectionRuleData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.DataCollectionRuleResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, dataCollectionRuleName As String, data As DataCollectionRuleData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of DataCollectionRuleResource))

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.

dataCollectionRuleName
String

The name of the data collection rule. The name is case insensitive.

data
DataCollectionRuleData

The payload.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

dataCollectionRuleName is an empty string, and was expected to be non-empty.

dataCollectionRuleName or data is null.

Applies to