# Pynt for Azure DevOps Pipelines

## **What is Azure DevOps?**

{% hint style="info" %}
💡 [**Azure DevOps**](https://azure.microsoft.com/en-us/services/devops/) is a suite of development tools that provide CI/CD capabilities, version control, and project management. It supports building, testing, and deploying applications across cloud and on-premises environments.
{% endhint %}

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2F5Y3kcRxJgQuMp57fZ8De%2Fimage.png?alt=media&#x26;token=a6c6e750-f6f5-4ca9-a1da-6ae022b95e73" alt="" width="196"><figcaption><p>Azure DevOps</p></figcaption></figure>

***

## Pynt integration with Azure DevOps

As part of its [API security testing](https://docs.pynt.io/documentation/api-security-testing), Pynt allows seamless [integration](https://docs.pynt.io/documentation/security-testing-integrations/pynt-on-ci-cd) with Azure DevOps.

Pynt for Azure DevOps enables you to seamlessly integrate powerful API security testing into your Azure DevOps CI/CD pipelines. By incorporating Pynt into your Azure DevOps workflows, you can automate comprehensive security scans with every build, ensuring that your APIs are protected from vulnerabilities throughout the development process. Pynt’s integration with Azure DevOps is designed to be straightforward, allowing you to enhance your security posture without disrupting your existing CI/CD practices.

***

## Azure DevOps Configuration

* Copy your [Pynt ID](https://docs.pynt.io/documentation/security-testing-integrations/pynt-on-ci-cd/how-to-get-pynt-id-for-ci-cd-authentication) into the pipeline variable and store it as a secret:

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2FbfBhzmA0FbcSOqtSwlE5%2FScreenshot%202024-05-22%20at%2014.32.15.png?alt=media&#x26;token=7d5e6f8c-9fe2-42a4-9497-d5a6661eb8b4" alt=""><figcaption><p>Storing Pynt ID</p></figcaption></figure>

* Make sure Python installed on the agent.
* Add Pynt to your pipeline. See the following example of a job in an Azure pipeline that runs Pynt on our goat vulnerable application:

{% code overflow="wrap" %}

```yaml
trigger:
- main

pool: 
  name: test

steps:
- script: python3 -m pip install --upgrade pyntcli
  displayName: 'Install pynt cli'

- script: curl https://raw.githubusercontent.com/pynt-io/pynt/main/goat_functional_tests/goat.postman_collection.json -o goat.json 
  displayName: 'Get goat collection'

- script: |
    export PYNT_ID = $(PYNT_ID)
    pynt newman --collection goat.json --reporters --severity-level critical
  displayName: 'Run pynt with newman integration '
```

{% endcode %}

### Pynt command not found

If you get pynt command not found error it means that pip install folder is not in your path. add the following to the last step:

```yaml
- script: |
    export PYNT_ID = $(PYNT_ID)
    
    # Get the user base bin directory
    BIN_PATH=$(python -m site --user-base)/bin
      
    # Add it to the PATH
    export PATH=$BIN_PATH:$PATH
      
    # Verify that it's been added
    echo "Updated PATH: $PATH"
    
    pynt newman --collection goat.json --reporters --severity-level critical
  displayName: 'Run pynt with newman integration '
```

***

## Controlling the return code from Pynt

`pynt newman` and `pynt command` have an optional flag `--severity-level`

With this flag, you have granular control over whether Pynt returns an error code (non zero) in the event of findings. Use this flag to control when Pynt will break the CI/CD run, allowed values are:

```
'all', 'medium', 'high', 'critical', 'none' (default) 
```

***

{% hint style="info" %}
💡 **Need Help?** For any questions or troubleshooting, reach out to the [**Pynt Community Support**](https://www.pynt.io/community).
{% endhint %}
