Table: azure_app_service_web_app_slot - Query Azure App Service Web App Slots using SQL
Azure App Service Web App Slots are live apps with their own hostnames. They are part of Azure App Service and are designed to help developers handle app deployments. With slots, you can deploy your apps in a controlled manner and avoid downtime.
Table Usage Guide
The azure_app_service_web_app_slot
table provides insights into Azure App Service Web App Slots. As a developer or DevOps engineer, you can use this table to get detailed information about each slot, including its configuration, status, and metadata. This can be particularly useful when managing app deployments and ensuring smooth transitions between different versions of your app.
Examples
Basic info
Explore which web app slots are currently active within the Azure App Service. This allows you to assess their status, identify the ones that have been recently modified, and understand their configuration for better management and optimization.
select name, app_name, id, kind, state, type, last_modified_time_utc, repository_site_name, enabledfrom azure_app_service_web_app_slot;
select name, app_name, id, kind, state, type, last_modified_time_utc, repository_site_name, enabledfrom azure_app_service_web_app_slot;
List slots where the apps are enabled
Examine the active slots within Azure's app service to understand where applications are currently operational. This is useful for managing resources, ensuring optimal app performance, and identifying potential areas for scaling or re-allocation.
select name, app_name, state, type, reserved, server_farm_id, target_swap_slot enabledfrom azure_app_service_web_app_slotwhere enabled;
select name, app_name, state, type, reserved, server_farm_id, target_swap_slot, enabledfrom azure_app_service_web_app_slotwhere enabled = 1;
List slots that accept HTTP traffic (i.e only HTTPS is disabled)
Determine the areas in your Azure App Service where only HTTP traffic is allowed, which could potentially expose your web applications to security risks. This query is useful to identify these areas and implement necessary security measures to restrict traffic to HTTPS only.
select name, https_only, kind, regionfrom azure_app_service_web_app_slotwhere not https_only;
select name, https_only, kind, regionfrom azure_app_service_web_app_slotwhere https_only = 0;
Host names of each slot
Determine the areas in which your Azure App Service Web App Slots are being utilized. This can help you understand the distribution of your resources across different regions and resource groups, aiding in efficient resource management.
select name, host_names, kind, region, resource_groupfrom azure_app_service_web_app_slot;
select name, host_names, kind, region, resource_groupfrom azure_app_service_web_app_slot;
List enabled host names
Determine the areas in which host names are enabled to ensure the proper functioning of your Azure App Service Web App Slots. This allows you to manage and monitor your web applications effectively.
select name, id, type, kind, enabled_host_namesfrom azure_app_service_web_app_slot;
select name, id, type, kind, enabled_host_namesfrom azure_app_service_web_app_slot;
Get slot swap status of each slot
This query allows you to monitor the status of slot swaps in your Azure App Service Web App Slots. It's useful for keeping track of your deployment process and ensuring smooth transitions between different versions of your web applications.
select name, type, slot_swap_status ->> 'SlotSwapStatus' as slot_swap_status, slot_swap_status ->> 'SourceSlotName' as source_slot_name, slot_swap_status ->> 'DestinationSlotName' as destination_slot_namefrom azure_app_service_web_app_slot;
select name, type, json_extract(slot_swap_status, '$.SlotSwapStatus') as slot_swap_status, json_extract(slot_swap_status, '$.SourceSlotName') as source_slot_name, json_extract(slot_swap_status, '$.DestinationSlotName') as destination_slot_namefrom azure_app_service_web_app_slot;
Get site config details of each slot
Explore the configuration details of each slot in your Azure App Service Web App to understand the settings of individual workers and software versions. This can be useful for performance tuning and troubleshooting.
select name, id, site_config ->> 'NumberOfWorkers' as number_of_workers, site_config ->> 'DefaultDocuments' as DefaultDocuments, site_config ->> 'NetFrameworkVersion' as NetFrameworkVersion, site_config ->> 'PhpVersion' as PhpVersion, site_config ->> 'PythonVersion' as PythonVersion, site_config ->> 'NodeVersion' as NodeVersion, site_config ->> 'PowerShellVersion' as PowerShellVersion, site_config ->> 'LinuxFxVersion' as LinuxFxVersion, site_config ->> 'WindowsFxVersion' as WindowsFxVersion, site_config ->> 'RequestTracingEnabled' as RequestTracingEnabled, site_config ->> 'RequestTracingExpirationTime' as RequestTracingExpirationTime, site_config ->> 'RemoteDebuggingEnabled' as RemoteDebuggingEnabled, site_config ->> 'RemoteDebuggingVersion' as RemoteDebuggingVersion, site_config ->> 'HTTPLoggingEnabled' as HTTPLoggingEnabled, site_config ->> 'DetailedErrorLoggingEnabled' as DetailedErrorLoggingEnabled, site_config ->> 'PublishingUsername' as PublishingUsername, site_config ->> 'AppSettings' as AppSettings, site_config ->> 'ConnectionStrings' as ConnectionStrings, site_config ->> 'MachineKey' as MachineKey, site_config ->> 'HandlerMappings' as HandlerMappings, site_config ->> 'DocumentRoot' as DocumentRootfrom azure_app_service_web_app_slot;
select name, id, json_extract(site_config, '$.NumberOfWorkers') as number_of_workers, json_extract(site_config, '$.DefaultDocuments') as DefaultDocuments, json_extract(site_config, '$.NetFrameworkVersion') as NetFrameworkVersion, json_extract(site_config, '$.PhpVersion') as PhpVersion, json_extract(site_config, '$.PythonVersion') as PythonVersion, json_extract(site_config, '$.NodeVersion') as NodeVersion, json_extract(site_config, '$.PowerShellVersion') as PowerShellVersion, json_extract(site_config, '$.LinuxFxVersion') as LinuxFxVersion, json_extract(site_config, '$.WindowsFxVersion') as WindowsFxVersion, json_extract(site_config, '$.RequestTracingEnabled') as RequestTracingEnabled, json_extract(site_config, '$.RequestTracingExpirationTime') as RequestTracingExpirationTime, json_extract(site_config, '$.RemoteDebuggingEnabled') as RemoteDebuggingEnabled, json_extract(site_config, '$.RemoteDebuggingVersion') as RemoteDebuggingVersion, json_extract(site_config, '$.HTTPLoggingEnabled') as HTTPLoggingEnabled, json_extract(site_config, '$.DetailedErrorLoggingEnabled') as DetailedErrorLoggingEnabled, json_extract(site_config, '$.PublishingUsername') as PublishingUsername, json_extract(site_config, '$.AppSettings') as AppSettings, json_extract(site_config, '$.ConnectionStrings') as ConnectionStrings, json_extract(site_config, '$.MachineKey') as MachineKey, json_extract(site_config, '$.HandlerMappings') as HandlerMappings, json_extract(site_config, '$.DocumentRoot') as DocumentRootfrom azure_app_service_web_app_slot;
Schema for azure_app_service_web_app_slot
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. | |
app_name | text | = | The name of the application. |
availability_state | text | Management information availability state for the app. Possible values include: 'Normal', 'Limited', 'DisasterRecoveryMode'. | |
client_affinity_enabled | boolean | True to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true. | |
client_cert_exclusion_paths | text | Client certificate authentication comma-separated exclusion paths. | |
client_cert_mode | text | This composes with ClientCertEnabled setting. ClientCertEnabled: false means ClientCert is ignored. ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required.ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. Possible values include: 'Required', 'Optional'. | |
cloud_environment | text | The Azure Cloud Environment. | |
container_size | bigint | Size of the function container. | |
custom_domain_verification_id | text | Unique identifier that verifies the custom domains assigned to the app. The customer will add this ID to a text record for verification. | |
default_host_name | text | Default hostname of the app. | |
enabled | boolean | Indicates wheather the app is enabled. | |
enabled_host_names | jsonb | Enabled hostnames for the app. Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, the app is not served on those hostnames. | |
host_name_ssl_states | jsonb | Hostname SSL states are used to manage the SSL bindings for app's hostnames. | |
host_names | jsonb | Hostnames associated with the app. | |
host_names_disabled | boolean | True to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management process. | |
hosting_environment_profile | jsonb | App Service Environment to use for the app. | |
https_only | boolean | Configures a web site to accept only https requests. | |
hyper_v | boolean | Hyper-V sandbox. | |
id | text | Resource ID of the app slot. | |
identity | jsonb | Managed service identity. | |
is_default_container | boolean | True if the app is a default container; otherwise, false. | |
is_xenon | boolean | Obsolete: Hyper-V sandbox. | |
kind | text | Contains the kind of the resource. | |
last_modified_time_utc | timestamp with time zone | Last time the app was modified, in UTC. | |
name | text | = | Resource Name. |
outbound_ip_addresses | text | List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. | |
possible_outbound_ip_addresses | text | List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. | |
redundancy_mode | text | Site redundancy mode. Possible values include: 'RedundancyModeNone', 'RedundancyModeManual', 'RedundancyModeFailover', 'RedundancyModeActiveActive', 'RedundancyModeGeoRedundant'. | |
region | text | The Azure region/location in which the resource is located. | |
repository_site_name | text | Name of the repository site. | |
reserved | boolean | True if reserved; otherwise, false. | |
resource_group | text | = | The resource group which holds this resource. |
scm_site_also_stopped | boolean | True to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. | |
server_farm_id | text | Resource ID of the associated App Service plan, formatted as: '/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}'. | |
site_config | jsonb | Configuration of the app. | |
site_config_resource | jsonb | Configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. | |
slot_swap_status | jsonb | Status of the last deployment slot swap operation. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | Current state of the app. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
suspended_till | timestamp with time zone | App suspended till in case memory-time quota is exceeded. | |
tags | jsonb | A map of tags for the resource. | |
target_swap_slot | text | Specifies which deployment slot this app will swap into. | |
title | text | Title of the resource. | |
traffic_manager_host_names | jsonb | Azure Traffic Manager hostnames associated with the app. | |
type | text | Resource type. | |
usage_state | text | State indicating whether the app has exceeded its quota usage. Read-only. Possible values include: 'UsageStateNormal', 'UsageStateExceeded'. |
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_app_service_web_app_slot