Resource property values are not returned from list_by_resource_group method output
- Package Name: azure-mgmt-resource
- Package Version: 23.0.1
- Operating System: Windows
- Python Version: 3.10.4
Describe the bug Resources returned by ResourceManagementClient(credential, subscription_id).resources.list_by_resource_group(resource_group) have empty Property values
Code:
Output:
This is isolated to the Resources returned by the above method, the following works correctly and returns the Resource's property value correctly:
Expected behavior The returned Resources should have a non-None property attribute
Hi @dyrx, thank you for opening an issue! I'll tag someone who should be able to provide some clarity; we'll get back to you as soon as possible.
Hi @dyrx
Shortly, the method resources.list_by_resource_group() cannot get detailed information about resource properties like method resources.get_by_id() can do. For its request was sent to the provider Microsoft.Resources which does not have the schema to describe a specified resource, so it can only return basic information(id, name, tag, sku, location, etc.). Yet by using method resources.get_by_id(), the request was sent to the related provider, for example, when getting properties of a storage account, the request will be sent to Microsoft.storage, which has the schema of its properties that can return detailed information.
So, if you want to get all detailed resource properties among a resource group, try circularly run the method resources.get_by_id().
Hi @dyrx. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
Hi @dyrx, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.