When you pass a variable as a parameter to a template, it gets evaluated at compile time rather than runtime. So when your pipeline is compiled, it's likely that the variable group's value for deploymentEnvironment
is being used for both stages.
Try to use stage-specific variable names in your variable groups:
e.g:
# In App-DEV variable group:
# dev_deploymentEnvironment: AKS-Dev.dev
# In App-QUA variable group:
# qua_deploymentEnvironment: AKS-Qua.qua
# Then in pipeline:
parameters:
deploymentEnvironment: $(dev_deploymentEnvironment) # For DEV stage
# Or:
deploymentEnvironment: $(qua_deploymentEnvironment) # For QUA stage
See: https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops**
You can mark it 'Accept Answer' and 'Upvote' if this helped you**
Regards,
Abiola