Big Picture: We are using Azure DevOps release process (so far we create steps in designer, not YAML pipelines). We release to 3 environments with 3 different databases. Part of the release is deploy database from DACPAC file. Since using SqlPackage.exe to publish directly to database is not very transparent (you don't see and review the actual SQL script), we wanted to do release in 2 stages:
Issue: How to share sql script file between stages and how to see it for approval. Stages can be triggered on different agent.
What I've tried:
Any other suggestions?
A single release pipeline can be linked to multiple artifact sources, of which one is the primary source. In this case, when you create a release, you specify individual versions for each of these sources.
Share variables between Tasks across the Jobs (of the same Stage) We need to use the isOutput=true flag when you desire to use the variable in another Task located in another Job. Navigate to Stage1_Job1_Task1 and add isoutput = true flag to the Logging Command which let's us to access the value outside the Job.
Select Releases under Pipelines section. The Azure DevOps project created a release pipeline to manage deployments to Azure. Select the release pipeline, then choose Edit. Under Artifacts, select Drop.
While you can't use pipeline artefacts, you could use Universal Packages in Package Management to publish arbitrary files for later retrieval. Just dumping the file contents to the pipeline logs is the easiest way to allow people to inspect it.
You could also create a file with placeholders as a build artefact and merge in the final settings from Pipeline variables in each stage, that way you can keep them as a build artefact. That's what I tend to do for any files of this nature. Sounds like this won't apply for your generated SQL file.
Alternatively, if the "seeing for approval" piece is important you could generate it and write it to the log, upload it to Universal Package Management. Then ask for approval at the end of the stage. In the next stage, you then download the script from Universal Package Management or you regenerate it using the exact same task configuration before execution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With