> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/sast-and-sca/prezero/static-analysis-sast/workflows/teamcity.md).

# TeamCity

This article shows you how to integrate Qwiet AI by Harness into your TeamCity workflow to provide automated code analysis.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

This tutorial assumes that you have:

* [Installed TeamCity](https://www.jetbrains.com/help/teamcity/installation.html)
* [Set up Qwiet AI by Harness](broken://spaces/uPVBkglG6gsk2SsnsKgG/pages/fDfomI4jhzwCNFxmGSLc) onto your TeamCity server

## Step 1: Create your environment variables <a href="#step-1-create-your-environment-variables" id="step-1-create-your-environment-variables"></a>

In TeamCity, [define the following environment variables](https://www.jetbrains.com/help/teamcity/configuring-build-parameters.html#ConfiguringBuildParameters-TypesofBuildParameters) containing authentication information for Qwiet:

| **Variable**             | **Value**         |
| ------------------------ | ----------------- |
| `SHIFTLEFT_ACCESS_TOKEN` | Your Access Token |

When running in a production environment, we recommend using a CI token as the access token. You can [create your CI token](/sast-and-sca/prezero/integrations/tokens.md) in the Qwiet Dashboard.

Please note that the presence of any set environment variables will override those in a configuration file.

## Step 2: Configure your build <a href="#step-2-configure-your-build" id="step-2-configure-your-build"></a>

Once you've defined your Qwiet authentication variables, you'll need to create a TeamCity job that executes Qwiet.

If you haven't already, log in to TeamCity and go to **Project** > **Settings** > **General Settings** > **Build Configurations**.

Next, click **Edit**. Select **Build Step** using the sidebar and click **Add build step**. This opens up the configuration window that allows you to define your new build step with the following information:

| **Parameter**          | **Definition**                                    |
| ---------------------- | ------------------------------------------------- |
| **Runner type**        | **Command Line**                                  |
| **Step name**          | `SL Analyze` (or descriptive name of your choice) |
| **Execute step**       | **If all previous steps finished successfully**   |
| **Working directory**  | `<path-to-directory-for-built-project-pkgs`>      |
| **Run**                | **Executable with parameters**                    |
| **Command executable** | `/usr/local/bin/sl`                               |
| **Command parameters** | `analyze`                                         |

When done, save your changes.
