How to run a Python script on Azure Release?

578 Views Asked by At

I have a python script on my Azure Repository. It is called build.py and it's inside folder swagger_updater. I am able to use it in a Build Pipeline easily, with the following script:

steps:
  - task: PythonScript@0
    inputs:
      scriptSource: filePath
      scriptPath: swagger_updater/build.py
      pythonInterpreter: /usr/bin/python3

Now, I want to run in the Release Pipeline, my release.py script which is in the same swagger_updater folder. What should I write in the Script Path? If I write swagger_updater/release.py it does not work. Please, see this image

1

There are 1 best solutions below

2
Ging Yuan-MSFT On

Since the release pipeline will download the artifact from the build pipeline. You could use the "Publish pipeline artifact" in your build pipeline. And then use the artifact in your release pipeline.

In build pipeline:

build

In release pipeline:

release

Update: If you are using Azure Repo directly, please check the following steps:

aure repo use python