Skip to main content

workspace_group_user

Creates, updates, deletes, gets or lists a workspace_group_user resource.

Overview

Nameworkspace_group_user
TypeResource
Idazure.api_management.workspace_group_user

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
emailstringEmail address.
firstNamestringFirst name.
groupsarrayCollection of groups user is part of.
identitiesarrayCollection of user identities.
lastNamestringLast name.
notestringOptional note about a user set by the administrator.
registrationDatestring (date-time)Date of user registration. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
statestringAccount state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Known values are: "active", "blocked", "pending", and "deleted". (active, blocked, pending, deleted)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectresource_group_name, service_name, workspace_id, group_id, subscription_id$filter, $top, $skipLists a collection of user entities associated with the group.
createinsertresource_group_name, service_name, workspace_id, group_id, user_id, subscription_idAdd existing user to existing group.
deletedeleteresource_group_name, service_name, workspace_id, group_id, user_id, subscription_idRemove existing user from existing group.
check_entity_existsexecresource_group_name, service_name, workspace_id, group_id, user_id, subscription_idChecks that user entity specified by identifier is associated with the group entity.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
group_idstringGroup identifier. Must be unique in the current API Management service instance. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
service_namestringThe name of the API Management service. Required.
subscription_idstring
user_idstringUser identifier. Must be unique in the current API Management service instance. Required.
workspace_idstringWorkspace identifier. Must be unique in the current API Management service instance. Required.
$filterstring| Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || registrationDate | filter | ge, le, eq, ne, gt, lt | || note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |. Default value is None.
$skipintegerNumber of records to skip. Default value is None.
$topintegerNumber of records to return. Default value is None.

SELECT examples

Lists a collection of user entities associated with the group.

SELECT
id,
name,
email,
firstName,
groups,
identities,
lastName,
note,
registrationDate,
state,
systemData,
type
FROM azure.api_management.workspace_group_user
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND group_id = '{{ group_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
;

INSERT examples

Add existing user to existing group.

INSERT INTO azure.api_management.workspace_group_user (
resource_group_name,
service_name,
workspace_id,
group_id,
user_id,
subscription_id
)
SELECT
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ workspace_id }}',
'{{ group_id }}',
'{{ user_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

DELETE examples

Remove existing user from existing group.

DELETE FROM azure.api_management.workspace_group_user
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND group_id = '{{ group_id }}' --required
AND user_id = '{{ user_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Checks that user entity specified by identifier is associated with the group entity.

EXEC azure.api_management.workspace_group_user.check_entity_exists 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@workspace_id='{{ workspace_id }}' --required,
@group_id='{{ group_id }}' --required,
@user_id='{{ user_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;