Tags - Get

Get all available tag keys for the defined scope

GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/tags?api-version=2024-08-01

URI Parameters

Name In Required Type Description
scope
path True

string

The fully qualified Azure Resource manager identifier of the resource.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

TagsResult

The request has succeeded.

204 No Content

Operation completed successfully.

Other Status Codes

ErrorResponse

An unexpected error response.

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

Tags_Get

Sample request

GET https://management.azure.com/providers/Microsoft.CostManagement/billingAccounts/1234/providers/Microsoft.Consumption/tags?api-version=2024-08-01

Sample response

{
  "name": "tags1",
  "type": "Microsoft.Consumption/tags",
  "eTag": "\"1d34d012214157f\"",
  "id": "providers/Microsoft.CostManagement/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/tags/tags1",
  "properties": {
    "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/tags/?$expand=properties/tags/value&api-version=2024-08-01&startDate=2020-12-01&endDate=2020-12-31&$top=1000&$skiptoken=AwAAAA%3D%3D",
    "previousLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/tags/?$expand=properties/tags/value&api-version=2024-08-01&startDate=2020-12-01&endDate=2020-12-31&$top=1000&$skiptoken=AQAAAA%3D%3D",
    "tags": [
      {
        "key": "Department"
      },
      {
        "key": "CostCenter"
      },
      {
        "key": "Portal"
      },
      {
        "key": "OrgName"
      },
      {
        "key": "Namespace"
      },
      {
        "key": "resourceType"
      },
      {
        "key": "Subsystem"
      },
      {
        "key": "Environment"
      },
      {
        "key": "clusterName"
      }
    ]
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

systemData

Metadata pertaining to creation and last modification of the resource.

Tag

The tag resource.

TagsResult

A resource listing all tags.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

Tag

The tag resource.

Name Type Description
key

string

Tag key.

value

string[]

Tag values.

TagsResult

A resource listing all tags.

Name Type Description
eTag

string

eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.

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

properties.nextLink

string

The link (url) to the next page of results.

properties.previousLink

string

The link (url) to the previous page of results.

properties.tags

Tag[]

A list of Tag.

systemData

systemData

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"