user
Creates, updates, deletes, gets or lists a user resource.
Overview
| Name | user |
| Type | Resource |
| Id | azure.api_management.user |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_service
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
email | string | Email address. |
firstName | string | First name. |
groups | array | Collection of groups user is part of. |
identities | array | Collection of user identities. |
lastName | string | Last name. |
note | string | Optional note about a user set by the administrator. |
registrationDate | string (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. |
state | string | Account 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) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
email | string | Email address. |
firstName | string | First name. |
groups | array | Collection of groups user is part of. |
identities | array | Collection of user identities. |
lastName | string | Last name. |
note | string | Optional note about a user set by the administrator. |
registrationDate | string (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. |
state | string | Account 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) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, service_name, user_id, subscription_id | Gets the details of the user specified by its identifier. | |
list_by_service | select | resource_group_name, service_name, subscription_id | $filter, $top, $skip, expandGroups | Lists a collection of registered users in the specified service instance. |
create_or_update | insert | resource_group_name, service_name, user_id, subscription_id | notify | Creates or Updates a user. |
update | update | resource_group_name, service_name, user_id, subscription_id | Updates the details of the user specified by its identifier. | |
create_or_update | replace | resource_group_name, service_name, user_id, subscription_id | notify | Creates or Updates a user. |
delete | delete | resource_group_name, service_name, user_id, subscription_id | deleteSubscriptions, notify, appType | Deletes specific user. |
get_entity_tag | exec | resource_group_name, service_name, user_id, subscription_id | Gets the entity state (Etag) version of the user specified by its identifier. | |
get_shared_access_token | exec | resource_group_name, service_name, user_id, subscription_id | Gets the Shared Access Authorization Token for the User. | |
generate_sso_url | exec | resource_group_name, service_name, user_id, subscription_id | Retrieves 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.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
service_name | string | The name of the API Management service. Required. |
subscription_id | string | |
user_id | string | User identifier. Must be unique in the current API Management service instance. Required. |
$filter | string | | 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. |
$skip | integer | Number of records to skip. Default value is None. |
$top | integer | Number of records to return. Default value is None. |
appType | string | Determines 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. |
deleteSubscriptions | boolean | Whether to delete user's subscription or not. Default value is None. |
expandGroups | boolean | Detailed Group in response. Default value is None. |
notify | boolean | Send an Account Closed Email notification to the User. Default value is None. |
SELECT examples
- get
- list_by_service
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
;
Lists a collection of registered users in the specified service instance.
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 subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
AND expandGroups = '{{ expandGroups }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: user
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the user resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the user resource.
- name: user_id
value: "{{ user_id }}"
description: Required parameter for the user resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the user resource.
- name: properties
description: |
User entity create contract properties.
value:
state: "{{ state }}"
note: "{{ note }}"
identities:
- provider: "{{ provider }}"
id: "{{ id }}"
email: "{{ email }}"
firstName: "{{ firstName }}"
lastName: "{{ lastName }}"
password: "{{ password }}"
appType: "{{ appType }}"
confirmation: "{{ confirmation }}"
- name: notify
value: {{ notify }}
description: Send an Email notification to the User. Default value is None.
description: Send an Email notification to the User. Default value is None.
UPDATE examples
- update
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
- create_or_update
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
- delete
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
- get_entity_tag
- get_shared_access_token
- generate_sso_url
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
;
Gets the Shared Access Authorization Token for the User.
EXEC azure.api_management.user.get_shared_access_token
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@user_id='{{ user_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal.
EXEC azure.api_management.user.generate_sso_url
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@user_id='{{ user_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;