> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Azure Pipelines

> Azure Pipelines & Custom CD: Set up custom continuous deployment with Azure Pipelines for dbt™ projects. Enhance deployment flexibility.

export const Arcade = ({src, title}) => <div style={{
  position: 'relative',
  paddingBottom: 'calc(56.2225% + 41px)',
  height: 0,
  width: '100%'
}}>
    <iframe src={src} title={title} frameBorder="0" loading="lazy" allow="clipboard-write" allowFullScreen style={{
  position: 'absolute',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  colorScheme: 'light'
}} />
  </div>;

You can build your custom Continuous Deployment jobs using Azure Pipelines and [Bolt APIs](/products/bolt/bolt-api).

<Info>
  **To use this feature it is required to have a production environment configured in Paradime.**

  **ℹ️** [**Check our setup guide here based on your data warehouse provider**](/products/settings/connections/scheduler-environment/index)**.**
</Info>

## Setting up Continuous Deployment Bolt Schdeule

1. **Create or Edit a Bolt Schedule**: In the Bolt UI, create a new schedule or modify an existing one.
2. **Set Schedule Type to `deferred`**: This allows your job to leverage results from previous runs, improving efficiency.
3. **Name your continuous deployment schedule**: Choose a descriptive name for easy identification.
4. **Choose a Bolt Schedule to defer to**: Select a previous job run to use as a reference, either from the same schedule or a different one.
5. **Set the comparison method**: Determine how the current run compares with previous runs (e.g., `Last Run`, `Last Successful Run`).
6. **Enter dbt Commands**: Specify the dbt tasks to execute as part of the continuous deployment. For example:

```bash theme={"system"}
dbt run --select state:modified
```

7. **Specify the Git Branch**: Choose which branch of your dbt project will be used when the continuous deployment is triggered (e.g., `main`).
8. **Set Trigger Type to `On Merge`**: This will allow the API to trigger multiple runs
9. **Publish Bolt Schedule**: Save and activate your continuous deployment schedule.

<Info>
  **Implement using Paradime's Bolt Template -** [**Test Code Changes on Pull Request**](/products/bolt/creating-schedules/templates/ci-cd-templates/test-code-changes-on-pull-requests)**.**
</Info>

#### Tutorial

<Arcade src="https://demo.arcade.software/nLpuUz4LBEm7pqp5CFQW?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="Using Azure Pipelines" />

## Generate API keys

<Warning>
  **API keys are generate at a workspace level.**
</Warning>

To be able to trigger Bolt using the API, you will first need to generate API keys for your workspace. Got to account settings and generate your API keys, make sure to save in your password manager:

* API key
* API secret
* API Endpoint

You will need this later when setting up the secrete in Azure pipelines.

<Card title="Generate Api Keys Legacy" href="/developers/generate-api-keys-legacy" horizontal icon="arrow-right" />

## Create an Azure Pipeline

Now you will need to create a new `azure-pipeline.yml` file in your dbt™️ repository. Copy the code block below and enter the values required.

<Accordion title="Example Azure pipelines configuration file">
  ```yaml title="azure-pipelines.yml" lineNumbers theme={"system"}
  # Define when the pipeline should trigger
  trigger:
   - main    # Pipeline will run when changes are pushed to main branch

  # Define pipeline-level variables
  variables:
   # Slug of the Paradime schedule/job to run
   - name: PARADIME_SCHEDULE_SLUG
     value: "flowing-pachy-wyy4fs"
  # Define the steps to be executed in this pipeline
  steps:
   # Step 1: Set up Python environment
   - task: UsePythonVersion@0    # Azure DevOps task to configure Python
     inputs:
       versionSpec: "3.11"       # Specify Python version
       addToPath: true          # Add Python to system PATH
     displayName: Use Python 3.11 # Name shown in Azure DevOps UI

   # Step 2: Install dependencies and run Paradime job
   # Check for latest version of the Paradime Python SDK on https://github.com/paradime-io/paradime-python-sdk/releases
   - script: |  
       # Install Paradime Python SDK
       pip install paradime-io==4.7.1
       
       # Export required environment variables for Paradime
       # $(VARIABLE) syntax is used to reference Azure Pipeline variables
       export PARADIME_API_ENDPOINT=$(PARADIME_API_ENDPOINT)
       export PARADIME_API_KEY=$(PARADIME_API_KEY)
       export PARADIME_API_SECRET=$(PARADIME_API_SECRET)
       
       # Run the Paradime bolt schedule/job
       # --wait flag makes the pipeline wait for completion
       paradime bolt run "$(PARADIME_SCHEDULE_SLUG)" --wait

     displayName: "Run Paradime CD"
  ```
</Accordion>

### Add the API keys and Credential in the Azure Pipeline variables

Finally you need to add the API key and credentials generated in the [previous step](/products/bolt/ci-cd/continuous-deployment-with-bolt/using-azure-pipelines#generate-api-keys-and-find-you-workspace-uid) in Azure Pipelines.

Set the corresponding values using your credentials for the variable names:

* `PARADIME_API_KEY`
* `PARADIME_API_SECRET`
* `PARADIME_API_ENDPOINT`

<Arcade src="https://demo.arcade.software/tCJyMGYsHX7weycpd3kq?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="Using Azure Pipelines" />


## Related topics

- [Column-Level Lineage Diff [deprecated]](/products/bolt/ci-cd/lineage-diff-deprecated/index.md)
- [Column-Level Lineage Diff](/products/bolt/ci-cd/lineage-diff/index.md)
- [Azure DevOps](/products/bolt/ci-cd/turbo-ci/azure-devops.md)
- [Using BitBucket Pipelines](/products/bolt/ci-cd/continuous-deployment-with-bolt/using-bitbucket-pipelines.md)
- [Using GitLab Pipelines](/products/bolt/ci-cd/continuous-deployment-with-bolt/using-gitlab-pipelines.md)
