azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Resource Changes Method Does Not Return 'Create' Change Types

Open dmartin-r7 opened this issue 5 years ago • 3 comments

  • Package Name: azure-mgmt-resourcegraph
  • Package Version: 7.0.0
  • Operating System: Mac OS
  • Python Version: 3.7.5

Describe the bug Resource Changes method call does not return any 'Create' changes. Under the documentation for resource changes an example of a resourceChanges API call for a new storage account is given. Here it displays what the JSON response will look like, showing multiple changes including a 'Create' change type. I have been unable to replicate this functionality from my end.

To Reproduce Steps to reproduce the behavior:

  1. Using example setup from Azure Docs
def getresources()
    argClient = get_client_from_cli_profile(arg.ResourceGraphClient)
    start = (datetime.datetime.now() - datetime.timedelta(minutes=15)).isoformat()
    end = datetime.datetime.now().isoformat()
    interval = arg.models.ResourceChangesRequestParametersInterval(start=start, end=end)

    argQueryOptions = arg.models.ResourceChangesRequestParameters(resource_id = "/subscriptions/{id}/resourcegroups/{name}/providers/Microsoft.Network/networkSecurityGroups/dmartin-test", interval=interval, fetch_property_changes=True)

    argResults = argClient.resource_changes(parameters=argQueryOptions)
  1. I create a new Network Security Group from scratch, give the resource ID to this script and call the resource changes method, but I see no 'Create' change being returned. If I update a tag, I will see this change but not the initial creation.

argResults contains data including Delete, Update, Insert but no 'Create' change types, even when the interval is set so the creation time will be included.

Expected behavior I should be able to see a change object for the change type 'Create' at the timestamp that the resource was created.

dmartin-r7 avatar Mar 23 '21 11:03 dmartin-r7

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @chiragg4u.

Issue Details
  • Package Name: azure-mgmt-resourcegraph
  • Package Version: 7.0.0
  • Operating System: Mac OS
  • Python Version: 3.7.5

Describe the bug Resource Changes method call does not return any 'Create' changes. Under the documentation for resource changes an example of a resourceChanges API call for a new storage account is given. Here it displays what the JSON response will look like, showing multiple changes including a 'Create' change type. I have been unable to replicate this functionality from my end.

To Reproduce Steps to reproduce the behavior:

  1. Using example setup from Azure Docs
def getresources()
    argClient = get_client_from_cli_profile(arg.ResourceGraphClient)
    start = (datetime.datetime.now() - datetime.timedelta(minutes=15)).isoformat()
    end = datetime.datetime.now().isoformat()
    interval = arg.models.ResourceChangesRequestParametersInterval(start=start, end=end)

    argQueryOptions = arg.models.ResourceChangesRequestParameters(resource_id = "/subscriptions/{id}/resourcegroups/{name}/providers/Microsoft.Network/networkSecurityGroups/dmartin-test", interval=interval, fetch_property_changes=True)

    argResults = argClient.resource_changes(parameters=argQueryOptions)
  1. I create a new Network Security Group from scratch, give the resource ID to this script and call the resource changes method, but I see no 'Create' change being returned. If I update a tag, I will see this change but not the initial creation.

argResults contains data including Delete, Update, Insert but no 'Create' change types, even when the interval is set so the creation time will be included.

Expected behavior I should be able to see a change object for the change type 'Create' at the timestamp that the resource was created.

Author: dmartin-r7
Assignees: 00Kai0, zhangyan133
Labels:

Mgmt, Resource Graph, Service Attention, customer-reported, question

Milestone: -

ghost avatar Apr 14 '21 07:04 ghost

Hi @chiragg4u, could you have a look?

00Kai0 avatar Apr 14 '21 07:04 00Kai0

Hello @dmartin-r7, Create resource changes are only available on resources that were created before and deleted within the last 14 days. This means that VM1 that you newly created within Subscription1 and ResourceGroup1 for the first time would not be picked up under this API, yet. This wasn't clear in our documentation before so we've updated it.

We have a plan to address this in future iterations of change tracking. To make it easier for tracking and communicating with you regarding our progress and updates, please create an item for your request here.

snaheth avatar Jun 02 '21 20:06 snaheth