Forum Discussion
rekha7
May 30, 2023Copper Contributor
running python script on azure pipeline and storing output
I have a python script on azure repository, and the job runs in azure Pipeline whenever a change is detected in the .py code. Since the code's output is being seen on the cmd line or bash (I am not s...
pazdedav
Jun 13, 2023Iron Contributor
Hi rekha7,
There is a set of predefined variables in Azure Pipelines, one being System.DefaultWorkingDirectory. This is where the code from your repository is stored on an agent. You can find more info about those variables and how to use them here.
In general, there are several ways how you can persist an output from your pipeline run:
- save it as pipeline artifact, so you can retrieve it at a later time
- use a cloud storage service and its CLI commands to persist it there, e.g. Azure Blob Storage. A useful blog post on how to do it here.
- store your file in the source git repository.
Keep in mind, when the pipeline run is over, the agent and anything stored in its filesystem gets wiped, so just storing it in the filesystem would not persist the data.