Resources - List

Get all the resources in a subscription.

GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2021-04-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resources?$filter={$filter}&$expand={$expand}&$top={$top}&api-version=2021-04-01

URI Parameters

Name In Required Type Description
subscriptionId
path True

string

The Microsoft Azure subscription ID.

api-version
query True

string

The API version to use for this operation.

$expand
query

string

Comma-separated list of additional properties to be included in the response. Valid values include createdTime, changedTime and provisioningState. For example, $expand=createdTime,changedTime.

$filter
query

string

The filter to apply on the operation.

Filter comparison operators include eq (equals) and ne (not equals) and may be used with the following properties: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use $filter=resourceType eq 'Microsoft.Network/virtualNetworks'


substringof(value, property) can be used to filter for substrings of the following currently-supported properties: name and resourceGroup

For example, to get all resources with 'demo' anywhere in the resource name, use $filter=substringof('demo', name)

Multiple substring operations can also be combined using and/or operators.

Note that any truncated number of results queried via $top may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via $expand may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: $filter=startswith(tagName, 'depart'). This query will return all resources with a tag name prefixed by the phrase depart (i.e.department, departureDate, departureTime, etc.)


Note that some properties can be combined when filtering resources, which include the following: substringof() and/or resourceType, plan and plan/publisher and plan/name, and identity and identity/principalId.

$top
query

integer

int32

The number of recommendations per page if a paged version of this API is being used.

Responses

Name Type Description
200 OK

ResourceListResult

OK - Returns an array of resources.

Other Status Codes

CloudError

Error response describing why the operation failed.

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

Definitions

Name Description
CloudError

An error response for a resource management request.

ErrorAdditionalInfo

The resource management error additional info.

ErrorResponse

Error Response

ExtendedLocation

Resource extended location.

ExtendedLocationType

The extended location type.

GenericResourceExpanded

Resource information.

Identity

Identity for the resource.

Plan

Plan for the resource.

ResourceIdentityType

The identity type.

ResourceListResult

List of resource groups.

Sku

SKU for the resource.

UserAssignedIdentities

The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

CloudError

An error response for a resource management request.

Name Type Description
error

ErrorResponse

Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorResponse

Error Response

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorResponse[]

The error details.

message

string

The error message.

target

string

The error target.

ExtendedLocation

Resource extended location.

Name Type Description
name

string

The extended location name.

type

ExtendedLocationType

The extended location type.

ExtendedLocationType

The extended location type.

Name Type Description
EdgeZone

string

GenericResourceExpanded

Resource information.

Name Type Description
changedTime

string

The changed time of the resource. This is only present if requested via the $expand query parameter.

createdTime

string

The created time of the resource. This is only present if requested via the $expand query parameter.

extendedLocation

ExtendedLocation

Resource extended location.

id

string

Resource ID

identity

Identity

The identity of the resource.

kind

string

The kind of the resource.

location

string

Resource location

managedBy

string

ID of the resource that manages this resource.

name

string

Resource name

plan

Plan

The plan of the resource.

properties

object

The resource properties.

provisioningState

string

The provisioning state of the resource. This is only present if requested via the $expand query parameter.

sku

Sku

The SKU of the resource.

tags

object

Resource tags

type

string

Resource type

Identity

Identity for the resource.

Name Type Description
principalId

string

The principal ID of resource identity.

tenantId

string

The tenant ID of resource.

type

ResourceIdentityType

The identity type.

userAssignedIdentities

UserAssignedIdentities

The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

Plan

Plan for the resource.

Name Type Description
name

string

The plan ID.

product

string

The offer ID.

promotionCode

string

The promotion code.

publisher

string

The publisher ID.

version

string

The plan's version.

ResourceIdentityType

The identity type.

Name Type Description
None

string

SystemAssigned

string

SystemAssigned, UserAssigned

string

UserAssigned

string

ResourceListResult

List of resource groups.

Name Type Description
nextLink

string

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

value

GenericResourceExpanded[]

An array of resources.

Sku

SKU for the resource.

Name Type Description
capacity

integer

The SKU capacity.

family

string

The SKU family.

model

string

The SKU model.

name

string

The SKU name.

size

string

The SKU size.

tier

string

The SKU tier.

UserAssignedIdentities

The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

Name Type Description