This blog post explains how to generate dynamic variables while running Azure DevOps tasks and how to utilize them in subsequent tasks in dependent stage.
Prerequisites: Azure DevOps account
The following YAML pipeline consist with two stages called GenerateGuid and PrintGUID
1. Two GUIDs are generated within Job1 in GenerateGuid stage and are designated as output variables using the script below. 'demovariable01' is the dynamic variable name.