Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Get-AzAdvisorRecommendation returning no VM specific recommendations anymore #24760

Open mrdenny opened 6 months ago

mrdenny commented 6 months ago

Description

I’ve got a PowerShell script that uses Get-AzAdvisorRecommendation to pull down the list of recommendations from Azure Advisor. It used to have a bunch of recommendations in the ExtendedProperties value.

From conversations with the PG, this isn't expected.

Issue script & Debug output

PS C:\Users\denny> $DebugPreference = 'continue'
PS C:\Users\denny> Get-AzAdvisorRecommendation
DEBUG: 2:15:59 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 2:15:59 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
DEBUG: 2:15:59 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 2:15:59 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default
value [False].
DEBUG: 2:15:59 PM - GetAzureRMContextCommand end processing.
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated:
/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/providers/Microsoft.Advisor/recommendations?api-version=2020-01-01
DEBUG: RequestCreated:
/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/providers/Microsoft.Advisor/recommendations?api-version=2020-01-01
DEBUG: HeaderParametersAdded:
DEBUG: 2:15:59 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default
value [False].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/providers/Microsoft.Advisor/recommendat
ions?api-version=2020-01-01

Headers:
x-ms-unique-id                : 1
x-ms-client-request-id        : fff6b971-9624-4c23-b76b-0db028f9a17f
CommandName                   : .
FullCommandName               : Get-AzAdvisorRecommendation_List
ParameterSetName              : __AllParameterSets
User-Agent                    : AzurePowershell/v0.0.0,PSVersion/v5.1.22621.2506,Az.Advisor/2.0.0

Body:

DEBUG: BeforeCall:
DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
x-ms-throttling-version       : v1
x-ms-ratelimit-remaining-subscription-resource-requests: 599
x-ms-request-id               : 69a2b5f5-aca3-4427-aea2-1aaa46317428
x-ms-correlation-request-id   : 69a2b5f5-aca3-4427-aea2-1aaa46317428
x-ms-routing-request-id       : NORTHCENTRALUS:20240429T211558Z:69a2b5f5-aca3-4427-aea2-1aaa46317428
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 7FB134680DD34BF5B5E10925F937D753 Ref B: CH1AA2020616047 Ref C:
2024-04-29T21:15:58Z
Cache-Control                 : no-cache
Date                          : Mon, 29 Apr 2024 21:15:58 GMT

Body:
{
  "value": [
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "High",
        "impactedField": "MICROSOFT.COMPUTE/VIRTUALMACHINES",
        "impactedValue": "TestBuildAgent",
        "lastUpdated": "2024-04-29T20:11:11.6056989Z",
        "recommendationTypeId": "066a047a-9ace-45f4-ac50-6325840a6b00",
        "shortDescription": {
          "problem": "Use Availability zones for better resiliency and availability",
          "solution": "Use Availability zones for better resiliency and availability"
        },
        "extendedProperties": {
          "Location": "centralus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/Portal-Test/providers/Microsoft.Compute/virtualMach
ines/TestBuildAgent"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/Portal-Test/providers/Microsoft.Compute/virtualMach
ines/TestBuildAgent/providers/Microsoft.Advisor/recommendations/d4da4e87-8422-e056-ae75-b1a982d42c9d",
      "type": "Microsoft.Advisor/recommendations",
      "name": "d4da4e87-8422-e056-ae75-b1a982d42c9d"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "High",
        "impactedField": "Microsoft.Subscriptions/subscriptions",
        "impactedValue": "ee3cb3c0-3415-43ee-8e63-a0170716ee9e",
        "lastUpdated": "2024-04-29T17:04:51.3591082Z",
        "recommendationTypeId": "242639fd-cd73-4be2-8f55-70478db8d1a5",
        "shortDescription": {
          "problem": "Create an Azure Service Health alert",
          "solution": "Create an Azure Service Health alert"
        },
        "extendedProperties": {
          "recommendationControl": "MonitoringAndAlerting",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId": "/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/providers/Microsoft.Advisor/recommendations/2d3722aa-885b-6aa7-5b3
5-82521021b875",
      "type": "Microsoft.Advisor/recommendations",
      "name": "2d3722aa-885b-6aa7-5b35-82521021b875"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "High",
        "impactedField": "MICROSOFT.SQL/SERVERS/DATABASES",
        "impactedValue": "CspPortalTest",
        "lastUpdated": "2024-04-29T07:42:09.8851054Z",
        "recommendationTypeId": "807e58d0-e385-41ad-987b-4a4b3e3fb563",
        "shortDescription": {
          "problem": "Enable zone redundancy for Azure SQL Database to achieve high availability and resiliency.",
          "solution": "Enable zone redundancy for Azure SQL Database to achieve high availability and resiliency."
        },
        "extendedProperties": {
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/EE3CB3C0-3415-43EE-8E63-A0170716EE9E/resourceGroups/SQLDB-Development/providers/microsoft.sql/servers/d
cac-dev/databases/CspPortalTest"
        }
      },
      "id":
"/subscriptions/EE3CB3C0-3415-43EE-8E63-A0170716EE9E/resourceGroups/SQLDB-Development/providers/microsoft.sql/servers/d
cac-dev/databases/CspPortalTest/providers/Microsoft.Advisor/recommendations/c0cd5570-0bb3-8d0c-b3d9-10808a764cf7",
      "type": "Microsoft.Advisor/recommendations",
      "name": "c0cd5570-0bb3-8d0c-b3d9-10808a764cf7"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "High",
        "impactedField": "MICROSOFT.SQL/SERVERS/DATABASES",
        "impactedValue": "AzureAssessments",
        "lastUpdated": "2024-04-29T07:42:09.8851054Z",
        "recommendationTypeId": "807e58d0-e385-41ad-987b-4a4b3e3fb563",
        "shortDescription": {
          "problem": "Enable zone redundancy for Azure SQL Database to achieve high availability and resiliency.",
          "solution": "Enable zone redundancy for Azure SQL Database to achieve high availability and resiliency."
        },
        "extendedProperties": {
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/EE3CB3C0-3415-43EE-8E63-A0170716EE9E/resourceGroups/SQLDB-Development/providers/microsoft.sql/servers/d
cac-dev/databases/AzureAssessments"
        }
      },
      "id":
"/subscriptions/EE3CB3C0-3415-43EE-8E63-A0170716EE9E/resourceGroups/SQLDB-Development/providers/microsoft.sql/servers/d
cac-dev/databases/AzureAssessments/providers/Microsoft.Advisor/recommendations/732ee856-6f2f-fdfa-67e1-6ee3417cde07",
      "type": "Microsoft.Advisor/recommendations",
      "name": "732ee856-6f2f-fdfa-67e1-6ee3417cde07"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "High",
        "impactedField": "Microsoft.Network/trafficmanagerprofiles",
        "impactedValue": "portal-dev-dcac-com",
        "lastUpdated": "2024-04-29T16:57:28.9143943Z",
        "recommendationTypeId": "0bbe0a49-3c63-49d3-ab4a-aa24198f03f7",
        "shortDescription": {
          "problem": "Add an endpoint configured to \"All (World)\"",
          "solution": "Add an endpoint configured to \"All (World)\""
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/portal-development/providers/Microsoft.Network/traf
ficmanagerprofiles/portal-dev-dcac-com"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/portal-development/providers/Microsoft.Network/traf
ficmanagerprofiles/portal-dev-dcac-com/providers/Microsoft.Advisor/recommendations/ca496043-d532-92dd-3b1e-2ac29ab31e00
",
      "type": "Microsoft.Advisor/recommendations",
      "name": "ca496043-d532-92dd-3b1e-2ac29ab31e00"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "High",
        "impactedField": "Microsoft.Network/trafficmanagerprofiles",
        "impactedValue": "portal-test-dcac-com",
        "lastUpdated": "2024-04-29T16:57:28.9143943Z",
        "recommendationTypeId": "0bbe0a49-3c63-49d3-ab4a-aa24198f03f7",
        "shortDescription": {
          "problem": "Add an endpoint configured to \"All (World)\"",
          "solution": "Add an endpoint configured to \"All (World)\""
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/portal-test/providers/Microsoft.Network/trafficmana
gerprofiles/portal-test-dcac-com"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/portal-test/providers/Microsoft.Network/trafficmana
gerprofiles/portal-test-dcac-com/providers/Microsoft.Advisor/recommendations/57fcb660-9c80-cb7c-8a6d-267f06765001",
      "type": "Microsoft.Advisor/recommendations",
      "name": "57fcb660-9c80-cb7c-8a6d-267f06765001"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "uscentral-development",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "centralus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/networking/providers/microsoft.network/virtualnetwo
rks/uscentral-development"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/networking/providers/microsoft.network/virtualnetwo
rks/uscentral-development/providers/Microsoft.Advisor/recommendations/42f49abf-587b-f07e-5f39-0a426d9b5c41",
      "type": "Microsoft.Advisor/recommendations",
      "name": "42f49abf-587b-f07e-5f39-0a426d9b5c41"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "sqlplayground-vnet",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "eastus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/sqlplayground/providers/microsoft.network/virtualne
tworks/sqlplayground-vnet"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/sqlplayground/providers/microsoft.network/virtualne
tworks/sqlplayground-vnet/providers/Microsoft.Advisor/recommendations/46a3ac73-9ff3-c2ed-9a1c-5200883144af",
      "type": "Microsoft.Advisor/recommendations",
      "name": "46a3ac73-9ff3-c2ed-9a1c-5200883144af"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "vhc01-vnet",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "eastus2",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/clientthings/providers/microsoft.network/virtualnet
works/vhc01-vnet"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/clientthings/providers/microsoft.network/virtualnet
works/vhc01-vnet/providers/Microsoft.Advisor/recommendations/f79f9cd7-743d-76b3-b357-ccf573477ba9",
      "type": "Microsoft.Advisor/recommendations",
      "name": "f79f9cd7-743d-76b3-b357-ccf573477ba9"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "development-northeurope",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "northeurope",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/networking/providers/microsoft.network/virtualnetwo
rks/development-northeurope"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/networking/providers/microsoft.network/virtualnetwo
rks/development-northeurope/providers/Microsoft.Advisor/recommendations/85024293-5555-12fb-b0ef-712c97db49fe",
      "type": "Microsoft.Advisor/recommendations",
      "name": "85024293-5555-12fb-b0ef-712c97db49fe"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "vnet-yukipractice",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "eastus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/yukipractice/providers/microsoft.network/virtualnet
works/vnet-yukipractice"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/yukipractice/providers/microsoft.network/virtualnet
works/vnet-yukipractice/providers/Microsoft.Advisor/recommendations/73494c3e-3169-193b-a414-2a7b85f41ae9",
      "type": "Microsoft.Advisor/recommendations",
      "name": "73494c3e-3169-193b-a414-2a7b85f41ae9"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "uswest-dev-test-lab",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "westus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/west-proviewpoc/providers/microsoft.network/virtual
networks/uswest-dev-test-lab"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/west-proviewpoc/providers/microsoft.network/virtual
networks/uswest-dev-test-lab/providers/Microsoft.Advisor/recommendations/5dd416c4-49c3-c0a1-1ef8-2fda306ad21f",
      "type": "Microsoft.Advisor/recommendations",
      "name": "5dd416c4-49c3-c0a1-1ef8-2fda306ad21f"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "sqlplaygroundvnet366",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "germanywestcentral",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/sqlplayground/providers/microsoft.network/virtualne
tworks/sqlplaygroundvnet366"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/sqlplayground/providers/microsoft.network/virtualne
tworks/sqlplaygroundvnet366/providers/Microsoft.Advisor/recommendations/7338755f-2a5d-9791-e3d2-5b206c07db52",
      "type": "Microsoft.Advisor/recommendations",
      "name": "7338755f-2a5d-9791-e3d2-5b206c07db52"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "vnet-ohmanagedinstance",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "eastus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/ohdemo/providers/microsoft.network/virtualnetworks/
vnet-ohmanagedinstance"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/ohdemo/providers/microsoft.network/virtualnetworks/
vnet-ohmanagedinstance/providers/Microsoft.Advisor/recommendations/110aaff8-aa87-596f-d508-dcbe7b0e2a84",
      "type": "Microsoft.Advisor/recommendations",
      "name": "110aaff8-aa87-596f-d508-dcbe7b0e2a84"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.NETWORK/VIRTUALNETWORKS",
        "impactedValue": "workers-vnet",
        "lastUpdated": "2024-04-29T11:30:24.6815021Z",
        "recommendationTypeId": "56f0c458-521d-4b8b-a704-c0a099483d19",
        "shortDescription": {
          "problem": "Use NAT gateway for outbound connectivity",
          "solution": "Use NAT gateway for outbound connectivity"
        },
        "extendedProperties": {
          "region": "westus",
          "recommendationControl": "HighAvailability",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/ncsbndbxmanaged/providers/microsoft.network/virtual
networks/workers-vnet"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/ncsbndbxmanaged/providers/microsoft.network/virtual
networks/workers-vnet/providers/Microsoft.Advisor/recommendations/7d14631c-2520-d09d-95df-abf357735e0e",
      "type": "Microsoft.Advisor/recommendations",
      "name": "7d14631c-2520-d09d-95df-abf357735e0e"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "MICROSOFT.COMPUTE/VIRTUALMACHINES",
        "impactedValue": "testbuildagent",
        "lastUpdated": "2024-04-29T06:16:54.4075795Z",
        "recommendationTypeId": "651c7925-17a3-42e5-85cd-73bd095cf27f",
        "shortDescription": {
          "problem": "Enable Backups on your Virtual Machines",
          "solution": "Enable Backups on your Virtual Machines"
        },
        "extendedProperties": {
          "isSQLIaaSExtensionPresent": "false",
          "isWindowsVm": "true",
          "vmLocation": "centralus",
          "recommendationControl": "DisasterRecovery",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/portal-test/providers/microsoft.compute/virtualmach
ines/testbuildagent"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourcegroups/portal-test/providers/microsoft.compute/virtualmach
ines/testbuildagent/providers/Microsoft.Advisor/recommendations/add5801e-9218-206f-0898-540e37f42b59",
      "type": "Microsoft.Advisor/recommendations",
      "name": "add5801e-9218-206f-0898-540e37f42b59"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "hfdevops",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "suppressionIds": [
          "a84509f4-382e-4f27-e47a-4e2255a80428"
        ],
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/HF-Devops/providers/Microsoft.Storage/storageAccoun
ts/hfdevops"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/HF-Devops/providers/Microsoft.Storage/storageAccoun
ts/hfdevops/providers/Microsoft.Advisor/recommendations/c03e7795-d86f-aaff-76a1-66557a4b83f0",
      "type": "Microsoft.Advisor/recommendations",
      "name": "c03e7795-d86f-aaff-76a1-66557a4b83f0"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "dbstoragemzfwd5mqdt2na",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/NCSBNDBxManaged/providers/Microsoft.Storage/storage
Accounts/dbstoragemzfwd5mqdt2na"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/NCSBNDBxManaged/providers/Microsoft.Storage/storage
Accounts/dbstoragemzfwd5mqdt2na/providers/Microsoft.Advisor/recommendations/c6821dc7-044c-0a0f-01c9-9e2d6b34fb9d",
      "type": "Microsoft.Advisor/recommendations",
      "name": "c6821dc7-044c-0a0f-01c9-9e2d6b34fb9d"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "databasebackpacks",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "suppressionIds": [
          "49bb509c-bf98-c9ae-f935-9ff671a16ff3"
        ],
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLDB-Demo/providers/Microsoft.Storage/storageAccou
nts/databasebackpacks"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLDB-Demo/providers/Microsoft.Storage/storageAccou
nts/databasebackpacks/providers/Microsoft.Advisor/recommendations/ab92dc41-d482-5e22-23b1-ff3fe12ca59c",
      "type": "Microsoft.Advisor/recommendations",
      "name": "ab92dc41-d482-5e22-23b1-ff3fe12ca59c"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "dcacaudit",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "suppressionIds": [
          "1ae6265c-6214-7765-4405-b8bd4273bd29"
        ],
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLDB-Demo/providers/Microsoft.Storage/storageAccou
nts/dcacaudit"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLDB-Demo/providers/Microsoft.Storage/storageAccou
nts/dcacaudit/providers/Microsoft.Advisor/recommendations/f5f5dfc6-0e0c-d77f-8cc1-5dc67e7b3bf1",
      "type": "Microsoft.Advisor/recommendations",
      "name": "f5f5dfc6-0e0c-d77f-8cc1-5dc67e7b3bf1"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "dcackeyvaultstorage",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "suppressionIds": [
          "fd6527b6-7147-0cd6-53f7-babf3eff0388"
        ],
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLDB-Development/providers/Microsoft.Storage/stora
geAccounts/dcackeyvaultstorage"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLDB-Development/providers/Microsoft.Storage/stora
geAccounts/dcackeyvaultstorage/providers/Microsoft.Advisor/recommendations/05086b53-cbdc-34c4-65c0-c7bd0f39be9e",
      "type": "Microsoft.Advisor/recommendations",
      "name": "05086b53-cbdc-34c4-65c0-c7bd0f39be9e"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "sqlplayground99c6",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLPlayground/providers/Microsoft.Storage/storageAc
counts/sqlplayground99c6"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLPlayground/providers/Microsoft.Storage/storageAc
counts/sqlplayground99c6/providers/Microsoft.Advisor/recommendations/38d12bee-0b42-ae07-2a9e-9935d07be86e",
      "type": "Microsoft.Advisor/recommendations",
      "name": "38d12bee-0b42-ae07-2a9e-9935d07be86e"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "sqlplaygrounddiag645",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLPlayground/providers/Microsoft.Storage/storageAc
counts/sqlplaygrounddiag645"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLPlayground/providers/Microsoft.Storage/storageAc
counts/sqlplaygrounddiag645/providers/Microsoft.Advisor/recommendations/31e91f1c-3e12-2414-2f7b-17c20bc10613",
      "type": "Microsoft.Advisor/recommendations",
      "name": "31e91f1c-3e12-2414-2f7b-17c20bc10613"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "sqlsamplebackup",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLPlayground/providers/Microsoft.Storage/storageAc
counts/sqlsamplebackup"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/SQLPlayground/providers/Microsoft.Storage/storageAc
counts/sqlsamplebackup/providers/Microsoft.Advisor/recommendations/089d40f2-8564-d692-0c05-3ed31fd3fc47",
      "type": "Microsoft.Advisor/recommendations",
      "name": "089d40f2-8564-d692-0c05-3ed31fd3fc47"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "cs410033fffa00b7835",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/cloud-shell-storage-westus/providers/Microsoft.Stor
age/storageAccounts/cs410033fffa00b7835"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/cloud-shell-storage-westus/providers/Microsoft.Stor
age/storageAccounts/cs410033fffa00b7835/providers/Microsoft.Advisor/recommendations/2fb86c1e-d9f5-92dd-45b3-91054ac2545
0",
      "type": "Microsoft.Advisor/recommendations",
      "name": "2fb86c1e-d9f5-92dd-45b3-91054ac25450"
    },
    {
      "properties": {
        "category": "HighAvailability",
        "impact": "Medium",
        "impactedField": "Microsoft.Storage/storageAccounts",
        "impactedValue": "cs4ee3cb3c03415x43eex8e6",
        "lastUpdated": "2024-04-29T20:32:26.418573Z",
        "recommendationTypeId": "42dbf883-9e4b-4f84-9da4-232b87c4b5e9",
        "shortDescription": {
          "problem": "Enable Soft Delete to protect your blob data",
          "solution": "Enable Soft Delete to protect your blob data"
        },
        "extendedProperties": {
          "recommendationControl": "BusinessContinuity",
          "maturityLevel": "GA"
        },
        "resourceMetadata": {
          "resourceId":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/cloud-shell-storage-westus/providers/Microsoft.Stor
age/storageAccounts/cs4ee3cb3c03415x43eex8e6"
        }
      },
      "id":
"/subscriptions/ee3cb3c0-3415-43ee-8e63-a0170716ee9e/resourceGroups/cloud-shell-storage-westus/providers/Microsoft.Stor
age/storageAccounts/cs4ee3cb3c03415x43eex8e6/providers/Microsoft.Advisor/recommendations/41f06d89-6d86-2e07-8b52-38d882
5e1c0c",
      "type": "Microsoft.Advisor/recommendations",
      "name": "41f06d89-6d86-2e07-8b52-38d8825e1c0c"
    }
  ]
}

DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:

DEBUG: Finally:
DEBUG: CmdletAfterAPICall:
DEBUG: [CmdletProcessRecordAsyncEnd]: Finish HTTP process
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: 2:16:00 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Advisor:2.0.0; CommandName: Get-AzAdvisorRecommendation; PSVersion: 5.1.22621.2506;
IsSuccess: True; Duration: 00:00:01.0499608

Environment data

PS C:\Users\denny> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

PS C:\Users\denny> Get-Module Az*

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.13.1     Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear...
Script     2.0.0      Az.Advisor                          {Disable-AzAdvisorRecommendation, Enable-AzAdvisorRecommen...

PS C:\Users\denny>

Error output

PS C:\Users\denny> Resolve-AzError
DEBUG: 2:17:08 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 2:17:08 PM - using account id 'something@dcac.com'...
DEBUG: 2:17:08 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].

DEBUG: 2:17:08 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 2:17:08 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default
value [False].
DEBUG: AzureQoSEvent:  Module: Az.Accounts:2.13.1; CommandName: Resolve-AzError; PSVersion: 5.1.22621.2506; IsSuccess:
True; Duration: 00:00:00.0183397
DEBUG: 2:17:08 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 2:17:08 PM - ResolveError end processing.
Alex-wdy commented 6 months ago

@mrdenny Thank you for your report, we will follow up this issue with the advisor team.

Alex-wdy commented 6 months ago

@mojayara @jportugal0 Can you take a look at this issue?

pkrishnanms commented 3 months ago

@Alex-wdy could you please share how it was before? where it used to have a bunch of recommendations in the ExtendedProperties value.

I believe ExtendedProperties is working as excepted in the response shared above. It is an object that contains more info about the recommendation, and the fields/ details in this object vary from recommendation to recommendation.

Alex-wdy commented 3 months ago

@mrdenny Can you provide feedback on what you saw on your side ?

mrdenny commented 3 months ago

If you pull down the list of Azure recommendations $a = Get-AzAdvisorRecommendation Then pull the extended Metadata Properties (or the Extended Properties) $a[0].ExposedMetadataProperty

All you get back is an empty recordset.

Keys Values Count AdditionalProperties


{} {} 0 {}

Several months ago this would bring back values. If I look in the portal and find the same advisor recommendation there's data there, but there isn't when returning the data from powershell, and I'm not seeing a way to tell the cmdlet to return these values.

pkrishnanms commented 3 months ago

Debugging the issue. $a = Get-AzAdvisorRecommendation when I do $a[0].ToJsonstring() -> this shows all the data in the response when converted to json string. and I can also see that $a[0] has properties named -ExposedMetadataProperty, ExtendedProperty, etc but when I do $a[0].ExtendedProperty its empty

pkrishnanms commented 5 days ago

As a workaround, please use toJsonString() method on the response to retrieve the necessary data. Alternatively, you can also utilize the advisor's get recommendations API call directly.

Example: $z = Get-AzAdvisorRecommendation $z[0].toJsonstring() -> this will have the data Parse it to get the fields - $a = $z[0].toJsonstring() | convertFrom-Json $a.properties.extendedProperties

Alex-wdy commented 3 days ago

As a workaround, please use toJsonString() method on the response to retrieve the necessary data. Alternatively, you can also utilize the advisor's get recommendations API call directly.

Example: $z = Get-AzAdvisorRecommendation $z[0].toJsonstring() -> this will have the data Parse it to get the fields - $a = $z[0].toJsonstring() | convertFrom-Json $a.properties.extendedProperties

I would like to ask if you have plans to integrate this workaround into the PowerShell command line so that users do not need to write complex scripts.

Or in the documentation, highlight this point in the document.