rest - Azure 资源 API 字段可用于 $filters 和 $expand

标签 rest azure azure-resource-manager

GET https://management.azure.com/subscriptions/{subscriptionId}/resources?$filter={$filter}&$expand={$expand}&$top={$top}&api-版本=2018-02-01

我正在使用此 Azure 资源 API 来获取资源列表(逻辑应用连接),我需要知道可在 $filter 和 $expand 中使用的字段名称

从中我得到了一些字段名称,例如名称、资源类型、标记名、位置、资源组

但我需要过滤 properties.displayname 字段。我尝试使用 $expand 和 $filter 。它不起作用。

使用名称 $filter

https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2018-02-01&$filter=(resourceGroup eq {resourcegroupname}) 和 **name eq {nametofilter }** 和 (resourcetype eq 'microsoft.web/connections')

不能将显示名称 $filter 与 $expand 一起使用

https://management.azure.com/subscriptions/{subscriptionId}/resources?$expand=ResourceProperties&api-version=2018-02-01&$filter=(resourceGroup eq {resourcegroupname}) 和 **ResourceProperties/displayName eq {nametofilter}** 和 (resourcetype eq 'microsoft.web/connections')

https://management.azure.com/subscriptions/{subscriptionId}/resources?$expand=Properties&api-version=2018-02-01&$filter=(resourceGroup eq {resourcegroupname}) 和 **属性/displayName eq {nametofilter}** 和 (resourcetype eq 'microsoft.web/connections')

对带有显示名称字段的 $filter 有什么建议吗?

最佳答案

根据我的测试,如果我使用resourcetype eq microsoft.web/connections来过滤资源。但没有显示名称字段。

据我所知,如果我们想使用 $filter 或 $expand,我们需要确保原始结果包含该字段。

enter image description here

关于rest - Azure 资源 API 字段可用于 $filters 和 $expand,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50514873/

相关文章:

java - 如何从 Java REST API 请求中解码 JSON?

php - 使用 Paypal REST api 和 PHP cURL 发布发票(草稿)不断返回 415 Unsupported Media Type

ruby - 构建 HTTP RESTful API(特定于 Ruby)

具有策略规则收集循环的 Azure 防火墙

azure - 通过同一 VM 上的 Azure 模板运行多个自定义脚本

wcf - 如何将 bool 参数传递给一个安静的服务?

python - 使用 azure 语音转文本时保存麦克风音频输入

Windows Azure 移动服务多次插入,如何获取范围标识

azure - 限制 Azure Webjobs 一次处理的 Blob 数量

Azure Bicep 不会删除存储容器