0

I have automated a build/deploy process in Azure Devops / TFS and would like to scrape a file or folder name as a variable from the source file path that is used for my build artifact.

For example, I might want to scrape the folder name of the folder at the build source path and store it for use in the build #, release #, etc.

I have gone through Microsoft's documentation and I believe the information I'm looking for might be associated with the following... but I can't seem to find the right location.

Release.Artifacts.{alias}.BuildURI  #The URL for the build.

Azure pipelines example: vstfs://build-release/Build/130
GitHub example: https://github.com/fabrikam/asp

When I attempt to locate the folder name from the source, I have so far been unable to find it in code.

nuprap
  • 385
  • 5
  • 22

1 Answers1

1

Sorry, it's not possible to get the source file & folder name/Artifact name from the environment variable.

As of now, you need to specify the Artifact alias name in order to access the artifact related information.

E.g, Release.Artifacts.{alias}.DefinitionName

General Artifact variables

Primary Artifact Variables

Using default variables, you can use the default variables in two ways - as parameters to tasks in a release pipeline or in your scripts. here

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62