Table: azure_route_table - Query Azure Route Tables using SQL
A Route Table contains a set of rules, called routes, that are used to determine where network traffic is directed. Each subnet in an Azure virtual network is configured with a route table, which can be associated to one or more virtual network subnets. These tables enable you to control the flow of traffic for a subnet.
Table Usage Guide
The azure_route_table
table provides insights into Route Tables within Microsoft Azure. As a network administrator, explore route-specific details through this table, including associated subnets, address prefixes, and next hop types. Utilize it to uncover information about network traffic flow, such as the routing of packets, the direction of traffic, and the configuration of subnets.
Examples
List of subnets associated with route table
Discover the segments of your network by identifying the subnets associated with a specific route table in your Azure environment. This can help in network management and security by providing insights into the organization of your network infrastructure.
select name, split_part(subnet ->> 'id', '/', 11) subnet, regionfrom azure_route_table cross join jsonb_array_elements(subnets) as subnet;
Error: SQLite does not support splitor string_to_array functions.
List of route tables where route propagation is enabled
Determine the areas in which route propagation is active in your Azure Route Table. This is beneficial for understanding network traffic flow and ensuring optimal routing configurations.
select name, disable_bgp_route_propagation, regionfrom azure_route_tablewhere not disable_bgp_route_propagation;
select name, disable_bgp_route_propagation, regionfrom azure_route_tablewhere disable_bgp_route_propagation = 0;
Route info of each routes table
This query helps users gain insights into the routing information of each route in their Azure network. The practical application of this query is to understand the network flow and the next hop type for each route, which is crucial for network troubleshooting and optimization.
select name, route ->> 'name' route_name, route -> 'properties' ->> 'addressPrefix' address_prefix, route -> 'properties' ->> 'nextHopType' next_hop_typefrom azure_route_table cross join jsonb_array_elements(routes) as route;
select name, json_extract(route.value, '$.name') as route_name, json_extract(route.value, '$.properties.addressPrefix') as address_prefix, json_extract(route.value, '$.properties.nextHopType') as next_hop_typefrom azure_route_table, json_each(routes) as route;
Query examples
Schema for azure_route_table
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cloud_environment | text | The Azure Cloud Environment. | |
disable_bgp_route_propagation | boolean | Indicates Whether to disable the routes learned by BGP on that route table. True means disable. | |
etag | text | An unique read-only string that changes whenever the resource is updated | |
id | text | Contains ID to identify a route table uniquely | |
name | text | = | The friendly name that identifies the route table |
provisioning_state | text | The provisioning state of the route table resource | |
region | text | The Azure region/location in which the resource is located. | |
resource_group | text | = | The resource group which holds this resource. |
routes | jsonb | A list of routes contained within a route table | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subnets | jsonb | A list of references to subnets | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
type | text | Type of the resource |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- azure
You can pass the configuration to the command with the --config
argument:
steampipe_export_azure --config '<your_config>' azure_route_table