I'm using Azure DevOps to create a pipeline that will have one stage to build and publish a Function App as an artefact, and then subsequent stages to deploy the Function App through the required life cycle.
What I'm unsure of is whether or not I need to explicitly download the artefact created by the build and publish stage in the subsequent deployment stages? There is plenty of documentation around this, but it's somewhat ambiguous and I can't see a mention of this particular issue.
- YAML schema reference
- Publish and download artifacts
Artifacts are associated with the run they were produced in and remain available after the run has completed.
Here is an example of my pipeline. The Dev
, Staging
and Production
stages incorporate a deployment strategy, and on many occasions there will be a delay (maybe days) between deployment of those stages.
stages:
- stage: Publish
displayName: Publish Function App
jobs:
- ...
- stage: Dev
displayName: Deploy Dev
jobs:
- ...
- stage: Staging
displayName: Deploy Staging
jobs:
- ...
- stage: Production
displayName: Deploy Production
jobs:
- ...
To publish the artefact containing my Function App I am using the publish
step within the last job of the Publish
stage.
- publish: $(System.DefaultWorkingDirectory)
artifact: FunctionApp
My question is, do I need to use the corresponding download
step in the Dev
, Staging
and Production
deployment stages, or will the artefact always be available at $(Pipeline.Workspace)
? Remember that I won't immediately progress through the deployment stages.
- download: current
artifact: FunctionApp
deployment
job so I will exclude thedownload
step. – Hammurabi