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

Added column tags in azure_subscription table Closes #783 #784

Closed ParthaI closed 3 months ago

ParthaI commented 3 months ago

Integration test logs

Logs ``` No env file present for the current environment: staging Falling back to .env config No env file present for the current environment: staging customEnv TURBOT_TEST_EXPECTED_TIMEOUT undefined SETUP: tests/azure_subscription [] PRETEST: tests/azure_subscription TEST: tests/azure_subscription Running terraform data.azuread_client_config.current: Reading... data.azuread_client_config.current: Read complete after 0s [id=cdffd708-7da0-4cea-abeb-0a4c334d7f64-04b07795-8ddb-461a-bbee-02f9e1bf7b46-06fd46b0-a867-49a1-a4f1-f7768465caba] data.azurerm_subscription.current: Reading... data.azurerm_subscription.current: Read complete after 1s [id=/subscriptions/********-****-****-****-************] Changes to Outputs: + current_subscription_display_name = "newwarriors AAA" + subscription_id = "********-****-****-****-************" You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure. Apply complete! Resources: 0 added, 0 changed, 0 destroyed. Outputs: current_subscription_display_name = "newwarriors AAA" subscription_id = "********-****-****-****-************" Running SQL query: test-list-query.sql Time: 1.3s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) azure_subscription.azure: Time: 1.1s. Fetched: 1. Hydrates: 0. Quals: subscription_id=********-****-****-****-************. [ { "display_name": "newwarriors AAA", "subscription_id": "********-****-****-****-************" } ] ✔ PASSED Running SQL query: test-notfound-query.sql Time: 1.3s. Rows returned: 0. Rows fetched: 1. Hydrate calls: 0. Scans: 1) azure_subscription.azure: Time: 1.1s. Fetched: 1. Hydrates: 0. Quals: display_name=dummy-. [] ✔ PASSED Running SQL query: test-turbot-query.sql Time: 1.3s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) azure_subscription.azure: Time: 1.0s. Fetched: 1. Hydrates: 0. Quals: display_name=newwarriors AAA. [ { "display_name": "newwarriors AAA", "title": "newwarriors AAA" } ] ✔ PASSED POSTTEST: tests/azure_subscription TEARDOWN: tests/azure_subscription SUMMARY: 1/1 passed. ```

Example query results

Results ``` > select display_name, tags from azure_subscription +-----------------+-------------------------------------------+ | display_name | tags | +-----------------+-------------------------------------------+ | newwarriors AAA | {"budget":"300","owner":"abcd@gmail.com"} | +-----------------+-------------------------------------------+ ```