Monday, September 26, 2022

[FIXED] How to consume variables from CI pipeline into CD pipeline directly

Issue

How can I consume variables set in CI pipeline directly in CD pipeline?

Example: If there are multiply variables declared in one group. How to access particular variable in CI/CD pipeline?

enter image description here

Also how to use variable groups for multiple keyvault's?

Thank you


Solution

Setting up global variables

YAML

https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml

CLASSIC

https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=classic

Using Variables

YAML

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch

CLASSIC

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch

Examples:

Batch script: %VARIABLE_NAME%
PowerShell script: $env:VARIABLE_NAME
Bash script: $VARIABLE_NAME

Key Vault

https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=classic#link-secrets-from-an-azure-key-vault



Answered By - Richard Hughes
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.