Microsoft Azure Pipelines

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 Workflow

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.

Microsoft Azure CLI

Use the terminal to interact with the Azure Cloud

Installation

Latest instructions at it from bit.ly/AzureCLI

At the time of writing to install the CLI on Windows, execute the command in PowerShell

winget install --exact --id Microsoft.AzureCLI

Restart PowerShell to refresh the updated “path” value and found the newly installed tool: az

Extensions

Azure DevOps Extension – Adds DevOps specific functionality. To install execute in the terminal

az extension add --name azure-devops

Configuration

Enable tab completion

To autocomplete command names when tou press the Tab key, update or create the PowerShell Profile. In the terminal execute

notepad $PROFILE

If the file does not exist, Notepad will ask you to create it. When the popup is displayed, click Yes.

Save the following in the file

Register-ArgumentCompleter -Native -CommandName az -ScriptBlock {
    param($commandName, $wordToComplete, $cursorPosition)
    $completion_file = New-TemporaryFile
    $env:ARGCOMPLETE_USE_TEMPFILES = 1
    $env:_ARGCOMPLETE_STDOUT_FILENAME = $completion_file
    $env:COMP_LINE = $wordToComplete
    $env:COMP_POINT = $cursorPosition
    $env:_ARGCOMPLETE = 1
    $env:_ARGCOMPLETE_SUPPRESS_SPACE = 0
    $env:_ARGCOMPLETE_IFS = "`n"
    $env:_ARGCOMPLETE_SHELL = 'powershell'
    az 2>&1 | Out-Null
    Get-Content $completion_file | Sort-Object | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, "ParameterValue", $_)
    }
    Remove-Item $completion_file, Env:\_ARGCOMPLETE_STDOUT_FILENAME, Env:\ARGCOMPLETE_USE_TEMPFILES, Env:\COMP_LINE, Env:\COMP_POINT, Env:\_ARGCOMPLETE, Env:\_ARGCOMPLETE_SUPPRESS_SPACE, Env:\_ARGCOMPLETE_IFS, Env:\_ARGCOMPLETE_SHELL
}
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set the default organization

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.

Microsoft Azure authentication types

Authentication types

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.

User delegation (OAuth)

We will use this for the Azure DevOps CLI. Created for user facing tools, like web and desktop applications, command line interfaces. Formerly known as User Accounts. See Build Azure DevOps integrations with Microsoft Entra OAuth apps

Application identity (service principals and managed identities)

For background services, CI/CD pipelines, automated tools. Formerly known as Service Accounts.. See Use service principals and managed identities in Azure DevOps

Microsoft Azure DevOps tools

The Azure DevOps tools provide access to the Azure environment to create, manage and monitor Azure Cloud resources

Azure DevOps Web Portal

All DevOps operations are available through the Azure DevOps Web Portal. To access it navigate to dev.azure.com

Azure Command Line Interface

Use the terminal to interact with the Azure Cloud. See Microsoft Azure CLI

IDEs and Editors

The Azure connectivity is available in

  • Visual Studio
  • Visual Studio Code

Microsoft Azure DevOps Overview

Azure Boards

Kanban boards to manage project tasks, like Jira. Columns:

  • New
  • Active
  • Staging
  • Deployed

Azure Repos

Unlimited free private source code repositories

  • Git
  • Team Foundation Version Control (TFVC)
  • GitHub

Azure Test Plans

Dashboard the create and monitor tests

  • Tests for web and desktop applications
  • Manual tests
  • Exploratory tests – to discover the code and test it

Azure Artifacts

  • Integrated package management
  • Shared packages for the team
  • Supports NuGet, npm, Maven packages
  • Support for private and public sources

Configuring ChatGPT for Software Development

ChatGPT Enterprise promises not to use chat history for model training, so the enterprise data stays within the environment.

To set up ChatGPT for software development

On macOS

Install the Codex CLI command line tool with Homebrew

brew install codex

or with npm

npm i -g @openai/codex

On Windows

See the Windows setup guide at Running Codex on Windows

Launch Codex CLI

In the terminal execute

codex

Sign in with ChatGPT

Chose the login method you used to create the account. Fort SSO authentication enter your company email address and click the Continue button.

If you get the error message

An error occurred during authentication (codex_cli_workspace_disabled). Please try again.

You can contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID

the Codex CLI feature is not enabled in your account.

To update Codex CLI

In a terminal execute

npm i -g @openai/codex@latest

Practical Travel Tips for Europe

These tips are for amateurs, who don’t travel regularly. When we started this journey, we had some ideas on what to expect, but there are some details, I wish knew before. If you are a seasoned traveller, you will find some obvious observations, so feel free to skip them. If one person will find it useful, it already made sense to write it down.

Our itinerary

  • Paris France – 4 nights
  • Nice France – 3 nights
  • Toulon France – 1 night
  • Geneve Switzerland – 3 nights
  • Paris France – 2 nights

Hotels

We used Booking.com to find the hotels which had the highest ratings and reasonable price. As we mostly travelled by train and used local transportation, we were looking for places near to Metro (subway) stations and not too far from railway stations.

Nights and Days

As you know, travel between distant cities takes time, especially if you travel by airplane. In Europe you usually spend more time at the airport waiting for your boarding and your luggage, than in the air. It is safe to assume, that on the day of travel, you can only do some walking or catch the last hop-on hop-off bus, eat dinner, but not much more. So if you want to spend an entire day at a place, you need to stay for two nights.

Packing

  • Passports (visa if needed)
  • Credit cards with no foreign transaction fee
  • Debit card to withdraw cash from an ATM
  • Insulated water bottle
  • Strong string to dry clothes
  • Small shower gel
  • Small hand soap
  • Small shampoo
  • Extra tooth brush
  • Flip-flops to use then in the shower
  • Small TSA approved lock to secure the main zipper of your luggage
  • Small lock with a thin steel cable to tie your luggage to the train rack or two luggages together.
  • Battery power pack with charging cables to charge your phone on the go
  • Phone charger with travel adaptor for the countries you visit

Arriving to a new place

Greet locals in their own language

Learn four expressions:

  • Good morning
  • Good evening
  • See you later
  • Thank you

If you start the conversation in the local language, you demonstrate, that you honor their culture and took the time to explore it. You distinguish yourself from 99% of the tourists they are tired of. Everyone we met on our journey was very nice and helpful after we greeted them in french. The younger generation speaks english very well, and they were glad to practice it.

Getting to the hotel

In Europe usually Bolt is less expensive than Uber. Download the application in advance, and set up an account. Once you arrive to the city, just call a Bolt. Local “taxis” can be fake and you never know in advance how much the trip will cost. As Uber, Bolt gives you the cost, the model, license plate of the vehicle, and the name of the driver in advance.

Paying for things

At many places the card reader will ask you if you want to pay in local currency, or in your currency. Our experience is, it is less expensive to pay in local currency and have your credit card company charge you for the conversion.

Local Transportation

In Europe public transportation is excellent. At the airport or train station look for the tourist information desk and buy day passes for the duration of your stay. You can use them on the Metro, buses, street cars and many times local trains around the city. At night, if you don’t feel comfortable to go back to your hotel in the dark, call a Bolt from a safe place.

Public Toilets

In Europe you usually have to pay 1 Euro to use the public toilet. In Switzerland you can use a credit card, but in France you usually need cash.

First Sightseeing Trip

We always try to take the Hop-on Hop-off bus on the day of arrival. For 25-30 euros you get a great guided city tour in your language. It takes you to the most interesting places, and helps you to decide what to visit the next day.

Open and Save panel is unresponsive in macOS

First, I noticed, that Visual Studio is very slow:

  • debugging does not start for hours,
  • repository detection, that normally works by using the folder of the currently active file, takes hours,
  • the context sensitive menu activated by the right-mouse click does not show language specific functions,
  • the save file dialog is unresponsive.

Later, I noticed, that the open and save panel in every application is very slow or unresponsive. When I quit OneDrive, all problems disappeared.

Solution:

Restart OneDrive, or if that does not help, quit OneDrive at least for the time you want to use the open and save dialog.