System Default working directory Azure DevOps

Share

System Default working directory Azure DevOps

In Azure DevOps pipelines, the default working directory varies depending on the type of agent and the configuration of your pipeline. Here are the typical default working directories for different types of agents:

  1. Microsoft-hosted Agents:

    • For Microsoft-hosted agents (also known as Azure Pipelines agents provided by Microsoft), the default working directory is typically:
      makefile
      C:\AzureDevOps\Agent\_work\<Agent ID>

      On Linux-based Microsoft-hosted agents, the default working directory is:

      arduino
      /home/vsts/work/<Agent ID>
  2. Self-hosted Agents:

    • For self-hosted agents that you set up and manage in your own environment, you can configure the working directory when configuring the agent. The default working directory for self-hosted agents is typically:
      php
      <Agent Installation Directory>\_work\<Agent ID>

In both cases, <Agent ID> is a unique identifier for the agent instance, and <Agent Installation Directory> refers to the directory where the agent software is installed on the agent machine.

You can customize the working directory for your pipelines by specifying it in your pipeline YAML or in the agent configuration. Here’s an example of how to set the working directory in a pipeline YAML:

yaml
jobs:
- job: MyJob
steps:
- script: |
# Your script or commands here
displayName: 'My Step'
workingDirectory: $(Agent.BuildDirectory) # You can customize the working directory here

In this example, $(Agent.BuildDirectory) is used to set the working directory, but you can replace it with the desired path.

Keep in mind that the working directory determines where your pipeline tasks and scripts execute, and it’s essential to configure it appropriately based on your pipeline’s requirements.

Demo Day 1 Video:

You can find more information about DevOps in this DevOps Link

 

Conclusion:

Unogeeks is the No.1 IT Training Institute for DevOps Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on  DevOps here – DevOps Blogs

You can check out our Best In Class DevOps Training Details here – DevOps Training

💬 Follow & Connect with us:

———————————-

For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at: info@unogeeks.com

Our Website ➜ https://unogeeks.com

Follow us:

Instagram: https://www.instagram.com/unogeeks

Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute

Twitter: https://twitter.com/unogeeks


Share

Leave a Reply

Your email address will not be published. Required fields are marked *