DeviceRegistryNamespaceDeviceCollection.CreateOrUpdate Method

Definition

Create a NamespaceDevice

  • Request Path. : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}.
  • Operation Id. : NamespaceDevices_CreateOrReplace.
  • Default Api Version. : 2026-03-01-preview.
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.DeviceRegistry.DeviceRegistryNamespaceDeviceResource> CreateOrUpdate(Azure.WaitUntil waitUntil, string deviceName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryNamespaceDeviceData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.DeviceRegistry.DeviceRegistryNamespaceDeviceData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.DeviceRegistry.DeviceRegistryNamespaceDeviceResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.DeviceRegistry.DeviceRegistryNamespaceDeviceData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.DeviceRegistry.DeviceRegistryNamespaceDeviceResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, deviceName As String, data As DeviceRegistryNamespaceDeviceData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of DeviceRegistryNamespaceDeviceResource)

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.

deviceName
String

The name of the device.

data
DeviceRegistryNamespaceDeviceData

Resource create parameters.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

deviceName or data is null.

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

Applies to