Skip to main content

user

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

Overview

Nameuser
TypeResource
Idazure.api_management.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
getselectresource_group_name, service_name, user_id, subscription_idGets the details of the user specified by its identifier.
list_by_serviceselectresource_group_name, service_name, subscription_id$filter, $top, $skip, expandGroupsLists a collection of registered users in the specified service instance.
create_or_updateinsertresource_group_name, service_name, user_id, subscription_idnotifyCreates or Updates a user.
updateupdateresource_group_name, service_name, user_id, subscription_idUpdates the details of the user specified by its identifier.
create_or_updatereplaceresource_group_name, service_name, user_id, subscription_idnotifyCreates or Updates a user.
deletedeleteresource_group_name, service_name, user_id, subscription_iddeleteSubscriptions, notify, appTypeDeletes specific user.
get_entity_tagexecresource_group_name, service_name, user_id, subscription_idGets the entity state (Etag) version of the user specified by its identifier.
get_shared_access_tokenexecresource_group_name, service_name, user_id, subscription_idGets the Shared Access Authorization Token for the User.
generate_sso_urlexecresource_group_name, service_name, user_id, subscription_idRetrieves a redirection URL containing an authentication token for signing a given user into the developer portal.

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
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.
$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 || state | filter | eq | || registrationDate | filter | ge, le, eq, ne, gt, lt | || note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || groups | expand | | |. Default value is None.
$skipintegerNumber of records to skip. Default value is None.
$topintegerNumber of records to return. Default value is None.
appTypestringDetermines the type of application which send the create user request. Default is legacy publisher portal. Known values are: "portal" and "developerPortal". Default value is None.
deleteSubscriptionsbooleanWhether to delete user's subscription or not. Default value is None.
expandGroupsbooleanDetailed Group in response. Default value is None.
notifybooleanSend an Account Closed Email notification to the User. Default value is None.

SELECT examples

Gets the details of the user specified by its identifier.

SELECT
id,
name,
email,
firstName,
groups,
identities,
lastName,
note,
registrationDate,
state,
systemData,
type
FROM azure.api_management.user
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND user_id = '{{ user_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or Updates a user.

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

UPDATE examples

Updates the details of the user specified by its identifier.

UPDATE azure.api_management.user
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND user_id = '{{ user_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

REPLACE examples

Creates or Updates a user.

REPLACE azure.api_management.user
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND user_id = '{{ user_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND notify = {{ notify}}
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Deletes specific user.

DELETE FROM azure.api_management.user
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND user_id = '{{ user_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND deleteSubscriptions = '{{ deleteSubscriptions }}'
AND notify = '{{ notify }}'
AND appType = '{{ appType }}'
;

Lifecycle Methods

Gets the entity state (Etag) version of the user specified by its identifier.

EXEC azure.api_management.user.get_entity_tag 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@user_id='{{ user_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;