Groups - Create Or Replace

Create a Group

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/groups/{groupName}?api-version=2026-11-02-preview

URI Parameters

Name In Required Type Description
groupName
path True

string

minLength: 3
maxLength: 63
pattern: ^[0-9a-zA-Z][a-zA-Z0-9-]*$

The name of the group.

namespaceName
path True

string

minLength: 3
maxLength: 64
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

The name of the namespace.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
location True

string

The geo-location where the resource lives

properties

GroupProperties

The resource-specific properties for this resource.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

Group

Resource 'Group' update operation succeeded

201 Created

Group

Resource 'Group' create operation succeeded

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create or replace a Group of devices

Sample request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-3/groups/my-group-1?api-version=2026-11-02-preview

{
  "location": "West Europe",
  "tags": {
    "environment": "production"
  },
  "properties": {
    "description": "This group contains all temperature sensors in building 1",
    "displayName": "Building 1 Temperature Sensors",
    "groupType": "RegistryDevice",
    "queryFilter": "where properties.attributes.deviceType == 'sensor' and properties.attributes.sensorType == 'temperature'"
  }
}

Sample response

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-3/groups/my-group-1",
  "name": "my-group-1",
  "type": "Microsoft.DeviceRegistry/namespaces/groups",
  "location": "West Europe",
  "tags": {
    "environment": "production"
  },
  "systemData": {
    "createdBy": "00003442-0000-0000-0000-494059220000",
    "createdByType": "Application",
    "createdAt": "2026-01-15T10:30:00Z",
    "lastModifiedBy": "00003442-0000-0000-0000-494059220000",
    "lastModifiedByType": "Application",
    "lastModifiedAt": "2026-03-20T14:45:00Z"
  },
  "properties": {
    "uuid": "cfbef47a-6971-4c90-a7a9-99be82dea167",
    "description": "This group contains all temperature sensors in building 1",
    "displayName": "Building 1 Temperature Sensors",
    "groupType": "RegistryDevice",
    "queryFilter": "where properties.attributes.deviceType == 'sensor' and properties.attributes.sensorType == 'temperature'",
    "membershipState": "Ready",
    "lastMembershipRefreshTime": "2024-10-01T00:36:43.2516899Z",
    "provisioningState": "Succeeded"
  }
}
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-3/groups/my-group-1",
  "name": "my-group-1",
  "type": "Microsoft.DeviceRegistry/namespaces/groups",
  "location": "West Europe",
  "systemData": {
    "createdBy": "00003442-0000-0000-0000-494059220000",
    "createdByType": "Application",
    "createdAt": "2026-01-15T10:30:00Z",
    "lastModifiedBy": "00003442-0000-0000-0000-494059220000",
    "lastModifiedByType": "Application",
    "lastModifiedAt": "2026-03-20T14:45:00Z"
  },
  "properties": {
    "provisioningState": "Accepted",
    "groupType": "RegistryDevice",
    "queryFilter": "properties.manufacturer = 'Contoso'"
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

Group

A flexible grouping mechanism that allows devices to be grouped by their property values.

GroupMembershipState

The membership state of a group.

GroupProperties

The group properties.

GroupType

The type of group.

ProvisioningState

The provisioning status of the resource.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

Group

A flexible grouping mechanism that allows devices to be grouped by their property values.

Name Type Description
id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties

GroupProperties

The resource-specific properties for this resource.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

GroupMembershipState

The membership state of a group.

Value Description
Creating

The group is being created.

RefreshingMembers

The group is refreshing its members.

Ready

The group is ready.

FailedToResolveMembers

The group failed to resolve its members.

GroupProperties

The group properties.

Name Type Description
description

string

maxLength: 1024

Human-readable description of the resource.

displayName

string

maxLength: 256

Human-readable display name for the resource.

groupType

GroupType

The type of group that determines what kind of resources can be members.

lastMembershipRefreshTime

string (date-time)

A timestamp indicating the last time the group membership was refreshed.

membershipState

GroupMembershipState

The membership state of the group.

provisioningState

ProvisioningState

Provisioning state of the resource.

queryFilter

string

The filter string used to determine group membership. To define a group that contains all devices in the namespace, use "*".

uuid

string

Globally unique, immutable, non-reusable ID.

GroupType

The type of group.

Value Description
RegistryDevice

A group of devices.

ProvisioningState

The provisioning status of the resource.

Value Description
Succeeded

Resource has been created.

Failed

Resource creation failed.

Canceled

Resource creation was canceled.

Accepted

Resource has been accepted by the server.

Deleting

Resource is deleting.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.