ConnectionPolicyCollection.CreateOrUpdate Method

Definition

Creates a ConnectionPolicy if it doesn't exist else updates the existing one.

  • Request Path. : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/connectionPolicies/{connectionPolicyName}.
  • Operation Id. : ConnectionPolicies_CreateOrUpdate.
  • Default Api Version. : 2025-07-01.
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Network.ConnectionPolicyResource> CreateOrUpdate(Azure.WaitUntil waitUntil, string connectionPolicyName, Azure.ResourceManager.Network.ConnectionPolicyData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Network.ConnectionPolicyData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Network.ConnectionPolicyResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Network.ConnectionPolicyData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Network.ConnectionPolicyResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, connectionPolicyName As String, data As ConnectionPolicyData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of ConnectionPolicyResource)

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.

connectionPolicyName
String

The name of the ConnectionPolicy that is unique within a VirtualHub. This name can be used to access the resource.

data
ConnectionPolicyData

Parameters supplied to create or update a ConnectionPolicy.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

connectionPolicyName or data is null.

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

Applies to