Serverless Website Deployment 100% Automated in Multiple Environments (Test, QA, and Production) Using Azure DevOps Repos and Pipelines (CI/CD)
In this project, inspired by real-world scenarios, I took on the role of a Cloud Engineer utilizing DevOps practices to deploy a serverless website in a fully automated manner, leveraging Azure DevOps Repos for source control and Azure DevOps Pipelines for CI/CD.
Successfully deploying this website across three separate environments — Test, QA, and Production — simulated real enterprise scenarios and provided invaluable hands-on experience.
Part One: Initial Setup and Configuration
Step 1: Creating Storage Accounts for Each Environment:
- Environments:
- tcbjrtst (Test)
- tcbjrhom (QA)
- tcbjrprd (Production)
- URLs:
- Test: https://tcbjrtst.z13.web.core.windows.net/
- QA: https://tcbjrhom.z13.web.core.windows.net/
- Production: https://tcbjrprd.z13.web.core.windows.net/
Step 2: Enabling Static Website & Setting Up Home Page:
- Configuration:
- Enabled Static Website feature on each storage account.
- Set index.html as the home page for all environments.
Step 3: Creating Azure DevOps Organization & Project:
- Organization: Created a new Azure DevOps Organization.
- Project: Created a new project named website01 to manage the repository and pipelines.
Step 4: Setting Up Azure Repos:
- Generated Git credentials for Azure Repos.
- Cloned the source code from GitHub to my local machine using:
- Pushed the code to Azure Repos with the following commands:
git remote add origin https://tcb-updates-mod7-lbjenious@dev.azure.com/tcb-updates-mod7-lbjenious/website01/_git/website01
Part Two: Configuring CI/CD Pipelines
Step 1: Creating the CI Pipeline:
- Pipeline Name: website01-CI
- Configuration:
- Used Classic Editor to create an empty job.
- Added a task to archive website files (Zip files).
- Added a task to publish build artifacts (Artifacts Publish).
Enabled continuous integration by setting up triggers
Step 2: Creating the CD Pipeline:
- Pipeline Configuration:
- Created a new release pipeline.
- Added artifacts from the CI pipeline and enabled continuous deployment.
- Stages:
- Test Stage:
- Task to extract files from the build artifacts.
- Task to upload files to the Test environment storage account (tcbjrtst) using Azure CLI.
- Production Stage:
- Cloned the Test stage to create a Production stage.
- Modified the Azure CLI task to upload files to the Production environment storage account (tcbjrprd).
- Pre-deployment Approvals:
- Set up pre-deployment approvals for the Production stage, requiring manual approval via email before deployment.
- Cloned the Test stage to create a Production stage and Modified the Azure CLI task to upload files to the Production environment storage account (tcbjrprd).
- From the Production stage, Enable Pre-deployment conditions to get approval before deploying to production.
- Pre-deployment approvals: put your Azure access email
Part Three: Testing and Validation
Step 1: Running the CI Pipeline:
- Triggered the website01-CI pipeline and monitored the build process.
Step 2: Monitoring the CD Pipeline:
- Monitored the release pipeline to ensure files were correctly deployed to the Test and Production environments.
Step 3: Approval and Production Deployment:
- Approved the deployment to Production after validating the Test environment.
Additional Git Bash CLI Logs
- Serverless website deployment 100% automated using Azure DevOps Repos & Pipelines (CI/CD) in multiple environments
Additional Git Bash CLI Logs
- Executed
git add
,git config
,git commit
, andgit push
commands to update the/files/index.html
file with the message 'Very Good Job'!!! , successfully deploying the changes to the production environment for the production website:
git add
, git config
, git commit
, and git push
commands