Untitled Document
Untitled Document
°ßÀûÀÇ·Ú
¹®ÀǸÞÀÏ
Untitled Document
 
<?=?>[Board]
 
ÀÌ      ¸§ NEBRASKA-Exins ÀÛ¼ºÀϽà 2021-05-20 02:58:58
Á¦      ¸ñ news24 - REMMONT.COM

Azure devops output variables - ¬²¬²¡Æ¬²¡¾¬³¬²¬×¬²¬³¬²¬²¬×¬²¢à ¬²¡©¬²¬³¬²¡Æ¬³¬²


Azure devops output variables



Azure devops output variables Headline news Azure devops output variables

Nathanael Marchand


Software Development Engineer ? Former Microsoft MVP


About me


Hi, I'm Nathanael !
Software development engineer in the .Net ecosystem.
I've been Microsoft MVP for five amazing years.



I use .Net and .Net Core to build great apps that run and scale nicely using Azure services such as App Services, Service Fabric, Containers, Service Bus, etc.


Social


Archives


Categories


Buddies


Twitter


Using Terraform output values in Azure DevOps pipeline


When working with Terraform to deploy an infrastructure in an Azure DevOps pipeline, it is useful to use the output values in the following steps of your pipeline. Let?s see how we can achieve this easily.


Planning


For deploying Terraform templates to an infrastructure, I use the Terraform tasks library made by Microsoft.
Thanks to the output variables of the Terraform task, we are able to get a reference to a file containing the output values after a successful apply .
Now, all the work is to read this file to convert it to variables for Azure DevOps. For this we are going to use a YAML pipeline. However it should be possible to do it with a classic pipeline.


Execution


First of all, we need to give a name to the apply task of our pipeline, here we name it ?terraformApply?.


Next step is parsing the file produced by the task above and convert it to variables. For this, we are going to use Powershell and the ability to define variables at runtime with the ##vso commands.
The produced file looks like this :


We need to iterate on each property, take in account if the variable is sensitive (if so we have to specify that it is a secret) and use the ##vso commands.
The corresponding task looks like this :


We read the file (note that the jsonOutputVariablesPath variable is an output of the apply task, thus we need to prefix with the task name terraformApply), parse the json and then on each property we output the ##vso command with the parameter issecret if needed.


We are now ready to use it in the next tasks. Such as the following App Service deployment task:


Please note, as the variables are defined as output, it?s needed to also prefix with terraformOutput (which is the name of the powershell task we created).


Conclusion


Here we are ! We now are using the terraform outputs in the next tasks of our pipeline. Luckily, with the sensitive parameter we are also able to keep our secrets safe !


Azure devops output variables



Azure devops output variables



Azure devops output variables Latest news today Azure devops output variables

Azure devops output variables


Let's see how we can use Terraform deployment output values in the following tasks of an Azure Devops Pipeline.
Azure devops output variables

Azure devops output variables Azure devops output variables Azure devops output variables
SOURCE:
Azure devops output variables
Azure devops output variables Azure devops output variables
#tags# -,-Azure devops output variables] Azure devops output variables#tags#
https://ssylki.info/?who=remmont.com/itsjudyslife-gossip-4 https://ssylki.info/?who=remmont.com/live-pd-officers-6 https://ssylki.info/?who=remmont.com/about-the-j-smuckers-careers-smuckers-careers https://ssylki.info/?who=remmont.com/black-bossip-2 https://ssylki.info/?who=building-credit.remmont.com

¸ñ·Ï ¾²±â ¼öÁ¤ »èÁ¦

 
Untitled Document
Untitled Document