Tags - Get At Scope
Gets the entire set of tags on a resource or subscription.
GET https://management.azure.com/{scope}/providers/Microsoft.Resources/tags/default?api-version=2021-04-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
scope
|
path | True |
|
The resource scope. |
|
api-version
|
query | True |
|
The API version to use for this operation. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Returns tags from the specified object. |
|
| Other Status Codes |
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 |
Examples
| Get tags on a resource |
| Get tags on a subscription |
Get tags on a resource
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm/providers/Microsoft.Resources/tags/default?api-version=2021-04-01
Sample Response
{
"properties": {
"tags": {
"tagKey1": "tag-value-1",
"tagKey2": "tag-value-2"
}
}
}
Get tags on a subscription
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/tags/default?api-version=2021-04-01
Sample Response
{
"properties": {
"tags": {
"tagKey1": "tag-value-1",
"tagKey2": "tag-value-2"
}
}
}
Definitions
|
Cloud |
An error response for a resource management request. |
|
Error |
The resource management error additional info. |
|
Error |
Error Response |
| Tags |
A dictionary of name and value pairs. |
|
Tags |
Wrapper resource for tags API requests and responses. |
CloudError
An error response for a resource management request.
| Name | Type | Description |
|---|---|---|
| error |
Error Response |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
|
The additional info. |
| type |
|
The additional info type. |
ErrorResponse
Error Response
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
|
The error code. |
| details |
The error details. |
|
| message |
|
The error message. |
| target |
|
The error target. |
Tags
A dictionary of name and value pairs.
| Name | Type | Description |
|---|---|---|
| tags |
|
TagsResource
Wrapper resource for tags API requests and responses.
| Name | Type | Description |
|---|---|---|
| id |
|
The ID of the tags wrapper resource. |
| name |
|
The name of the tags wrapper resource. |
| properties |
The set of tags. |
|
| type |
|
The type of the tags wrapper resource. |