Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Azure Subscription as a Parameter of Task Group in VSTS

I'm trying to create a Task Group out of several tasks that Deploy a few apps into Azure AppService among other things. My idea is to use this Task Group to deploy into different Environments (ie, Dev, QA, UAT, Prod). However, I can't convert Azure Subscription into a variable, which is currently a process Parameter. Is there a solution for that?

like image 809
Boris Lipschitz Avatar asked Apr 17 '18 23:04

Boris Lipschitz


People also ask

How do you pass variables between tasks in Azure DevOps?

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.

How do I add a task group to a release pipeline in Azure DevOps?

Create a task group The easy way to do this is to choose Unlink all in the settings panel for the entire process. Select a sequence of tasks in a build or release pipeline, open the shortcut menu, and then choose Create task group.

How do you use variable groups in Azure DevOps?

To use a variable group, open your pipeline. Select Variables > Variable groups, and then choose Link variable group. In a build pipeline, you see a list of available groups. In a release pipeline, for example, you also see a drop-down list of stages in the pipeline.


1 Answers

You can use variable in Azure Subscription, but the value should be the actual value of related endpoint.

  1. Create a new release/build definition with debug enabled (set/add system.debug variable to true) and add Azure PowerShell task to get the actual value.
  2. Start/Queue release/build, then check the log, you can find the log like this: ##[debug]INPUT_CONNECTEDSERVICENAMEARM: '{actual value}’
  3. Edit task group, specify variable in Azure Subscription input box (e.g. $(sub)) >Save
  4. Edit your release definition, add the variable(s) (e.g. mySub) with that actual value (step 1)
  5. Tasks > Select related Task group > Specify variable (e.g. $(mySub)) in sub (per to step 3) input box.

On the other hand, you can choose azure subscription for related task group directly (step 3, then edit tasks for an environment > Choose Azure Subscription directly)

like image 159
starian chen-MSFT Avatar answered Oct 19 '22 12:10

starian chen-MSFT