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

Add table azure_log_analytics_workspace #767

Closed Priyanka-Chatterjee-2000 closed 4 weeks ago

Priyanka-Chatterjee-2000 commented 1 month 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_log_analytics_workspace [] PRETEST: tests/azure_log_analytics_workspace TEST: tests/azure_log_analytics_workspace Running terraform data.azuread_client_config.current: Reading... data.azuread_client_config.current: Read complete after 0s [id=aaaaa888-8aa8-8aaa-aaaa-8a88a84d7f64-04b07795-8ddb-461a-bbee-02f9e1bf7b46-59f1a908-649f-4b49-927a-9e26a88b448f] Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: # azurerm_log_analytics_workspace.named_test_resource will be created + resource "azurerm_log_analytics_workspace" "named_test_resource" { + allow_resource_only_permissions = true + daily_quota_gb = -1 + id = (known after apply) + internet_ingestion_enabled = true + internet_query_enabled = true + local_authentication_disabled = false + location = "westus" + name = "turbottest68835" + primary_shared_key = (sensitive value) + resource_group_name = "turbottest68835" + retention_in_days = 30 + secondary_shared_key = (sensitive value) + sku = "PerGB2018" + tags = { + "name" = "turbottest68835" } + workspace_id = (known after apply) } # azurerm_resource_group.named_test_resource will be created + resource "azurerm_resource_group" "named_test_resource" { + id = (known after apply) + location = "westus" + name = "turbottest68835" } Plan: 2 to add, 0 to change, 0 to destroy. Changes to Outputs: + resource_aka = (known after apply) + resource_aka_lower = (known after apply) + resource_id = (known after apply) + resource_name = "turbottest68835" azurerm_resource_group.named_test_resource: Creating... azurerm_resource_group.named_test_resource: Still creating... [10s elapsed] azurerm_resource_group.named_test_resource: Creation complete after 15s [id=/subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourceGroups/turbottest68835] azurerm_log_analytics_workspace.named_test_resource: Creating... azurerm_log_analytics_workspace.named_test_resource: Still creating... [10s elapsed] azurerm_log_analytics_workspace.named_test_resource: Still creating... [20s elapsed] azurerm_log_analytics_workspace.named_test_resource: Still creating... [30s elapsed] azurerm_log_analytics_workspace.named_test_resource: Creation complete after 33s [id=/subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourceGroups/turbottest68835/providers/Microsoft.OperationalInsights/workspaces/turbottest68835] Apply complete! Resources: 2 added, 0 changed, 0 destroyed. Outputs: resource_aka = "azure:///subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourceGroups/turbottest68835/providers/Microsoft.OperationalInsights/workspaces/turbottest68835" resource_aka_lower = "azure:///subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835" resource_id = "/subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835" resource_name = "turbottest68835" Running SQL query: test-get-query.sql [ { "name": "turbottest68835", "region": "westus", "resource_group": "turbottest68835", "retention_in_days": 30 } ] ✔ PASSED Running SQL query: test-hydrate-query.sql [ { "akas": [ "azure:///subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835", "azure:///subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835" ], "name": "turbottest68835" } ] ✔ PASSED Running SQL query: test-list-query.sql [ { "id": "/subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835", "name": "turbottest68835" } ] ✔ PASSED Running SQL query: test-not-found-query.sql [] ✔ PASSED Running SQL query: test-turbot-query.sql [ { "akas": [ "azure:///subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835", "azure:///subscriptions/d5555555-a55a-5555-aaa5-555a5a55555a/resourcegroups/turbottest68835/providers/microsoft.operationalinsights/workspaces/turbottest68835" ], "name": "turbottest68835", "tags": { "name": "turbottest68835" }, "title": "turbottest68835" } ] ✔ PASSED POSTTEST: tests/azure_log_analytics_workspace TEARDOWN: tests/azure_log_analytics_workspace SUMMARY: 1/1 passed. ```

Example query results

Results # Example query results Results ``` select name, id, location from azure_log_analytics_workspace; +--------------+-----------------------------------------------------------------------------------------------------------------------------------------+----------+ | name | id | location | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------+----------+ | test-flowlog | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/demo/providers/Microsoft.OperationalInsights/workspaces/test-flowlog | westus2 | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------+----------+ > select name, id, retention_in_days from azure_log_analytics_workspace where retention_in_days > 30; +------+----+-------------------+ | name | id | retention_in_days | +------+----+-------------------+ +------+----+-------------------+ > select name, id, enable_data_export from azure_log_analytics_workspace where enable_data_export = true; +------+----+--------------------+ | name | id | enable_data_export | +------+----+--------------------+ +------+----+--------------------+ > select name, id, enable_data_export from azure_log_analytics_workspace where enable_data_export = true; +------+----+--------------------+ | name | id | enable_data_export | +------+----+--------------------+ +------+----+--------------------+ > select name, id, disable_local_auth from azure_log_analytics_workspace where disable_local_auth = true; +------+----+--------------------+ | name | id | disable_local_auth | +------+----+--------------------+ +------+----+--------------------+ > select name, id, private_link_scoped_resources from azure_log_analytics_workspace where private_link_scoped_resources is not null; +------+----+-------------------------------+ | name | id | private_link_scoped_resources | +------+----+-------------------------------+ +------+----+-------------------------------+ > select name, id, force_cmk_for_query from azure_log_analytics_workspace where force_cmk_for_query = true; +------+----+---------------------+ | name | id | force_cmk_for_query | +------+----+---------------------+ +------+----+---------------------+ ```