Skip to main content

Posts

Showing posts with the label Azure

Execute Selenium Tests (C#) through Azure DevOps (CI/CD) in Browser Stack

  Introduction Prerequisite s  Preparing the YAML Setting up the pipeline Conclusion Introduction : In this article, we will be seeing how we can build a CI/CD pipeline in Azure DevOps to execute selenium test cases with C# language binding and execute tests in Browser Stack. But before we go there let us check what is CI/CD. Continuous integration (CI) is a process in which several team members merge their code repeatedly into a shared trunk. Before every integration, the changes are validated through automated testing. In this manner, we can find issues as quickly as possible and prevent defects from entering our live environments.  Continuous delivery (CD) is the extension of continuous integration that automates deployments by making sure changes that have successfully passed the automated designated tests are made to the next environment automatically as soon as they are ready.  Continuous Integration/Continuous Delivery is a set of best practices and principles that engineering t

What is Azure DevOps Extension in Azure CLI and How to install?

  Azure DevOps Extension in Azure CLI expands the capabilities of the Azure CLI to interact with Azure DevOps services. It provides commands for managing work items, pipelines, repositories, test plans, and other DevOps resources directly from the command line. Here are the general steps to install the Azure DevOps CLI extension: Prerequisites : 1.        >  Azure CLI: Make sure you have the Azure CLI installed on your machine. You can download it from the official Azure CLI website: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli Steps to Install Azure DevOps CLI Extension: 1. Open a Command Prompt or Terminal:            Open your command-line interface. This could be a Command Prompt on Windows, a Terminal on macOS/Linux, or Azure Cloud Shell.       2. Install the Azure DevOps Extension:             Run the following command to install the Azure DevOps CLI extension:                       az extension add --name azure-devops        3. Sign Into Azure De

Sensitive Data in Azure Pipelines - Azure Variable Groups (Benefits and Real-World Examples)

  Secret variables are variables that are encrypted and can be used in pipelines without having their value revealed. You can use secret variables to store confidential information like passwords, identification numbers, and other identifying information that you wouldn't want to be exposed in a pipeline. Secret variables are accessible to tasks and scripts on the agent and are encrypted at rest with a 2048-bit RSA key. Secret variables specified in a pipeline's pipeline settings UI are only applicable to that pipeline. To share confidential variables between pipelines, utilize variable groups. What are Azure Variable Groups? Key-value pairs, or variables, can be used in many pipelines and stages of an Azure DevOps project and are managed centrally by Azure Variable Groups. These variables can be used to store configuration values that may change depending on the environment (such as development, staging, or production), as well as private data like connection strings or

How to pass a variable value between Azure Pipeline jobs (within the same stage)?

Since the jobs operate in different namespaces, passing variable values between them is unlike passing a variable value from one function to another. In the example below, $app_Token is the variable name that needs to be sent from one job to another job but within the same stage. This issue can be resolved by dynamically storing the variable in the variable library and retrieving its value from there. The task.setvariable command, which is illustrated below, is required to store variables using PowerShell in the Azure Pipeline library. Full example:  # Maven # Build your Java project and run tests with Apache Maven. # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/java trigger: - master stages: - stage: VariableUpdateAutomation jobs: - job: Set_AppTokenValue pool: vmImage: ubuntu-latest steps: - task: PowerShell@2 name: Set_AppTokenValue input

How to use Azure DevOps REST API to extract and update data within Azure DevOps?

Azure DevOps offers a fantastic set of REST APIs which allows you to extract and operate data within Azure DevOps by sending an HTTP request to a specific service. It is up to you how you want to call these APIs i.e., using Postman if you are not a fan of coding much or you can use RestAssured, RestSharp libraries if you can write code. I am using Postman here to execute these APIs; all the Azure DevOps Rest APIs expect you to follow these things: 1)    Provide the PAT (Personal Access Token) in the Authorization  tab: o   Type : Basic Auth o   Username : leave it blank o   Password : Enter your PAT Note* Here is how you can create a PAT: https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows#create-personal-access-tokens-to-authenticate-access 2)     Send the request o Select the HTTP Method (Get, Post, Patch, etc.) o Create a request URL, replacing your organization and your project name of yo