turbot / steampipe-plugin-azure

Use SQL to instantly query Azure resources across regions and subscriptions. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/azure
Apache License 2.0
37 stars 17 forks source link

Add table azure_reserved_instance_recomendations #666

Closed Lachlan-White closed 7 months ago

Lachlan-White commented 12 months ago

References List API: https://github.com/Azure/azure-sdk-for-go/blob/v58.0.0/services/consumption/mgmt/2019-10-01/consumption/reservationrecommendations.go#L49

ParthaI commented 9 months ago

@Lachlan-White, my apologies for not communicating on this issue for quite some time. I've created a draft pull request addressing this matter, which includes the addition of a table called azure_reservation_recommendation.

I can't test the code changes due to the lack of resource availability in the portal.

Would you be able to test it out on the PR branch issue-666 and share your feedback with us regarding whether the new table fulfills the requirements?

Steps for testing out the branch issue-666:

  1. Clone the repository: git clone https://github.com/turbot/steampipe-plugin-azure.git
  2. Navigate to the steampipe-plugin-azure directory: cd steampipe-plugin-azure
  3. Switch to the issue-666 branch: git checkout issue-666
  4. Run the command make to build the changes.
  5. Run the query(select * from azure_reservation_recommendation)

Note: It's possible to tailor the recommendations by applying filters on columns such as look_back_period, resource_type, or scope in the query parameters. By default, the table retrieves data for the resource type VirtualMachines and uses a Single scope, focusing on the usage of the past seven days to generate recommendations.

Thanks!

Lachlan-White commented 9 months ago

@ParthaI, no worries appreciate the effort.

I followed your steps and received the below output from the table: image

Expected output returning for the below though:

image
ParthaI commented 9 months ago

@Lachlan-White, Thanks for testing the PR branch and sharing the feedback with us.

I have been experimenting with APIs to enumerate all reservation recommendations for a specific scope.

According to the Official API Documentation, it is possible to filter and list reservation recommendations by specifying a scope. However, I've encountered a challenge where the API consistently yields an empty array, instead of the expected result sets.

I have initiated a support request with the Azure SDK repository to address and resolve this anomaly. For updates and further details on the progress of this issue, it can be tracked here: Azure SDK GitHub Issue #22071.

Thanks!

bigdatasourav commented 7 months ago

@Lachlan-White, closing the issue for now; we will revisit and work on it once we get an update from the Azure SDK team on the above issue.