generate-azure-pipelines
Skill: generate-azure-pipelines
Version: 0.3.0-alpha Purpose: Generate Azure DevOps pipelines with CI/CD workflows and Bicep infrastructure as code Author: The Forge Last Updated: 2025-11-18
Title
Generate Azure Pipelines - Create production-ready Azure Pipelines with CI/CD workflows and Bicep infrastructure templates
File Structure
forge-plugin/skills/generate-azure-pipelines/
├── SKILL.md # This file - mandatory workflow
├── examples.md # Usage scenarios and examples
├── scripts/
│ └── pipeline_generator.py # Helper script for pipeline generation
└── templates/
├── ci-pipeline-template.yml # CI pipeline template
├── cd-pipeline-template.yml # CD pipeline template
├── iac-pipeline-template.yml # Infrastructure pipeline template
├── combined-cicd-template.yml # Combined CI/CD template
├── main-bicep-template.bicep # Main Bicep template
├── bicepparams-template.bicep # Bicep parameters template
├── storage-module-template.bicep # Storage Account module
├── function-app-module-template.bicep # Function App module
├── build-job-template.yml # Reusable build job template
└── deploy-job-template.yml # Reusable deploy job template
Interface References
- ContextProvider —
getDomainIndex("azure"),getConditionalContext("azure", topic) - MemoryStore —
getSkillMemory("generate-azure-pipelines", project),update()
Context (via ContextProvider):
contextProvider.getDomainIndex("azure")— Azure context navigationcontextProvider.getConditionalContext("azure", "azure_pipelines_overview")— Pipeline structure and syntaxcontextProvider.getConditionalContext("azure", "azure_pipelines_cicd_patterns")— CI/CD patterns and decision matrixcontextProvider.getConditionalContext("azure", "azure_bicep_overview")— Bicep infrastructure as code
Memory (via MemoryStore):
memoryStore.getSkillMemory("generate-azure-pipelines", project)returns per-project files:pipeline_config.md— Previous pipeline configurationsgenerated_files.md— List of generated filesbicep_resources.md— Infrastructure resourcescustomizations.md— User-specific changes
Design Requirements
Core Functionality
This skill must:
- Ask user about pipeline structure (separate CI/CD or combined)
- Ask about project requirements (runtime, build tool, deployment targets)
- Generate
.azure/directory with pipelines, bicep, docs, templates, variables - Create CI pipeline for building and testing
- Create CD pipeline for deploying to environments
- Create IAC pipeline for deploying infrastructure
- Generate Bicep templates with environment-specific parameters
- Create pipeline templates for reusability
- Store pipeline configuration in memory for future reference
Output Requirements
Generate a complete .azure/ directory structure with:
- Pipeline YAML files (CI, CD, IAC, or combined)
- Bicep infrastructure templates
- Environment-specific parameter files (.bicepparams)
- Pipeline templates for reusable jobs
- Variable files for environment-specific configuration
- Documentation explaining the setup
Directory Structure
.azure/
├── bicep/
│ ├── modules/ # Reusable Bicep modules
│ │ ├── storage-account.bicep
│ │ ├── function-app.bicep
│ │ └── app-service.bicep
│ ├── main.bicep # Main infrastructure template
│ ├── main.development.bicepparams # Development parameters
│ ├── main.staging.bicepparams # Staging parameters
│ └── main.production.bicepparams # Production parameters
├── docs/
│ └── README.md # Pipeline and infrastructure docs
├── pipelines/
│ ├── templates/ # Reusable pipeline templates
│ │ ├── build-job.yml
│ │ └── deploy-job.yml
│ └── variables/ # Variable files
│ ├── dev-variables.yml
│ ├── staging-variables.yml
│ └── prod-variables.yml
├── ci-pipeline.yml # CI pipeline (if separate)
├── cd-pipeline.yml # CD pipeline (if separate)
├── iac-pipeline.yml # Infrastructure pipeline
└── combined-cicd-pipeline.yml # Combined pipeline (if requested)
Quality Requirements
Generated pipelines must:
- Follow Azure Pipelines best practices (stages, jobs, environments)
- Use templates for reusability (build and deploy jobs)
- Support multiple environments (development, staging, production)
- Include proper triggers (branch, PR, path filters)
- Use variable groups (environment-specific configuration)
- Include approval gates (production deployments)
- Be well-documented (inline comments, README)
Prompting Guidelines
User Questions Framework
Use Socratic method to gather requirements. Ask questions in this order:
1. Pipeline Architecture
Question: "Do you want separate CI and CD pipelines, or a combined CI/CD pipeline?"
Options:
- Separate: CI builds/tests on all branches, CD deploys specific versions to environments
- Combined: Single pipeline handles build, test, and deploy in one workflow
Follow-up: "This affects pipeline structure and artifact management. Separate pipelines are better for complex projects with frequent deployments."
2. Project Runtime
Question: "What runtime does your project use?"
Options:
- Python (specify version: 3.9, 3.10, 3.11, 3.12)
- Node.js (specify version: 16, 18, 20)
- .NET (specify version: 6.0, 7.0, 8.0)
- Docker (containerized application)
Follow-up: "This determines the agent pool and build tasks."
3. Build Tool
Question: "What build tool do you use?"
Options:
- Python: pip, Poetry, pipenv
- Node.js: npm, yarn, pnpm
- .NET: dotnet CLI, MSBuild
Follow-up: "This affects dependency management and build steps."
4. Deployment Target
Question: "Where do you want to deploy?"
Options:
- Azure Functions
- Azure App Service
- Azure Container Instances
- Azure Kubernetes Service (AKS)
- Azure Static Web Apps
Follow-up: "This determines deployment tasks and service connections needed."
5. Environments
Question: "Which environments do you need?"
Options (can select multiple):
- Development (auto-deploy from develop branch)
- Staging (auto-deploy from main branch)
- Production (manual approval required)
- Custom environments
Follow-up: "This creates environment-specific parameter files and deployment stages."
6. Infrastructure Requirements
Question: "What Azure resources does your application need?"
Options (can select multiple):
- Storage Account (Blob, Queue, Table)
- Function App
- App Service Plan
- Key Vault (for secrets)
- Application Insights (for monitoring)
- SQL Database
- Cosmos DB
- Virtual Network
- Custom resources
Follow-up: "This generates Bicep modules for your infrastructure."
7. Existing Infrastructure
Question: "Do you have existing Azure resources to reference, or create everything new?"
Options:
- Create all new resources (full IaC)
- Reference existing resources (partial IaC)
- No infrastructure deployment (app-only pipelines)
Follow-up: "This affects Bicep template structure and existing resource references."
Instructions
Mandatory Workflow
IMPORTANT: Follow these steps in order. Do not skip steps.
Step 1: Initial Analysis
Objective: Understand the current project context
Actions:
- Identify the current working directory
- Check if
.azure/directory already exists - Check if
azure-pipelines.ymlor similar files exist - Identify project structure (language, build files, dependencies)
Verification: Confirm project type detected before proceeding
Step 2: Load Index Files
Objective: Understand available context and memory structure
Actions:
- Load Azure domain index via
contextProvider.getDomainIndex("azure") - Identify which context topics will be needed based on requirements
Verification: Domain index loaded, know which context topics to load next
Step 3: Load Project Memory
Objective: Check for existing project-specific pipeline configurations
Actions:
- Determine project name from current directory or user input
- Load project memory via
memoryStore.getSkillMemory("generate-azure-pipelines", project) - If memory exists, review all memory files:
pipeline_config.md- Previous pipeline structuregenerated_files.md- List of generated filesbicep_resources.md- Infrastructure resourcescustomizations.md- User-specific changes
Verification: Memory loaded if exists; ready to use previous configurations
Step 4: Load Azure Pipelines Context
Objective: Load Azure Pipelines and Bicep knowledge
Actions:
- Load
contextProvider.getConditionalContext("azure", "azure_pipelines_overview")- Pipeline structure, stages, jobs, tasks - Load
contextProvider.getConditionalContext("azure", "azure_pipelines_cicd_patterns")- CI/CD patterns and decision matrix - Load
contextProvider.getConditionalContext("azure", "azure_bicep_overview")- Bicep templates and syntax
Verification: Context loaded, understand pipeline patterns and Bicep structure
Step 5: Gather Requirements
Objective: Ask user Socratic questions to gather all requirements
Actions:
- Ask about pipeline architecture (separate vs combined)
- Ask about project runtime (Python, Node.js, .NET, Docker)
- Ask about build tool (pip/Poetry, npm/yarn, dotnet)
- Ask about deployment target (Functions, App Service, AKS, etc.)
- Ask about environments (dev, staging, prod)
- Ask about infrastructure requirements (storage, databases, networking)
- Ask about existing infrastructure (new or reference existing)
Verification: All requirements gathered, user confirmed ready to proceed
Step 6: Generate Pipeline Structure
Objective: Create .azure/ directory with pipelines and Bicep templates
Actions:
-
Create directory structure:
mkdir -p .azure/{bicep/modules,docs,pipelines/{templates,variables}} -
Generate pipeline files based on user choice:
- If separate: Create
ci-pipeline.yml,cd-pipeline.yml,iac-pipeline.yml - If combined: Create
combined-cicd-pipeline.yml,iac-pipeline.yml
- If separate: Create
-
Generate Bicep templates:
bicep/main.bicep- Main infrastructure templatebicep/main.{environment}.bicepparams- Environment-specific parametersbicep/modules/*.bicep- Resource-specific modules
-
Generate pipeline templates:
pipelines/templates/build-job.yml- Reusable build jobpipelines/templates/deploy-job.yml- Reusable deployment job
-
Generate variable files:
pipelines/variables/{environment}-variables.yml- Environment-specific variables
-
Generate documentation:
.azure/docs/README.md- Explanation of pipeline structure and usage
Verification: All files created, no errors during generation
Step 7: Customize Templates
Objective: Populate templates with project-specific values
Actions:
-
Replace placeholders in pipeline YAML files:
{{PROJECT_NAME}}- Project name{{RUNTIME}}- Runtime and version{{BUILD_COMMAND}}- Build command{{TEST_COMMAND}}- Test command{{DEPLOY_TARGET}}- Deployment target
-
Replace placeholders in Bicep templates:
{{RESOURCE_PREFIX}}- Resource naming prefix{{LOCATION}}- Azure region{{SKU}}- Resource SKU per environment
-
Configure triggers based on requirements:
- CI: Trigger on all branches
- CD: Trigger on main/develop or manual
- IAC: Trigger on changes to
.azure/bicep/**
Verification: Templates customized with correct values
Step 8: Validate Generated Files
Objective: Ensure generated pipelines are syntactically correct
Actions:
- Check YAML syntax for all pipeline files
- Validate Bicep templates using
az bicep build(if Azure CLI available) - Verify all referenced templates exist
- Check that variable files are properly structured
Verification: No syntax errors, all files valid
Step 9: Present Results
Objective: Show user what was generated and next steps
Actions:
-
Display generated directory structure
-
List all created files with their purposes
-
Provide instructions for setting up Azure DevOps project:
- Create service connections
- Create variable groups
- Create environments with approvals
- Import pipeline YAML files
-
Explain how to customize further:
- Add more environments
- Add more resources to Bicep
- Create custom pipeline templates
Verification: User understands what was generated and how to use it
Step 10: Update Project Memory
Objective: Store configuration for future reference
Actions:
-
Use
memoryStore.update("generate-azure-pipelines", project, "pipeline_config.md", content)with:- Pipeline architecture (separate/combined)
- Runtime and build tool
- Deployment target
- Environments
-
Use
memoryStore.update("generate-azure-pipelines", project, "generated_files.md", content)with:- List all generated files with timestamps
- Note which templates were used
-
Use
memoryStore.update("generate-azure-pipelines", project, "bicep_resources.md", content)with:- List Azure resources in Bicep templates
- Resource naming conventions
- Environment-specific configurations
-
Use
memoryStore.update("generate-azure-pipelines", project, "customizations.md", content)with:- User-specific requirements
- Deviations from standard templates
- Custom pipeline steps
Verification: Memory files created/updated with all relevant information
Compliance Checklist
Before completing this skill, verify:
- User questions asked and answered (Step 5)
-
.azure/directory created with correct structure (Step 6) - Pipeline YAML files generated (CI, CD, IAC or combined) (Step 6)
- Bicep templates generated (main.bicep, modules, .bicepparams) (Step 6)
- Pipeline templates created (build-job, deploy-job) (Step 6)
- Variable files created for each environment (Step 6)
- Documentation generated (.azure/docs/README.md) (Step 6)
- Templates customized with project-specific values (Step 7)
- Generated files validated (YAML, Bicep syntax) (Step 8)
- Results presented to user with next steps (Step 9)
- Project memory updated (Step 10)
Best Practices
Pipeline Organization
- Separate concerns: Keep CI, CD, and IAC pipelines separate for large projects
- Use templates: Create reusable build and deploy job templates
- Use variable groups: Store environment-specific configuration in Azure DevOps Library
- Use environments: Track deployments and require approvals for production
- Use conditions: Control when stages run based on branch or variables
Bicep Templates
- Use modules: Break down infrastructure into reusable components
- Use parameters files: Environment-specific configurations
- Use descriptive names: Clear resource and parameter names
- Add descriptions: Document all parameters and outputs
- Use variables for computed values: Keep parameters simple
- Validate before deploying: Use
az deployment validateandwhat-if
Security
- Never hardcode secrets: Use Azure Key Vault and variable groups
- Use service connections: Secure Azure authentication
- Require approvals: Production deployments need manual approval
- Use managed identities: Avoid storing credentials
- Limit permissions: Grant least privilege to service principals
Documentation
- Document pipeline structure: Explain stages, jobs, and dependencies
- Document Bicep resources: Explain what each module creates
- Document setup steps: How to configure Azure DevOps project
- Document customization: How to add more environments or resources
- Keep README updated: As pipelines evolve
Additional Notes
Service Connections
Users will need to create service connections in Azure DevOps for:
- Azure Resource Manager (for deploying resources)
- Docker Registry (if using containers)
- Other external services
Variable Groups
Users should create variable groups in Azure DevOps Library for:
- Development environment variables
- Staging environment variables
- Production environment variables (with secrets)
Environments
Users should create environments in Azure DevOps for:
- Development (no approval required)
- Staging (optional approval)
- Production (manual approval required)
Triggers
Generated pipelines use:
- CI: Trigger on all branches, run build and test
- CD: Trigger on artifact from CI, deploy to environments
- IAC: Trigger on changes to
.azure/bicep/**, deploy infrastructure
Artifacts
- CI pipeline publishes build artifacts
- CD pipeline downloads artifacts from CI
- IAC pipeline doesn't use artifacts (uses Bicep files from repo)
Version History
v1.1.0 (2025-07-15)
- Phase 4 Migration: Replaced hardcoded
../../context/and../../memory/paths with ContextProvider and MemoryStore interface calls - Added YAML frontmatter with context/memory declarations
- Added Interface References section
v1.0.0 (2025-11-18)
Initial Release
- Complete Azure Pipelines generation with CI/CD workflows
- Bicep infrastructure as code templates
- Support for separate or combined CI/CD pipelines
- Support for Python, Node.js, and .NET projects
- Multi-environment deployment (dev, staging, prod)
- Reusable pipeline templates
- Environment-specific Bicep parameters
- Memory system for configuration tracking
- Comprehensive context files for Azure Pipelines and Bicep