-1

I am creating a new pipeline for deploy multiple apps in azure devops, for sample:

enter image description here

I wanna make xml variable substitution for sample ConnectionString in web.config.

For sample:

enter image description here

But variables only can group by scope Stage and not by task in same stage, can I do this somehow?

Thanks in advance.

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
Toni
  • 11
  • 3

1 Answers1

2

It is not supported to definite variables with the same name in same stage but different tasks. The document has mentioned the scopes of variables.

Custom variables can be defined at various scopes.

Share values across all of the definitions in a project by using variable groups. Choose a variable group when you need to use the same values across all the definitions, stages, and tasks in a project, and you want to be able to change the values in a single place. You define and manage variable groups in the Library tab.

Share values across all of the stages by using release pipeline variables. Choose a release pipeline variable when you need to use the same value across all the stages and tasks in the release pipeline, and you want to be able to change the value in a single place. You define and manage these variables in the Variables tab in a release pipeline. In the Pipeline Variables page, open the Scope drop-down list and select "Release". By default, when you add a variable, it is set to Release scope.

Share values across all of the tasks within one specific stage by using stage variables. Use a stage-level variable for values that vary from stage to stage (and are the same for all the tasks in an stage). You define and manage these variables in the Variables tab of a release pipeline. In the Pipeline Variables page, open the Scope drop-down list and select the required stage. When you add a variable, set the Scope to the appropriate environment.

This maybe a workaroud to change the value of variable after one task.

enter image description here

Please refer to this issue: How to modify Azure DevOps release definition variable from a release task?

unknown
  • 6,778
  • 1
  • 5
  • 14