Importing and Running the Pipeline

Learn how to import, run, and test the pipeline in Azure DevOps.

Using a PAT

To log into DevOps, we can use a Personal Access Token. This will allow us to run all of our commands from the terminal. To generate your PAT, please follow the steps listed here. Once you have your PAT and your organization URL, you can set them as API Keys so that they can be used for all other terminals. To log in, we run the following command:

az devops login --organization <ORGANIZATION-NAME-HERE>

We are then prompted to enter our password.

Pushing our code to the repository

Before we import the pipeline, we will need to push the code we have so far. We will use the az repos list command to get our repo URL. We will pass the --detect parameter as True so that Azure can detect our organization automatically. However, we will need to provide our project name. This command will return a webUrl that we can use to push our local repository. This can be done by setting our remote origin to the webUrl and then using the git push command to push it.

Let’s retrieve our webUrl by running the script below. Hit the RUN button to access the terminal. You can run the script with the following command:

./usercode/runCode.ps1

Get hands-on with 1200+ tech skills courses.