Entities - List

List all entities (Management Groups, Subscriptions, etc.) for the authenticated user.

POST https://management.azure.com/providers/Microsoft.Management/getEntities?api-version=2020-05-01
POST https://management.azure.com/providers/Microsoft.Management/getEntities?api-version=2020-05-01&$skiptoken={$skiptoken}&$skip={$skip}&$top={$top}&$select={$select}&$search={$search}&$filter={$filter}&$view={$view}&groupName={groupName}

URI Parameters

Name In Required Type Description
api-version
query True

string

Version of the API to be used with the client request. The current version is 2018-01-01-preview.

$filter
query

string

The filter parameter allows you to filter on the the name or display name fields. You can check for equality on the name field (e.g. name eq '{entityName}') and you can check for substrings on either the name or display name fields(e.g. contains(name, '{substringToSearch}'), contains(displayName, '{substringToSearch')). Note that the '{entityName}' and '{substringToSearch}' fields are checked case insensitively.

$search
query

string

The $search parameter is used in conjunction with the $filter parameter to return three different outputs depending on the parameter passed in. With $search=AllowedParents the API will return the entity info of all groups that the requested entity will be able to reparent to as determined by the user's permissions. With $search=AllowedChildren the API will return the entity info of all entities that can be added as children of the requested entity. With $search=ParentAndFirstLevelChildren the API will return the parent and first level of children that the user has either direct access to or indirect access via one of their descendants. With $search=ParentOnly the API will return only the group if the user has access to at least one of the descendants of the group. With $search=ChildrenOnly the API will return only the first level of children of the group entity info specified in $filter. The user must have direct access to the children entities or one of it's descendants for it to show up in the results.

$select
query

string

This parameter specifies the fields to include in the response. Can include any combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g. '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the $select parameter can override select in $skipToken.

$skip
query

integer

Number of entities to skip over when retrieving results. Passing this in will override $skipToken.

$skiptoken
query

string

Page continuation token is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.

$top
query

integer

Number of elements to return when retrieving results. Passing this in will override $skipToken.

$view
query

string

The view parameter allows clients to filter the type of data that is returned by the getEntities call.

groupName
query

string

A filter which allows the get entities call to focus on a particular group (i.e. "$filter=name eq 'groupName'")

Request Header

Name Required Type Description
Cache-Control

string

Indicates that the request shouldn't utilize any caches.

Responses

Name Type Description
200 OK

EntityListResult

OK

Other Status Codes

ErrorResponse

Error

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

GetEntities

Sample Request

POST https://management.azure.com/providers/Microsoft.Management/getEntities?api-version=2020-05-01

Sample Response

{
  "value": [
    {
      "id": "/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000",
      "type": "Microsoft.Management/managementGroups",
      "name": "20000000-0001-0000-0000-000000000000",
      "properties": {
        "tenantId": "20000000-0000-0000-0000-000000000000",
        "displayName": "Group 1 Tenant 2",
        "parent": {
          "id": "/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"
        },
        "permissions": "view",
        "inheritedPermissions": "view",
        "parentDisplayNameChain": [
          "Tenant Root Group",
          "Group 1 Tenant 2 Parent"
        ],
        "parentNameChain": [
          "TenantRootGroup",
          "Group1Tenant2Parent"
        ],
        "numberOfDescendants": 3,
        "numberOfChildren": 2,
        "numberOfChildGroups": 1
      }
    },
    {
      "id": "/providers/Microsoft.Management/managementGroups/20000000-0004-0000-0000-000000000000",
      "type": "Microsoft.Management/managementGroups",
      "name": "20000000-0004-0000-0000-000000000000",
      "properties": {
        "tenantId": "20000000-0000-0000-0000-000000000000",
        "displayName": "Group 4 Tenant 2",
        "parent": {
          "id": "/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"
        },
        "permissions": "delete",
        "inheritedPermissions": "delete",
        "parentDisplayNameChain": [
          "Tenant Root Group",
          "Group 4 Tenant 2 Parent"
        ],
        "parentNameChain": [
          "TenantRootGroup",
          "Group4 Tenant2Parent"
        ],
        "numberOfDescendants": 0,
        "numberOfChildren": 0,
        "numberOfChildGroups": 0
      }
    }
  ],
  "nextLink": null
}

Definitions

Name Description
EntityInfo

The entity.

EntityListResult

Describes the result of the request to view entities.

EntityParentGroupInfo

(Optional) The ID of the parent management group.

ErrorDetails

The details of the error.

ErrorResponse

The error object.

Permissions

The users specific permissions to this item.

EntityInfo

The entity.

Name Type Description
id

string

The fully qualified ID for the entity. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000

name

string

The name of the entity. For example, 00000000-0000-0000-0000-000000000000

properties.displayName

string

The friendly name of the management group.

properties.inheritedPermissions

Permissions

Inherited Permissions
The users specific permissions to this item.

properties.numberOfChildGroups

integer

Number of Child Groups
Number of children is the number of Groups that are exactly one level underneath the current Group.

properties.numberOfChildren

integer

Number of Children
Number of children is the number of Groups and Subscriptions that are exactly one level underneath the current Group.

properties.numberOfDescendants

integer

Number of Descendants

properties.parent

EntityParentGroupInfo

Parent
(Optional) The ID of the parent management group.

properties.parentDisplayNameChain

string[]

The parent display name chain from the root group to the immediate parent

properties.parentNameChain

string[]

The parent name chain from the root group to the immediate parent

properties.permissions

Permissions

Permissions
The users specific permissions to this item.

properties.tenantId

string

The AAD Tenant ID associated with the entity. For example, 00000000-0000-0000-0000-000000000000

type

string

The type of the resource. For example, Microsoft.Management/managementGroups

EntityListResult

Describes the result of the request to view entities.

Name Type Description
count

integer

Total count of records that match the filter

nextLink

string

The URL to use for getting the next set of results.

value

EntityInfo[]

The list of entities.

EntityParentGroupInfo

(Optional) The ID of the parent management group.

Name Type Description
id

string

The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000

ErrorDetails

The details of the error.

Name Type Description
code

string

One of a server-defined set of error codes.

details

string

A human-readable representation of the error's details.

message

string

A human-readable representation of the error.

ErrorResponse

The error object.

Name Type Description
error

ErrorDetails

Error
The details of the error.

Permissions

The users specific permissions to this item.

Name Type Description
delete

string

edit

string

noaccess

string

view

string