【问题标题】:Azure Advisor REST API Recommendation Extended Properties Do Not Populate?不填充 Azure 顾问 REST API 建议扩展属性?
【发布时间】:2020-03-21 01:24:02
【问题描述】:

我正在从 Azure Advisor Rest Api 提取建议,但无法检索 extendedProperties 值。

具体来说,我正在从成本类别的建议中寻找节省数据。

在以下 58 秒的视频中,有一个预期响应的示例。

https://www.youtube.com/watch?v=hAxrdmOAB8s

是否需要为我的帐户授予特定权限才能提取数据,或者 API 是否无法提供值?

我可以在门户中看到数据,但 extendedProperties 属性始终为空。

【问题讨论】:

    标签: azure azure-resource-manager azure-rest-api


    【解决方案1】:

    我假设您正在尝试 Recommendations - List API。

    本质上,扩展属性会公开有关 Azure 顾问建议的其他信息。

    AFAIK,他们不需要出现在每个推荐中,并且不需要额外的权限来列出。可能只是您收到的推荐类型没有要列出的情况。

    这是我收到的一个示例响应,其中包含两者:

    [
        {
            "properties": {
                "category": "Cost",
                "impact": "Medium",
                "impactedField": "Microsoft.Network/publicIPAddresses",
                "impactedValue": "foo",
                "lastUpdated": "2020-03-20T14:10:24.6928024Z",
                "recommendationTypeId": "1b4dd958-c202-47af-af97-99bfc98376a5",
                "shortDescription": {
                    "problem": "Delete Public IP address not associated to a running Azure resource",
                    "solution": "Delete Public IP address not associated to a running Azure resource"
                },
                "extendedProperties": {}
            },
            "id": "xxx",
            "type": "Microsoft.Advisor/recommendations",
            "name": "xxx"
        },
        {
            "properties": {
                "category": "Cost",
                "impact": "Medium",
                "impactedField": "Microsoft.Sql/servers/databases",
                "impactedValue": "bar",
                "lastUpdated": "2020-03-20T13:27:35.8394386Z",
                "recommendationTypeId": "b83241d3-47ba-4603-8d5a-a1b3331e74f4",
                "shortDescription": {
                    "problem": "Right-size underutilized SQL Databases",
                    "solution": "Right-size underutilized SQL Databases"
                },
                "extendedProperties": {
                    "ServerName": "fooserver",
                    "DatabaseName": "fooDB",
                    "IsInReplication": "1",
                    "ResourceGroup": "xyz",
                    "DatabaseSize": "6",
                    "Region": "East US 2",
                    "ObservationPeriodStartDate": "03/04/2020 00:00:00",
                    "ObservationPeriodEndDate": "03/19/2020 00:00:00",
                    "Recommended_DTU": "10",
                    "Recommended_SKU": "S0",
                    "HasRecommendation": "true"
                }
            }
        }
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多