turbot/azuredevops
steampipe plugin install azuredevops

Azure DevOps + Steampipe

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

Azure DevOps is a software as a service (SaaS) platform that provides DevOps practices and tools for the end-to-end software life cycle.

List your Azure DevOps projects:

select
id,
name,
state,
visibility
from
azuredevops_project;
+--------------------------------------+-----------------+------------+------------+
| id | name | state | visibility |
+--------------------------------------+-----------------+------------+------------+
| bdcdf70b-7757-4253-b36c-33c08ca07dbb | test-1 | wellFormed | private |
| 9a1f26ce-c715-4ef4-b557-503fdb6be55a | private_project | wellFormed | private |
+--------------------------------------+-----------------+------------+------------+

Documentation

Quick start

Install

Download and install the latest Azure DevOps plugin:

steampipe plugin install azuredevops

Credentials

ItemDescription
CredentialsAzure DevOps requires an Organization URL and a Personal Access Token for all requests.
PermissionsPersonal Access Tokens have the same permissions as the user who creates them, and if the user permissions change, the Personal Access Token permissions also change.
RadiusEach connection represents a single Azure DevOps Installation.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/azuredevops.spc)
2. Credentials specified in environment variables, e.g., AZDO_ORG_SERVICE_URL and AZDO_PERSONAL_ACCESS_TOKEN.

Configuration

Installing the latest azuredevops plugin will create a config file (~/.steampipe/config/azuredevops.spc) with a single connection named azuredevops:

Configure your account details in ~/.steampipe/config/azuredevops.spc:

connection "azuredevops" {
plugin = "azuredevops"
# `organization_url`: Azure DevOps Organization URL. (Required)
# For more information on the Organization URL, please see https://learn.microsoft.com/en-us/azure/devops/extend/develop/work-with-urls?view=azure-devops&tabs=http.
# Can also be set with the AZDO_ORG_SERVICE_URL environment variable.
# organization_url = "https://dev.azure.com/test"
# `personal_access_token`: Azure DevOps Personal Access Token. (Required)
# For more information on the Personal Access Token, please see https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows.
# Can also be set with the AZDO_PERSONAL_ACCESS_TOKEN environment variable.
# personal_access_token = "wf3hahidy7i7fkzmeqr3e6fbjwuspabpo766grp7hl4o65v2"
}

Alternatively, you can also use the standard Azure DevOps environment variables to obtain credentials only if other arguments (organization_url and personal_access_token) are not specified in the connection:

export AZDO_ORG_SERVICE_URL=https://dev.azure.com/test
export AZDO_PERSONAL_ACCESS_TOKEN=wf3hahidy7i7fkzmeqr3e6fbjwuspabpo766grp7hl4o65v2

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- azuredevops

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_azuredevops;
CREATE SERVER steampipe_azuredevops FOREIGN DATA WRAPPER steampipe_postgres_azuredevops OPTIONS (config '<your_config>');
CREATE SCHEMA azuredevops;
IMPORT FOREIGN SCHEMA azuredevops FROM SERVER steampipe_azuredevops INTO azuredevops;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- azuredevops

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_azuredevops function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_azuredevops.so
sqlite> select steampipe_configure_azuredevops('<your_config>');

Export

This plugin is available as a standalone Export 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)" -- azuredevops

You can pass the configuration to the command with the --config argument:

steampipe_export_azuredevops --config '<your_config>' <table_name>