HciVmSecurityRuleCollection.CreateOrUpdateAsync Method

Definition

Creates or updates a security rule in the specified resource group.

  • Request Path. : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}.
  • Operation Id. : SecurityRules_CreateOrUpdate.
  • Default Api Version. : 2025-09-01-preview.
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Hci.Vm.HciVmSecurityRuleResource>> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string securityRuleName, Azure.ResourceManager.Hci.Vm.HciVmSecurityRuleData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Hci.Vm.HciVmSecurityRuleData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Hci.Vm.HciVmSecurityRuleResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Hci.Vm.HciVmSecurityRuleData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Hci.Vm.HciVmSecurityRuleResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, securityRuleName As String, data As HciVmSecurityRuleData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of HciVmSecurityRuleResource))

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.

securityRuleName
String

Name of the security rule.

data
HciVmSecurityRuleData

Resource create parameters.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

securityRuleName or data is null.

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

Applies to