Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipe ARM template outputs into build variables so that I can use them for later steps #3198

Closed
piquet-h opened this issue Dec 6, 2016 · 6 comments

Comments

@piquet-h
Copy link
Member

piquet-h commented Dec 6, 2016

I have two subscriptions I wish to join with n vpn gateways. I wish to take the output from the first resource group deployment which lists the names of the vpn gateways as an output, and pass that as a template parameter override into the next resource group deployment.

Can we use the ##[vso.setVariable] per the command authoring to pump it out? There's a related issue about persisting output variables which doesn't really complete the job

@chshrikh
Copy link
Contributor

@piquet-h as of now Deploy Azure RG does not support to take its output as a output variable. But you can do

  1. Use Azure RG task to deploy RG
  2. Write your own powershell script to get all required details for RG creates in above step and set it as output variable. Please refer https://github.com/Microsoft/vsts-tasks/blob/6b049dab46f49f0ed29534f5b3c7557afe96f041/docs/authoring/commands.md how to set output variable.
  3. Use next Azure RG task and consume the output variable created at step -2 as a input for template parameter

@chshrikh chshrikh self-assigned this Dec 27, 2016
@alexmarshall132
Copy link

This is all well and good if you have a simple string field that you want to pass along, but what about if you want to pass things like connection strings and keys to later steps for populating items that are released on-premise where there's no app service override of System.Configuration.ConfigurationManager to manager your appSettings and connectionStrings in a secure way ?

@mvvsubbu mvvsubbu assigned niadak and unassigned mvvsubbu Mar 13, 2017
@bryanmacfarlane bryanmacfarlane modified the milestone: TFS.vNext (onPrem) Mar 29, 2017
@kmkumaran kmkumaran removed this from the TFS.vNext (onPrem) milestone Apr 4, 2017
@sachinma sachinma assigned thesattiraju and unassigned niadak and chshrikh Apr 5, 2017
@keesschollaart81
Copy link
Contributor

I've created a VSTS extension which does exactly this... Hope it helps!

@thesattiraju
Copy link
Contributor

thesattiraju commented Jul 12, 2017

#4772 I am working on it.

@sachinma
Copy link
Member

See #5351 for latest on this topic

@thesattiraju
Copy link
Contributor

thesattiraju commented Jan 9, 2018

I have added an outputs section in the task definition, where you can provide a name for the variable for the output variable which will contain the outputs section of the current deployment object in string format. You can use the “ConvertFrom-Json” PowerShell cmdlet to parse the JSON object and access the individual output values in the further steps of your build/release.

You'll start seeing this change within next 3 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests