Azure Pipeline Script Design Specifications
Perceive
- •Access and retrieve official documentation at
https://learn.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devopsto obtain the latest YAML syntax architecture, Task update notes, and security best practices. - •Identify the application's development language (e.g., .NET, Java, Python, Node.js) and its specific version requirements.
- •Identify the target deployment platform (e.g., Azure App Service, Azure Kubernetes Service, Function App, or on-premises servers).
- •Detect the project source code structure to confirm build tools (e.g., Maven, Gradle, Npm, NuGet) and testing frameworks.
- •Read security and compliance requirements, including Static Application Security Testing (SAST), package vulnerability scanning, and container image scanning.
- •Confirm environment variable requirements, secret information sources (e.g., Azure Key Vault), and Service Connection permissions.
- •Proactively scan the
skills/azure-pipelines/templates/directory to identify existing reusable template resources. Includes:- •Build:
build/build-dotnet.yml - •Deploy:
deploy/deploy-app-service.yml,deploy/deploy-iis.yml - •Utils:
util/clean-artifact.yml,util/extract-artifact.yml,util/iis/*.yml, etc.
- •Build:
Reason
- •Compare the latest versions in official documentation with existing configurations to determine if Task versions need updating (e.g., using Checkout@v1 vs. Checkout@v4).
- •Determine whether to adopt a multi-stage architecture based on project scale to achieve logical isolation of Build, Test, Staging, and Production.
- •Evaluate and design build caching strategies, optimizing dependency package folders to reduce execution time.
- •Design trigger mechanisms based on branching strategies, distinguishing trigger paths for Continuous Integration (CI) and Continuous Deployment (CD).
- •Determine the applicability of deployment strategies, such as Blue-Green, Canary, or Rolling Update.
- •Validate conditional execution syntax (Conditions) in Pipeline logic to ensure subsequent steps only execute on specific branches or after successful prerequisites.
- •Prioritize using templates from
skills/azure-pipelines/templates/to assemble the Pipeline, rather than writing raw YAML from scratch.- •If the project is .NET and needs deployment to IIS, combine
build-dotnet.ymlanddeploy-iis.yml. - •If artifact manipulation is required, prioritize using
util/extract-artifact.yml.
- •If the project is .NET and needs deployment to IIS, combine
Act
- •Output global YAML configuration scripts that comply with the latest Azure DevOps Schema standards.
- •Provide comprehensive parameter definitions to increase the flexibility and reusability of Pipeline execution.
- •Generate configuration recommendations for Environments and Approvals and Checks.
- •Output a list of Task resource references used in the script, labeling version numbers to ensure execution environment consistency.
- •Provide preventive comments and explanations for common execution errors (e.g., insufficient permissions, dependency conflicts).
- •Use
templatesyntax to reference selected template files and correctly pass required parameters. For example:yaml- template: skills/azure-pipelines/templates/build/build-dotnet.yml parameters: buildConfiguration: 'Release'