你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Resource Changes - Resource Changes

List changes to a resource for a given time interval.

POST https://management.azure.com/providers/Microsoft.ResourceGraph/resourceChanges?api-version=2020-09-01-preview

URI Parameters

Name In Required Type Description
api-version
query True

string

Api Version.

Request Body

Name Required Type Description
interval True

Interval

Specifies the date and time interval for a changes request.

$skipToken

string

Acts as the continuation token for paged responses.

$top

integer

The maximum number of changes the client can accept in a paged response.

fetchPropertyChanges

boolean

The flag if set to true will fetch property changes

fetchSnapshots

boolean

The flag if set to true will fetch change snapshots

resourceIds

string[]

Specifies the list of resources for a changes request.

subscriptionId

string

The subscription id of resources to query the changes from.

table

string

The table name to query resources from.

Responses

Name Type Description
200 OK

ResourceChangeList

A list of changes associated with a resource over a specific time interval.

Other Status Codes

ErrorResponse

A response indicating an 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

Basic query
First page query
Next page query

Basic query

Sample request

POST https://management.azure.com/providers/Microsoft.ResourceGraph/resourceChanges?api-version=2020-09-01-preview

{
  "resourceIds": [
    "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"
  ],
  "interval": {
    "start": "2018-10-30T12:09:03.141Z",
    "end": "2018-10-31T12:09:03.141Z"
  }
}

Sample response

{
  "changes": [
    {
      "changeId": "2db0ad2d-f6f0-4f46-b529-5c4e8c494648",
      "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount",
      "changeType": "Update",
      "beforeSnapshot": {
        "timestamp": "2018-10-31T01:32:05.993Z"
      },
      "afterSnapshot": {
        "timestamp": "2018-10-31T01:54:24.42Z"
      }
    },
    {
      "changeId": "9dc352cb-b7c1-4198-9eda-e5e3ed66aec8",
      "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount",
      "changeType": "Create",
      "beforeSnapshot": {
        "timestamp": "2018-10-30T10:30:19.68Z"
      },
      "afterSnapshot": {
        "timestamp": "2018-10-30T21:12:31.337Z"
      }
    }
  ]
}

First page query

Sample request

POST https://management.azure.com/providers/Microsoft.ResourceGraph/resourceChanges?api-version=2020-09-01-preview

{
  "resourceIds": [
    "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"
  ],
  "interval": {
    "start": "2018-10-30T12:09:03.141Z",
    "end": "2018-10-31T12:09:03.141Z"
  },
  "$top": 2
}

Sample response

{
  "changes": [
    {
      "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount",
      "changeId": "2db0ad2d-f6f0-4f46-b529-5c4e8c494648",
      "changeType": "Update",
      "beforeSnapshot": {
        "timestamp": "2018-10-31T01:32:05.993Z"
      },
      "afterSnapshot": {
        "timestamp": "2018-10-31T01:54:24.42Z"
      }
    },
    {
      "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount",
      "changeId": "9dc352cb-b7c1-4198-9eda-e5e3ed66aec8",
      "changeType": "Create",
      "beforeSnapshot": {
        "timestamp": "2018-10-30T10:30:19.68Z"
      },
      "afterSnapshot": {
        "timestamp": "2018-10-30T21:12:31.337Z"
      }
    }
  ],
  "$skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT"
}

Next page query

Sample request

POST https://management.azure.com/providers/Microsoft.ResourceGraph/resourceChanges?api-version=2020-09-01-preview

{
  "resourceIds": [
    "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"
  ],
  "interval": {
    "start": "2018-10-30T12:09:03.141Z",
    "end": "2018-10-31T12:09:03.141Z"
  },
  "$top": 2,
  "$skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT"
}

Sample response

{
  "changes": [
    {
      "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount",
      "changeId": "55f458c4-f1c0-4963-bc6c-af275cd47702",
      "changeType": "Update",
      "beforeSnapshot": {
        "timestamp": "2018-10-31T03:43:08.629Z"
      },
      "afterSnapshot": {
        "timestamp": "2018-10-31T05:12:32.087Z"
      }
    },
    {
      "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount",
      "changeId": "0495b929-b86d-46cc-a972-939145feed90",
      "changeType": "Create",
      "beforeSnapshot": {
        "timestamp": "2018-10-31T01:54:24.42Z"
      },
      "afterSnapshot": {
        "timestamp": "2018-10-31T02:01:02.163Z"
      }
    }
  ],
  "$skipToken": "kVGltZSI6ICJcL0RhdGUoMTU1MDc0NTew0KICAiJGlkIjogIjEiLA0KICAiRW5"
}

Definitions

Name Description
AfterSnapshot

The snapshot after the change.

BeforeSnapshot

The snapshot before the change.

ChangeCategory

The change category.

ChangeType

The change type for snapshot. PropertyChanges will be provided in case of Update change type

Error

Error info.

ErrorDetails

Error details.

ErrorResponse

Error response.

Interval

Specifies the date and time interval for a changes request.

PropertyChangeType

The property change Type

ResourceChangeData

Data on a specific change, represented by a pair of before and after resource snapshots.

ResourceChangeList

A list of changes associated with a resource over a specific time interval.

ResourceChangesRequestParameters

The parameters for a specific changes request.

ResourcePropertyChange

The resource property change

AfterSnapshot

The snapshot after the change.

Name Type Description
content

object

The resource snapshot content (in resourceChangeDetails response only).

snapshotId

string

The ID of the snapshot.

timestamp

string

The time when the snapshot was created. The snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed.

BeforeSnapshot

The snapshot before the change.

Name Type Description
content

object

The resource snapshot content (in resourceChangeDetails response only).

snapshotId

string

The ID of the snapshot.

timestamp

string

The time when the snapshot was created. The snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed.

ChangeCategory

The change category.

Name Type Description
System

string

User

string

ChangeType

The change type for snapshot. PropertyChanges will be provided in case of Update change type

Name Type Description
Create

string

Delete

string

Update

string

Error

Error info.

Name Type Description
code

string

Error code identifying the specific error.

details

ErrorDetails[]

Error details

message

string

A human readable error message.

ErrorDetails

Error details.

Name Type Description
code

string

Error code identifying the specific error.

message

string

A human readable error message.

ErrorResponse

Error response.

Name Type Description
error

Error

Error info.
Error information.

Interval

Specifies the date and time interval for a changes request.

Name Type Description
end

string

A datetime indicating the exclusive/open end of the time interval, i.e. [start, end). Specifying an end that occurs chronologically before start will result in an error.

start

string

A datetime indicating the inclusive/closed start of the time interval, i.e. [start, end). Specifying a start that occurs chronologically after end will result in an error.

PropertyChangeType

The property change Type

Name Type Description
Insert

string

Remove

string

Update

string

ResourceChangeData

Data on a specific change, represented by a pair of before and after resource snapshots.

Name Type Description
afterSnapshot

AfterSnapshot

The snapshot after the change.

beforeSnapshot

BeforeSnapshot

The snapshot before the change.

changeId

string

The change ID. Valid and unique within the specified resource only.

changeType

ChangeType

The change type for snapshot. PropertyChanges will be provided in case of Update change type

propertyChanges

ResourcePropertyChange[]

An array of resource property change

resourceId

string

The resource for a change.

ResourceChangeList

A list of changes associated with a resource over a specific time interval.

Name Type Description
$skipToken

Skip token that encodes the skip information while executing the current request

changes

ResourceChangeData[]

The pageable value returned by the operation, i.e. a list of changes to the resource.

  • The list is ordered from the most recent changes to the least recent changes.
  • This list will be empty if there were no changes during the requested interval.
  • The Before snapshot timestamp value of the oldest change can be outside of the specified time interval.

ResourceChangesRequestParameters

The parameters for a specific changes request.

Name Type Description
$skipToken

string

Acts as the continuation token for paged responses.

$top

integer

The maximum number of changes the client can accept in a paged response.

fetchPropertyChanges

boolean

The flag if set to true will fetch property changes

fetchSnapshots

boolean

The flag if set to true will fetch change snapshots

interval

Interval

Specifies the date and time interval for a changes request.

resourceIds

string[]

Specifies the list of resources for a changes request.

subscriptionId

string

The subscription id of resources to query the changes from.

table

string

The table name to query resources from.

ResourcePropertyChange

The resource property change

Name Type Description
afterValue

string

The property value in after snapshot

beforeValue

string

The property value in before snapshot

changeCategory

ChangeCategory

The change category.

propertyChangeType

PropertyChangeType

The property change Type

propertyName

string

The property name