Microsoft SQL Server

Connect to SQL Server from Airplane tasks and runbooks.
The Microsoft SQL Server resource allows tasks and runbooks to connect to a Microsoft SQL Server database. For a high-level introduction to resources, see the resources page.

Creating a Microsoft SQL Server resource

To create a new Microsoft SQL Server resource, visit resources for your team, click the "New" button, and select the Microsoft SQL Server resource type. Enter your connection details in the form:
Name should be a human-readable name for your resource.
Host should be the IP address or DNS name of your database. Unless you're connecting to this database behind a self-hosted agent (see Private Networking below), this should be the public IP address and/or the public DNS name of the database.

IP whitelisting

If your database has restrictions on incoming network connections, you'll need to ensure the Airplane IP addresses are whitelisted:
  • 34.121.89.145
  • 34.68.100.27
  • 34.72.182.225

Private networking

To connect to a database inside a private VPC, you can self-host the agent and run the agent within your own VPC. Since tasks and SQL queries run on agents, these tasks will run from within your network and be able to connect.

Field reference

When this resource is attached to a task, its fields are available in the JSON environment variable AIRPLANE_RESOURCES under the alias it was attached with. The available fields are documented below.
idstring

The ID of the resource.

slugstring

The slug of the resource as defined in the resource settings page.

namestring

The name of the resource.

kindstring(value: sqlserver)

The kind of the resource.

usernamestring

The login username.

hoststring

The host of the server.

portstring

The port of the server.

databasestring

The name of the database.

The encryption mode setting (disable or true).

passwordstring

The login password.

dsnstring

The dsn of the server.

sshHoststring

Optional SSH host for tunneling.

sshPortstring

Optional SSH port for tunneling.

Optional SSH username for tunneling.

Optional SSH private key for tunneling.