WSL enables Windows computers to concurrently run Windows and Linux at the same time. Modern software development and deployment usually depends on Linux tools and commands. To be able to run a Linux container on a Windows workstation, we need the availability of the Linux Kernel.
To install Windows Subsystem for Linux (WSL)
To use the default Ubuntu distribution
Open a PowerShell terminal as Administrator and execute the command wsl --install
To install another distribution
Open a PowerShell terminal as Administrator and execute the command to get the list of available distributions wsl.exe --list --online
Install the desired distribution wsl --install -d MY_DISTRIBUTION_NAME
Create the Linux user
The installer will create a Linux user. By default it will use your Windows user name. Enter a password and retype it.
Create a default Unix user account: MY_USER_NAME
New password:
Retype new password:
Reboot the computer for the changes to take effect.
Configuration
Terminal
Install the Windows Terminal from the Microsoft App Store
Code editor
Configure Visual Studio Code to be able to access and debug in the Linux file system.
IMPORTANT: For the path changes to take effect close and re-open the terminal window, or close and re-open Visual Studio Code if you use the integrated terminal.
Share the credentials between the Windows and WSL Git instances
In Windows execute
git config --global credential.helper wincred
Create GitHub personal access tokens
In the GitHub Web interface create new Personal Access Tokens, one for Windows and one for WSL with the following scopes
Azure pipelines support the CI/CD (Continuous Integration, Continuous Deployment), the fully automated Continuous Delivery process.
Agents, either hosted by Microsoft, or self-hosted on the client’s infrastructure, execute the yaml scripts.
Steps
The smallest unit of work in the Azure Pipeline. Each step is one action in a job. A Step can be a Script or a Task.
Script
A Script is a command written in a scripting language to be executed as a step of a job.
Running a Bash Script
steps:
- script: echo "Hello, World!"
displayName: 'Script to say Hello'
Task
A Task is a packaged script that can be used as a step within a job:
Built-in tasks from Azure Pipeline
Custom scripts written in PowerShell, Bash, Python or other languages
Third-party tasks from the Azure DevOps Marketplace
Running a Task, to execute an Azure CLI command with attributes
steps:
- task: AzureCLI@2
displayName: 'Run Azure CLI Command'
inputs:
azureSubscription: 'MyAzureSubscription' # Service connection to Azure
scriptType: 'bash' # Specify the script type (bash or ps)
scriptLocation: 'inlineScript' # Define the script location
inlineScript: | # Start the inline script
echo "Listing all resources in the resource group..."
az resource list --resource-group MyResourceGroup
Jobs
The job is a single phase of the pipeline executing multiple steps. Jobs can run in parallel or in sequence if those depend on each other. It has its own context and workspace, so variables and files created in one job are kept separate from each other. This allows the easier troubleshooting of the process. Typical steps are:
Building code
Running tests
Stages
Stages hold related jobs together. It can represent
Environments, like
Development,
QA,
Production,
or Related jobs, like
Build,
Test,
Deploy.
Triggers
Triggers tells the pipeline to run. It can be based on
Events, like
A commit to a repository or
A pull request
or Schedules
To run at specific times, like end of the day.
Approval
Gatekeeper before the stage can proceed. The pipeline execution pauses until the approval arrives. It can be
Manual (like human approval is required before deployment to Production)
Automatic (like only during business hours, or when automated tests are passed)
DevOps is the combination of two areas of information technology: Development and Operations. DevOps engineers work very closely with software developers and operation engineers to fully automate the creation and configuration of the cloud infrastructure and the build, testing and deployment of the applications. The best DevOps engineers come from software development and have a good understanding of operating systems, networking and data storage technologies.
CI/CD Pipelines
There are multiple interpretations of the origin of the acronym. The one I prefer explains CI/CD (Continuous Integration and Continuous Deployment), together Continuous Delivery pipelines, as the building, testing, deployment and configuration of applications. It can operate on-premises and cloud environments.
Continuous Integration (CI)
Continuous Integration automates the
Building
Testing
of the software. This allows developers to frequently merge code changes into the central repository to build and test the result of small updates. It is much easier to found and correct an error in a small change, than in a large, significant modification. This provides frequent feedback of on the quality of the code and allows stakeholders to follow the development process.
Continuous Deployment (CD)
The goal is to ensure the rapid and reliable release and deployment of the software to production. Automates the
Configuration
Deployment
of the application. Usually every merged change is automatically deployed to the Development environment, so it is available for human testing any time. The deployment to higher environments (QA, UAT, Production) can be automatic or manual.
When the default organization is set, we don’t have to include it in every command. In the terminal execute
az devops configure --defaults organization=https://dev.azure.com/MY_ORGANIZATION
Log in into Azure DevOps
To log into Azure DevOps in PowerShell execute
az login
Select your user account and click Continue
Troubleshooting
If you get the error message
Retrieving tenants and subscriptions for the selection… Authentication failed against tenant … This tenant has been blocked due to inactivity.
The tenant your Entra ID (user ID) is associated with was on idle for more than 20 days, or you have never signed up for the free Azure service. If you don’t have a paid subscription, to create a new Tenant, first sign up for a free Azure account. See Configure your Microsoft Azure environment and try to log in again.
To log into Azure DevOps services use the Microsoft Entra ID – formerly known as Azure Active Directory (Azure AD). The Microsoft Identity platform provides two primary authentication patterns for Azure DevOps access.
To sign up for a free Microsoft Azure account navigate to Build in the cloud with an Azure account and click the Try Azure for Free button, and follow the instructions. Your credit card will not be charged until you switch to the paid subscription.