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.
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.