Azure-sdk-for-python: Inconsistent output on genericresource object

Created on 9 Nov 2018  路  3Comments  路  Source: Azure/azure-sdk-for-python

Calling resourcemanagementclient.resources.get_by_id() returns a genericresponse object that has a full "properties" field.

However, pulling the same genericresource object through any other method results in resouce.properties = None, which is not correct.

For example, The following method results in 'properties' = None

for resource_group in rm_client.resource_groups.list():
        vm_list = compute_client.virtual_machines.list(resource_group.name)    
        rg_resources = rmclientclient.resources.list_by_resource_group(resource_group.name)

All genericresource objects obtained using the above code will have resource.properties = None.

ARM ARM - Core ARM-Core Triaged Service Attention question

All 3 comments

That's a good question. Let me double-check this and come back to you.
Thank you,

This is expected (by design).
Important thing to note is that ARM does NOT store 'Properties' field in its cache. ARM only stores metadata. Only resource providers store full schema.

ARM always forwards 'GET by id' call to respective resource provider. So, the response always includes properties field.

Where as 'list by RG' using ARM (RM) client, is served by ARM based out of its storage. Hence no properties field for resources in the response.
'list by RG' using specific resource provider client would include properties field.

@ifeoluwaokunoren @lmazuel please resolve the issue appropriately (notes previous comment). Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmlero picture jmlero  路  3Comments

smereczynski picture smereczynski  路  4Comments

yunhaoling picture yunhaoling  路  3Comments

przemolb picture przemolb  路  4Comments

AmudhaPalani picture AmudhaPalani  路  4Comments