Azure Resource Manager - get all the resources of a resource group

Yesterday I used this line of code with version 1.5.0-preview of Microsoft.Azure.Management.ResourceManager:

var listResources = ResourceManagementClient.ResourceGroups.ListResources(resourceGroup.Name); 

Today I upgraded to version 1.6.0 preview, but the function does not seem to be available anymore. Is there any other way to get a list of resources contained in a resource group?

+5
source share
1 answer

Now the SDK is still a preview version. In version 1.6.0. He should use the following code.

  var listResources = resourceManagementClient.Resources.ListByResourceGroup("ResourceGroup Name"); 

But it still cannot work correctly on my side, because the API version is api-version = 2017-05-10 . I will catch the request with the help of a violinist.

enter image description here

The code you specified using the API version

 var listResources = ResourceManagementClient.ResourceGroups.ListResources(resourceGroup.Name); 

enter image description here

Note Please continue to use 1.5.0-preview instead of 1.6.0-preview now if you want to get a group resource or give your feedback to the azure sdk team. Or you can directly use the REST API

+7
source

All Articles