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
34 stars 15 forks source link

Fix column `autoscale_settings_max_throughput` in table azure_cosmosdb_sql_database #772

Open khushboo9024 opened 3 weeks ago

khushboo9024 commented 3 weeks ago

Describe the bug The column autoscale_settings_max_throughput in the table azure_cosmosdb_sql_database is coming up as null even though we have data.

Steampipe version (steampipe -v) Example: v0.3.0

Plugin version (steampipe plugin list) Example: v0.5.0

To reproduce Steps to reproduce the behavior (please include relevant code and/or commands).

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

ParthaI commented 3 weeks ago

Hi @khushboo9024, As per my findings the APIs(List/Get) have a property named MaxThroughput under SQLDatabaseGetProperties. However, the API is returning null value for this property all the time.

Thanks!

ParthaI commented 3 weeks ago

@khushboo9024, I have pushed a rough code into the issue-772 branch that adds a new table called azure_cosmosdb_sql_container. With this, I am able to retrieve the throughput details for the containers.

> select name,account_name, database_name, jsonb_pretty(throughput_settings)  from azure_cosmosdb_sql_container
+--------+--------------+---------------+---------------------------+
| name   | account_name | database_name | jsonb_pretty              |
+--------+--------------+---------------+---------------------------+
| test53 | test93       | test63        | <null>                    |
| Items  | tes-acc33    | ToDoList      | {                         |
|        |              |               |     "Resource": {         |
|        |              |               |         "throughput": 400 |
|        |              |               |     }                     |
|        |              |               | }                         |
+--------+--------------+---------------+---------------------------+

Time: 5.4s. Rows returned: 2. Rows fetched: 2. Hydrate calls: 2.

Please give it a go in the PR branch and let me know if that helps. I will do some cleanup in the branch and raise the PR then.

Thanks!