Using Steampipe in Azure Cloud Shell

Azure Cloud Shell is a browser-based shell preloaded with tools to create and manage your Azure resources. Because the cloud shell includes the CLI and launches with your credentials, you can quickly install Steampipe along with the Azure plugin and then instantly query your Azure resources.

About the Azure Cloud Shell

The Cloud Shell is free to all Azure users. It comes with a few limitations. For example, it will use an existing resource group but must be able to create storage accounts and file shares. You may incur a cost for the file share that persists your data. Also, since you are not a user with permission to sudo and cannot modify files or directories outside your home directory, we will install Steampipe there and refer to it as ./steampipe. Finally, be aware that Azure will shut down your session if inactive for 20 minutes.

To start the shell, look for its icon on the top navigation bar of the Azure portal.

When you launch the shell for the first time, you will see this dialog box.

Click Create storage to continue.

Installing Steampipe in Azure Cloud Shell

To install Steampipe, copy and run this command.

curl -s -L | tar -xzvf -

To install the Azure plugin, copy and run this command.

./steampipe plugin install azure

Your output should look like this:

Installed plugin: azure@latest v0.31.0

Run your first query

To launch Steampipe in query mode, do this:

./steampipe query

Steampipe prints a welcome message and a prompt.

Welcome to Steampipe v0.16.3
For more information, type .help

Let's query the azure_subscription table.

> select
| subscription_id | display_name | state | authorization_source | subscription_policies |
| 3510aexd-53Qb-496d-8f30-53x9616fc6c1 | Stacy AAA | Enabled | RoleBased | {} |

That's it! You didn't have to read Azure API docs, or install an API client library, or learn how to use that client to make API calls and unpack JSON responses. Steampipe did all that for you. It works the same way for every Azure table. And because you can use SQL to join across Azure tables, it's easy to reason over your entire Azure infrastructure.

To see the full set of columns for any table, along with examples of their use, visit the Steampipe Hub. For quick reference you can autocomplete table names directly in the shell.

If you haven't used SQL lately, see our handy guide for writing Steampipe queries.