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 i...
A blog about my testing stories where I pen down my thoughts about test automation covering primarily Selenium, Java, Rest Assured, Karate, Maven, TestNG, Postman, newman, Jenkins, Git, Azure DevOps, etc.