Azure Pipelines Integration
Integrate Cloudgeni security scanning into your Azure Pipelines to automatically check Infrastructure as Code for security issues on every build and pull request.What You'll Get
- Automated security scanning in your CI/CD pipeline
- PR validation that blocks insecure code
- Build reports with detailed findings
- Fail-on-severity configuration for quality gates
- Integration with Azure DevOps dashboards
Prerequisites
Before You Start
Before You Start
- Azure DevOps project with Pipelines enabled
- Cloudgeni account and API key
- Repository containing IaC files (
.tf,.bicep,.hcl,.yaml, etc.)
Quick Start
Step 1: Create API Key
- Go to Settings → API Keys in Cloudgeni
- Click Create API Key
- Name it
azure-pipelines - Copy the generated key
Step 2: Add Pipeline Variable
- Go to your Azure DevOps project
- Navigate to Pipelines → Library
- Create a new Variable Group or edit existing
- Add variable:
- Name:
CLOUDGENI_API_KEY - Value: Your API key
- Keep this value secret: Checked
- Name:
- Save the variable group
Step 3: Create Pipeline
Addazure-pipelines.yml to your repository:
Configuration Options
Scanner Options
| Option | Description | Default |
|---|---|---|
--api-key | Cloudgeni API key | Required |
--fail-on-critical | Exit 1 on critical findings | false |
--fail-on-high | Exit 1 on high findings | false |
--path | Directory to scan | . |
--exclude | Paths to exclude | None |
--output | Output format (text, json, sarif) | text |
Basic Job
Strict Mode
Pipeline Examples
Basic Pipeline
Production Pipeline
Multi-Environment Pipeline
Template-Based Pipeline
Create a templatetemplates/security-scan.yml:
Pull Request Validation
Branch Policies
Require security scans for pull requests:- Go to Repos → Branches
- Click … on your target branch
- Select Branch policies
- Under Build Validation, click Add build policy
- Select your security pipeline
- Configure:
- Trigger: Automatic
- Policy requirement: Required
- Build expiration: Immediately
Status Checks
Cloudgeni can update PR status:Variable Groups
Project-Level Variables
- Go to Pipelines → Library
- Create Variable Group:
cloudgeni-variables - Add
CLOUDGENI_API_KEY(secret) - Reference in pipeline:
- group: cloudgeni-variables
Organization-Level Variables
For multiple projects:- Go to Organization Settings → Pipelines → Variable Groups
- Create shared variable group
- Grant access to projects
- Reference in pipelines
Artifacts and Reports
Publish Report
Test Results
Publish as test results:Troubleshooting
Common Issues
Common Issues
Variable Not Found:
- Check variable group is linked to pipeline
- Verify variable name is correct
- Ensure secret variable is accessible
- Verify API key is correct
- Check variable is not empty
- Test key in Cloudgeni dashboard
- Add
timeoutInMinutes: 30to job - Consider scanning specific paths
- Check for large files
- Verify IaC files exist in scan path
- Check file extensions
- Review exclude patterns
- Verify policy is configured correctly
- Check pipeline exists and is enabled
- Ensure trigger matches PR branches