Skip to content

This repository contains an Azure DevOps pipeline that builds, tests, deploys, and optionally cleans up infrastructure using Bicep templates. The main goal is to provision a secure Windows VM in Azure.

Notifications You must be signed in to change notification settings

SLAMNOTH/Pipeline-Demo2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Build Status

🚀 Azure DevOps Bicep Deployment Pipeline

This repository contains an Azure DevOps pipeline that builds, tests, deploys, and optionally cleans up infrastructure using Bicep templates. The main goal is to provision a secure Windows VM in Azure.


📦 Pipeline Overview

trigger:
- none

🔁 Stages in the Pipeline

Stage Description
🛠 Build Placeholder for build steps
🧪 Test Placeholder for future tests
🚀 Deploy Deploys infrastructure using Bicep
🧹 Cleanup Deletes the resource group (optional)

🗂️ Project Structure

  • main.bicep – Infrastructure-as-Code definition
  • Azure DevOps pipeline YAML – defines the CI/CD logic

🔐 Secret Management

  • Username (adminUN) is defined as a pipeline variable
  • Password (adminPASS) is securely fetched from Azure Key Vault
  • Secrets are not hardcoded and follow best practices

🚀 Deploy Stage Explained

This stage:

  • Fetches secrets from Azure Key Vault
  • Creates the resource group (if it doesn’t exist)
  • Deploys resources with az deployment group create
az deployment group create \
  --resource-group $(resourceGroupName) \
  --template-file $(templateFile) \
  --parameters adminUsername='$(adminUN)' adminPassword='$(adminPASS)'

🏗️ Infrastructure (Bicep)

Your main.bicep provisions the following Azure resources:

  • Virtual Network & Subnet
  • Network Security Group (NSG)
  • Network Interface with Public IP
  • Windows Virtual Machine
Example Bicep Snippet
resource vm 'Microsoft.Compute/virtualMachines@2022-03-01' = {
  name: vmName
  location: location
  properties: {
    osProfile: {
      computerName: vmName
      adminUsername: adminUsername
      adminPassword: adminPassword
    }
    ...
  }
}

🧼 Cleanup Stage

The final stage deletes the entire resource group to:

  • Keep your Azure environment clean
  • Prevent extra costs
  • Ensure ephemeral infrastructure
az group delete --name $(resourceGroupName) --yes --no-wait

⚠️ Approval is required before deletion!


🌍 Deployment Region

All resources are deployed in:

Location: West Europe (westeurope)

🔮 Future Improvements

  • Add automated testing after deployment
  • Integrate with CI triggers (push/pull_request)
  • Include monitoring/alerts after VM deployment

📷 Infrastructure Diagram (Simple)

[Internet] ──> [Public IP] ──> [NIC] ──> [VM]
                          │
                          └─> [NSG - Allow RDP (3389)]

About

This repository contains an Azure DevOps pipeline that builds, tests, deploys, and optionally cleans up infrastructure using Bicep templates. The main goal is to provision a secure Windows VM in Azure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages