简体   繁体   English

Azure资源管理器 - 获取资源组的所有资源

[英]Azure Resource Manager - Get all the resources of a resource group

Yesterday, I was using this line of code with the version 1.5.0-preview of Microsoft.Azure.Management.ResourceManager : 昨天,我在Microsoft.Azure.Management.ResourceManager的1.5.0版预览中使用了这行代码:

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. 今天,我已经更新到1.6.0版预览版,但是这个功能似乎不再可用了。 Is there another way to get the list of the resources contained in a resource group ? 是否有其他方法可以获取资源组中包含的资源列表?

Now the SDK is still preview version. 现在SDK仍然是预览版。 In the 1.6.0 preview version. 在1.6.0预览版中。 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 . 但它仍然无法在我身边正常工作,因为API-Version是api-version = 2017-05-10 I catch the request with fiddler. 我和小提琴手一起抓住了这个请求。

在此输入图像描述

The code you mentioned that use API-version 您提到的使用API​​版本的代码

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 . 注意 :如果您想获得组资源,请仍然使用1.5.0预览而不是1.6.0预览,或者向azure sdk团队提供反馈。 Or you can use REST API directly 或者您可以直接使用REST API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM