Yesterday, I was using this line of code with the version 1.5.0-preview of Microsoft.Azure.Management.ResourceManager :
var listResources =
ResourceManagementClient.ResourceGroups.ListResources(resourceGroup.Name);
Today, I have updated to version 1.6.0-preview but the fonction doesn't seem to be available anymore. Is there another way to get the list of the resources contained in a resource group ?
The All resources screen in the Azure portal includes a link to open a Resource Graph query that is scoped to the current filtered view. To run a Resource Graph query: Select Open query. In Azure Resource Graph Explorer, select Run query to see the results.
A resource can connect to resources in other resource groups. This scenario is common when the two resources are related but don't share the same lifecycle. For example, you can have a web app that connects to a database in a different resource group.
Inherit tags Resources don't inherit the tags you apply to a resource group or a subscription.
Summary : Use the Azure Resource Manager cmdlets to show resources that are assigned under a resource group. I looked at the console for Azure Resource Manager and can see all the resources for a particular resource group.
To prevent a resource group and its resources from being deleted, use az lock create. To get the locks for a resource group, use az lock list. For more information, see Lock resources with Azure Resource Manager. You can apply tags to resource groups and resources to logically organize your assets.
Azure Resource Manager enables you to repeatedly deploy your app and have confidence your resources are deployed in a consistent state. You define the infrastructure and dependencies for your app in a single declarative template. This template is flexible enough to use for all of your environments such as test, staging or production.
You can deploy Azure resources by using Azure CLI, or by deploying an Azure Resource Manager (ARM) template or Bicep file. The following example creates a storage account. The name you provide for the storage account must be unique across Azure. To deploy an ARM template or Bicep file, use az deployment group create.
Now the SDK is still preview version. In the 1.6.0 preview version. It should use following code.
var listResources = resourceManagementClient.Resources.ListByResourceGroup("ResourceGroup Name");
But it still can't work correctly on my side because the API-Version is api-version=2017-05-10. I catch the request with fiddler.
The code you mentioned that use API-version
var listResources =
ResourceManagementClient.ResourceGroups.ListResources(resourceGroup.Name);
Note : Please still use 1.5.0-preview instead of 1.6.0-preview currently if you want get group resource, or give your feedback to azure sdk team . Or you can use REST API directly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With