<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Olivas on Medium]]></title>
        <description><![CDATA[Stories by David Olivas on Medium]]></description>
        <link>https://medium.com/@dolivasm?source=rss-6a47d4805daa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Q9vKtXah_7Ksp0Uwlmx9Yw.jpeg</url>
            <title>Stories by David Olivas on Medium</title>
            <link>https://medium.com/@dolivasm?source=rss-6a47d4805daa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:39:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dolivasm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Basic AWS Networking Components]]></title>
            <link>https://dolivasm.medium.com/basic-aws-networking-components-d75de80b23a3?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/d75de80b23a3</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 20:35:43 GMT</pubDate>
            <atom:updated>2026-11-23T20:42:47.969Z</atom:updated>
            <content:encoded><![CDATA[<h4>AWS for Beginners</h4><h4>Simple, detailed definitions for beginners.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*0Xw9rz8W_98jNCpUgxEbTQ.png" /><figcaption>Image from draw.io by me.</figcaption></figure><h3><strong>Introduction</strong></h3><p>Understanding networking was challenging when I first started working with AWS. I had some basic knowledge, but once I had to get hands-on, it was evident I needed a deeper understanding. In this post, I will cover the basic resources to understand the foundation of how networking works in AWS. However, I will assume that you know what an IP address and a network interface are.</p><p>AWS offers many different resources, and they continually add more to their catalog and expand the features of existing ones. As this is a beginner-friendly post, I will focus only on the most fundamental ones. I tried to avoid going into too many technical details, since there is plenty of official documentation to go deeper into the technicalities of each component. My aim with this post is to provide easy but detailed explanations for beginners, with as few technical details as possible.</p><h3><strong>Basic AWS Networking Components</strong></h3><p>These are simply the ones I consider to be the most basic networking AWS resources and concepts that a beginner should understand.</p><h4><strong>Availability Zone (AZ)</strong></h4><p>Just like every other big public cloud provider, AWS uses the concept of Regions and Availability Zones (AZs).</p><p>A Region is a place in the world where they have a cluster of data centers. An AZ is simply one of those data centers in the Region.</p><p>Even though all the AZs are within the same Region, they are physically separated from each other to prevent as many data centers as possible from being affected at the same time by any type of catastrophe.</p><h4><strong>Virtual Private Cloud (VPC)</strong></h4><p>This is your private network. Think of it as a logical container with a defined number of slots (IP addresses) for whatever you want to put inside it: EC2 or RDS instances, ECS tasks, ALBs, etc.</p><p>However, it needs to be subdivided using subnets before anything can be added. Whatever you want to add, for it to be part of the VPC, it needs to have an Elastic Network Interface (ENI).</p><p>The amount of available slots in your VPC is defined by a Classless Inter-Domain Routing (CIDR) block, which has to be specified at the creation of the VPC. After creation, more CIDR blocks can be added, thus extending the quantity of slots. This wasn’t always the case, though.</p><h4><strong>Subnets</strong></h4><p>Subnets are smaller containers within your VPC with more specific purposes.</p><p>A common example is having a subnet for publicly accessible resources, like an internet-facing Application Load Balancer (ALB), another subnet for the application servers, and one last subnet for databases. This is just one example. Depending on the architecture used, there can be different subnets for different, more general or more specific purposes.</p><p>A subnet must be created in one AZ, and one AZ only, but one AZ can have multiple subnets. It is a good practice to create subnets in at least 2 different AZs. This allows you to host the resources in more than one data center and introduce high availability to your architecture.</p><h4><strong>Network Access Control List (Network ACL)</strong></h4><p>It is a list of rules that control ingress and egress access to the resources in a subnet. Every subnet must have one Network ACL associated. Since the Network ACL is evaluated at the subnet level, its rules affect the traffic of all resources in that subnet.</p><p>In a Network ACL, rules are evaluated by their number. The lower the number, the sooner it will be evaluated. It is important to understand the order in which your rules will be evaluated to avoid unintentionally denying traffic that should be allowed, or vice versa.</p><p>I prefer to assign high values to the rule numbers to leave room in between each rule. This way, you will be able to add more rules in the future between the existing ones if necessary.</p><p>One very important characteristic of Network ACLs is that they are stateless. This means that when you want to allow traffic, you have to add an inbound and an outbound rule for the request and the response traffic to flow properly. Let me try to make it clearer with an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTMdy9ZHDJ04bxYWYnZA6Q.png" /><figcaption>Network ACL example visualization.</figcaption></figure><p>In the image above, we have an app server and a PostgreSQL DB. We want our Network ACLs to allow only the necessary traffic for the app server to connect to the DB and nothing else. When a new Network ACL is created, it blocks all traffic by default. In contrast, the default Network ACL allows all traffic. For our app server to connect to our DB, we need to create 2 rules in each new Network ACL, so 4 rules in total:</p><h4><strong>Network ACL A (App Server)</strong></h4><p><strong>Outbound rules</strong></p><p>Outbound rule to allow the app server request to the DB to exit subnet A.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*a5FuQBwaOPnUSIrnmq7E6w.png" /></figure><p><strong>Inbound rules</strong></p><p>Inbound rule to allow the response from the DB to enter subnet A.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*lRBI1KbZOeOG1zqC4FyZPQ.png" /></figure><h4><strong>Network ACL B (Database)</strong></h4><p><strong>Inbound rules</strong></p><p>Inbound rule to allow the request from the app server to enter subnet B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*7TiEZUpRxMHhzvMzAN9vuw.png" /></figure><p><strong>Outbound rules</strong></p><p>Outbound rule to allow the response from the DB to exit subnet B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*U8tYsqYHFTLpltE84l19nQ.png" /></figure><p>The flow of the connection would be as follows:</p><p>1. The App Server sends a PostgreSQL request to the DB instance. It is first evaluated by the outbound rule of Network ACL A.</p><p>2. Then the request needs to be received by the DB instance. This time, it is evaluated by the inbound rule of Network ACL B.</p><p>3. After receiving the request, the DB instance sends a response to the App Server. Now it is evaluated by the outbound rule of Network ACL B.</p><p>4. Finally, the response needs to be received by the App Server. So it is evaluated by the inbound rule of Network ACL A.</p><p>5. Now there is a connection established between the App Server and the DB.</p><p><strong>Remarks:</strong></p><p>- You may have noticed that in the Network ACL A inbound rule and in the Network ACL B outbound rule, the port range is <strong><em>1024–65535</em></strong>. This is because it is an ephemeral port range. This ephemeral port range is necessary because when the App Server sends the PostgreSQL request, it sends it to port 5432, but it is sent from a random port within that ephemeral port range.</p><p>- The rule at the bottom of each set of rules, the one that is of type <strong>”All traffic”</strong>, is the default behavior of a new Network ACL. It blocks all traffic that is not allowed in one of the previous rules. It doesn’t have a number assigned because it is always evaluated last.</p><p>- By setting the rule number to 500, there is plenty of space before and after to add more rules. The highest possible number to use is 32766, so don’t be afraid of using high numbers.</p><h4><strong>Security Group (SG)</strong></h4><p>An SG does basically the same as a Network ACL, but with three crucial differences.</p><p>1. SGs are scoped to a resource in specific, or a resource’s ENI to be precise, e.g., an EC2 instance. Unlike a Network ACL, which is scoped to a subnet.</p><p>2. SGs are stateful. This means that they have a sort of “memory”. For example, when an outbound request is sent, it “remembers” and allows the inbound response related to it. Hopefully this will be clearer with the example below.</p><p>3. SG rules are not evaluated by number or priority. The order of the rules doesn’t matter. There are no deny rules; SG rules only allow traffic; everything else is denied.</p><p>Let’s extend the same example from the Network ACLs to now have an SG for each resource:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-AfRMulXZD8UcN1a6fx7fg.png" /><figcaption>Security Group example visualization.</figcaption></figure><p>So we have our subnets with the Network ACLs already configured to allow the App Server to connect to the DB. But now we have SGs in the mix, which are blocking all traffic. So we need to add the necessary rules to allow traffic between the App Server and the DB.</p><h4><strong>Security Group A (App Server)</strong></h4><p><strong>Outbound rules</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*hSJCf_shljFRuUmPWgo0Iw.png" /></figure><h4><strong>Security Group B (Database)</strong></h4><p><strong>Inbound rules</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*qHt8PK-RAl66SNgT-gv9gg.png" /></figure><p><strong>Remarks:</strong></p><p>- Since SGs are stateful, there’s no need to worry about ephemeral ports or rules in the “other direction” of the SGs. The App Server needs to send the connection request, so only the outbound rule is necessary. And the DB needs to receive the connection request, so only the inbound rule is necessary. Each SG keeps track of the inbound or outbound flow. When the App Server sends the request, the SG “remembers” and auto-permits the matching response. Same for the DB’s SG inbound rule.</p><p>- The second outbound rule in SG A, sgr-222…, allows all outbound traffic. This rule is added by default when creating a new SG, and it makes the first rule, sgr-111…, obsolete. Keep the first rule if you want to be specific about what the App Server can reach, or keep the second one if you want to allow it to reach anywhere.</p><p>- Similarly, the second inbound rule in SG B, sgr-444…, makes the first rule, sgr-333…, obsolete as well. But this time, at a lower scale. The first rule allows only the specific IP address of the App Server; the second one allows only the resources that have SG A assigned. Say you have 3 App Servers that need to connect to the same DB; instead of adding 3 rules, one for each server IP address, you simply add one rule allowing the SG, and make sure the servers have SG A assigned, of course.</p><p>- SG A doesn’t have any inbound rules, so it will block any request trying to go into the server. Same for SG B about the outbound rules, no outbound communication is allowed as it is.</p><p>- Hopefully, the extra rules didn’t generate too much confusion. But in essence, only the rules sgr-111… and sgr-333… are really required to allow communication between the App Server and the DB in a least-privilege approach. Only one rule in each SG, in comparison to the Network ACLs, which needed 2 rules each to achieve the same behavior.</p><h4><strong>Route Tables</strong></h4><p>This one was particularly challenging for me at the beginning. I remember the struggle to understand what the destination and the target actually meant.</p><p>Every subnet must have one route table associated — only one — and a route table can be associated with several subnets. It can also be associated with other AWS resources (not only subnets) through an edge association, but this is for more advanced use cases and is out of the scope of this post.</p><p>We can define a route table as a list of instructions, routes, on where to send the traffic according to its destination. This is very much like asking for directions to a GPS or a maps application. You enter your destination, and it will tell you which route to follow to get there.</p><p>Let’s continue expanding our previous example. I’ll add 2 route tables now, one for each subnet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tfqJRHHCvta7FVunkAfXQ.png" /><figcaption>Route Table example visualization.</figcaption></figure><p><strong>Route Table A</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*YuYOH8TWxGxRxnqWpQ4KZw.png" /></figure><p><strong>Route Table B</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*rYCGwCaSc5Q_mNKn9s_bkw.png" /></figure><p>Since our example is very simple, only one route is necessary for our resources to communicate with each other because they are in the same VPC. This is thanks to the “local” route, which is added by default when a new route table is created. This route is in every route table and ensures that every subnet in the VPC has a way to reach all other resources in the same VPC.</p><p>Then there is the first route in Route Table A: 0.0.0.0/0 -&gt; nat-xxx. This route sends all traffic to a NAT GW (see below); this means that all traffic that doesn’t have a more specific route will be sent to the NAT GW. But notice the “local” rule; this will ensure that all traffic going to the same VPC, 10.0.0.0/16, will not be sent to the NAT GW.</p><p>Route tables use “longest prefix match” to decide which rule to use; basically, the rule with the most “specific” CIDR block will be evaluated. In our example, 10.0.0.0/16 is more specific than 0.0.0.0/0, so any traffic going to any address within the CIDR block 10.0.0.0/0 will be routed locally, and everything else will go to the NAT GW.</p><h4><strong>Internet Gateway (IGW)</strong></h4><p>As its name suggests, this is the VPC’s gateway to the internet. From a beginner’s perspective, the main characteristics to know are:</p><p>- It is highly available by design, and it is managed by AWS. Basically, just set it and forget it.</p><p>- It is not automatically a part of the VPC; it must be explicitly created and attached.</p><p>- It can only be attached to one VPC, and a VPC can only have one IGW attached.</p><p>- It simply provides a gateway to the internet; it doesn’t have any security features integrated with it.</p><p>- It doesn’t have any cost.</p><h4><strong>NAT Gateway (NAT GW)</strong></h4><p>It’s the Network Address Translation (NAT) service AWS offers for VPCs. This is the service we use when we need to enable internet communication from resources in a VPC without a public IP address, so they can connect to services outside the VPC without making them available to those external services.</p><p>There are two types: public and private. The public one is the most commonly used; it allows private resources in your VPC to reach the internet without making them reachable from outside the VPC. It needs its own Elastic IP address to be able to reach the internet and do the actual address translation.</p><p>A private NAT Gateway does pretty much the same, but instead of the internet, it enables the private VPC resources to reach other VPCs or on-premises networks without making the private resources reachable to the other VPCs or on-premises networks.</p><p>Until November 2025, NAT Gateways were Zonal only. So you would need to create one for each AZ in your architecture and manage the subnet they use, the route table, and the Network ACL. In November 2025, AWS added “Regional NAT Gateways”. So, instead of creating a NAT Gateway in each AZ you use, you simply create one Regional NAT Gateway, and it detects which AZs have workloads and automatically expands, with a few minutes’ delay.</p><p>A Regional NAT Gateway works as a standalone resource, so there’s no need to configure a subnet, route table, or Network ACL. Both options are available, so you can choose between simplicity by using a Regional NAT Gateway or more control with Zonal NAT Gateways.</p><h3><strong>Example of an architecture that uses all these components</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KThOjZTfvgejaCPeZ5Gs2A.png" /><figcaption>Full architecture example visualization.</figcaption></figure><p>In the diagram above, we have a simple architecture including all the components covered by this post.</p><p>The IGW connects the VPC to the internet; the applications can reach the internet thanks to their route tables sending any request going to the internet through the zonal NAT Gateways. The DBs have only the local route, so they can only communicate with resources within the VPC.</p><p>Both app servers and DBs are protected by their respective SGs. Each subnet has its own Network ACL. Two Availability Zones are in use. Notice how the NAT Gateways also have a public IP address each, in order to be able to do their work as network address translators and allow the private resources to communicate with the internet, without exposing them.</p><h3><strong>Conclusion</strong></h3><p>We have covered only the most fundamental AWS networking resources; there are plenty of other services available for different use cases. However, understanding these will make it easier to build on this knowledge.</p><p>I hope you have at least learned one new thing after reading this post. I did my best to make the explanations beginner-friendly and abstract the definitions from their technical terms as much as possible. I hope they are clear enough and were useful to you.</p><p>If you have any feedback, please feel free to let me know. My goal is to make it as clear as possible for newcomers to the AWS Networking world.</p><p><em>Originally published at </em><a href="https://tech-blog.dolivas.com/posts/aws-network-basic-components/"><em>tech-blog.dolivas.com/posts/aws-network-basic-components</em></a><em> — written in November 2026.</em></p><p><em>If this was useful, a clap helps others find it — and I’d like to read your thoughts in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d75de80b23a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Ended Up Working on DevOps]]></title>
            <link>https://medium.com/geekculture/how-i-ended-up-working-on-devops-9d9b56224bc2?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d9b56224bc2</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[change]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Fri, 01 Oct 2021 01:34:15 GMT</pubDate>
            <atom:updated>2026-11-23T20:43:26.391Z</atom:updated>
            <content:encoded><![CDATA[<h4>Personal Story</h4><h4>From Developer to DevOps Engineer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A-WlT0c83YUV7yjX" /><figcaption>Photo by <a href="https://unsplash.com/@soymeraki?utm_source=medium&amp;utm_medium=referral">Javier Allegue Barros</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There are many paths we can take in software engineering, but the most common one is to start as a developer. I started as a software developer for a small Costa Rican startup, then moved to a medium-sized US company in Costa Rica, where I had the opportunity to learn DevOps. As of right now, I am in the process of moving to a different country because of a job opportunity.</p><h3>Software Developer Experience</h3><p>In the university where I studied, one of the last requisites to graduate is to do an internship at a company working on something related to software engineering. Ninety-nine percent of the time everyone ends up coding.</p><p>Four classmates and I found a small startup that accepted us. We didn&#39;t have any cool benefits or perks that the big companies give to their interns. We were given just enough money for transportation and we had to bring our computers for work. However, the company was using cutting-edge technologies at that moment and we were given a lot of freedom and responsibility on their projects, which now I realize was incredibly helpful to gain experience on high-demand tools, and also to build a sense of belonging, responsibility, and confidence.</p><p>After the internship finished I was offered a job, which I accepted and started working as a full-stack software developer. After a few months, the startup outsourced me to a Costa Rican FinTech company to work on a mobile app. That project introduced me to the cloud and broaden my tech horizons. We were creating a serverless backend, everything was in AWS, and all the tech we were using was new to me. There was no senior engineer, no architect, no DevOps, no nothing, we were just a bunch of mid-level developers who had to start learning AWS on the fly.</p><p>It was a frightening experience, we had a lot of responsibility on our shoulders, but at the same time, it was the best experience that I’ve had so far working on a project. We were taking almost all the tech decisions. Of course, they had to be discussed and approved by the Product Owner, but most of the time whatever new tool or service we proposed, it was implemented. Technically speaking, we were creating the application the way we wanted. My colleagues were amazing, it was the best team that I’ve worked with yet, that was a key ingredient to make it such an amazing experience.</p><p>On that project, I realized that I wanted to continue working on the cloud. When the project was getting close to being released to production I started looking for opportunities at other companies, higher salaries, better benefits, etc. At that moment I didn’t even understand what DevOps was, I just knew that I wanted to continue working on the cloud.</p><p>I was interviewed for a software developer position, I completed the whole process and I felt like I did well, but I didn’t hear back from the company for about a month. I was looking forward to getting that position at that specific company, I was certain I was not going to hear from them again. Then, one day I revied a call from that company asking me if I would be interested in learning DevOps. One of their clients was looking for someone who wanted to get started on DevOps but didn&#39;t have any experience. The client had only one DevOps Engineer that was being overwhelmed with work, but they didn’t want to hire an experienced DevOps Engineer.</p><p>That was my opportunity. I had not planned to move away from software development, but it was a great opportunity that I couldn’t let off. I had an interview with the client, they liked me, and that’s how I started working as a DevOps Engineer, or should I say, that’s how I started learning what DevOps is.</p><h3>DevOps Engineer Experience</h3><p>It is very exciting when starting at a new job, new office, new laptop, new colleagues, new challenges, etc. It is very exciting for me at least. I had done some research about DevOps, what it meant, what it did, how it worked, but still, I didn’t understand at that moment what it was. I was ready to start learning by doing.</p><p>The first tasks that I had, were to create PowerShell scripts to provision infrastructure in Azure. Not the best approach, but I had no idea IaC tools existed at that moment. I started to get familiarized with the Azure portal and PowerShell, something I had never used before.</p><p>For the first 6 months, I was focused on creating provisioning scripts, setting up Azure DevOps pipelines to run the scripts, and using the Azure portal to check the provisioned services. I was trying to wrap my head around VNets, Subnets, NSGs, VMs, RBAC permissions, Azure Active Directory, Build and Release Pipelines, Regions, Availability Zones, Scalability, High Availability, Disaster Recovery, and several other terms. It was very overwhelming.</p><p>Then, I was moved to work as a developer again. The client needed a developer for a project, and it was at the time of the covid-19 pandemic, so there was a lot of uncertainty about the future, they didn’t want to hire a new person. Since I had a full-stack developer background, it was the perfect solution. I worked coding for about 4 months, after repeatedly expressing that I wanted to get back to work in DevOps I was finally moved out of that project. While I was waiting to be moved back to do DevOps work I was preparing and eventually obtained the Azure Administrator Associate Certification from Microsoft.</p><p>Once I finally got assigned a DevOps project, I started with a new client. The client was migrating from AWS to Azure. I was responsible for creating pipelines in Azure DevOps to deploy the applications to Azure services and create the infrastructure, among other things. They were not using any IaC tool, I had some experience with ARM Templates, so I suggested using them. As I was creating the templates for the Azure services, I came across Terraform, I had heard of it but had no experience using it. I did a little research about Terraform and decided to talk to the engineer in charge of the migration effort and convinced him to drop the ARM templates and create all the Azure infrastructure using Terraform, a tool no one in the project had ever used, including myself.</p><p>All the infrastructure was created using Terraform, I had gained very valuable experience with one of the most used DevOps tools. We finished the migration, all the infrastructure and pipelines were working, now it was the client’s responsibility to maintain all that. Working on the migration helped me a lot to get a better feel of real DevOps work.</p><p>After that project finished, at least for me, I had no client to work with. I was converting some AWS CloudFormation templates into Terraform templates for an internal project of the company I was still working for, while they were looking for a new client for me. I also took advantage of having a bit more slack time to prepare for the Microsoft DevOps Engineer Expert Certification.</p><p>About two months passed until I started working with a new client. This time, the client had most of their infrastructure in AWS, and, funny enough, they were migrating some applications they had in Azure to AWS.</p><p>It was a big client, they had several projects and a lot of services in AWS. I had worked a little bit with AWS as a developer, but this was my first time working with AWS as a DevOps Engineer, it was both exciting and a little scary. I felt very comfortable working with Azure at that moment, and now I was going to switch to AWS. I had to start learning how AWS worked, the services that the client used. But at least they also used Azure DevOps, so all that knowledge I gained from the previous projects was going to be handy.</p><p>With this client, I learned Pulumi, something I had never heard about before. It is an IaC tool to build infrastructure using popular coding languages (Python, C#, JS, TS, and Go). However, after a few weeks in a project, they decided to switch to Terraform. So all the work I had done for the project using Pulumi, now had to be re-done using Terraform. The good thing is that now I can add Pulumi to my resume 😅.</p><p>My main responsibilities working with this client were creating Terraform modules and templates for AWS infrastructure and creating and maintaining pipelines in Azure DevOps. Working with this client I gained a lot of experience in AWS. I had the opportunity to work with very talented people that had vast knowledge and experience with AWS, I learned a lot from them.</p><p>That’s my professional experience so far. About two years of experience as a DevOps Engineer, at the moment of writing this article. I still have a lot of technologies to learn, a lot of scenarios to face, and a lot of experience to gain. I look forward to seeing what the future will bring.</p><h3>Final Thoughts</h3><p>There are a few things I want to highlight.</p><p>First, change can be frightening but only when we get out of our comfort zone is when we start making significant progress. This is especially true in the tech industry, where we must constantly update and learn new tools to stay relevant. Don’t let fear nor laziness hold you back.</p><p>Second, good opportunities may come at any time. But it is naive to think that you can sit and wait for the best opportunity to magically appear out of nowhere. If you don’t actively look for them, a better job, better relationships, better anything, it will probably never come.</p><p>Finally, speak your mind. Share what you think about how the project is being handled, what you think can be improved, what you think is working, what you think is not working. Now that Agile is widely used, there are more opportunities to share how you feel about a project, a client, a co-worker, thanks to ceremonies like a sprint retrospective. Feel free to express your thoughts. I hope you work in a healthy environment where your input will be properly considered if that’s not the case then I wish you the best to find a healthier environment to work in.</p><p>This has been my experience working as a Software Developer and then as a DevOps Engineer. Hopefully, this will motivate you to get out of your comfort zone, if you haven’t already, and try something new, professionally or personally. We will never know what opportunities life has for us if we never get out to find them.</p><p>Changing my career path was something that had never crossed my mind at that moment, and now I am very happy I did. Taking that opportunity to start learning DevOps opened a lot of other opportunities that made me be where I am right now, preparing to move to a different country to start a very exciting new job.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d9b56224bc2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/how-i-ended-up-working-on-devops-9d9b56224bc2">How I Ended Up Working on DevOps</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Azure Pipeline Templates]]></title>
            <link>https://medium.com/geekculture/how-to-use-azure-pipeline-templates-f81d7965bda6?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/f81d7965bda6</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Tue, 31 Aug 2021 02:10:31 GMT</pubDate>
            <atom:updated>2021-08-31T14:21:09.108Z</atom:updated>
            <content:encoded><![CDATA[<h4>DevOps Good Practices</h4><h4>Easy guide on how to get started with Azure Pipeline Templates</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OOUkuN3LGbewjG8T" /><figcaption>Photo by <a href="https://unsplash.com/@lunarts?utm_source=medium&amp;utm_medium=referral">Volodymyr Hryshchenko</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There’s always that situation where we need to use the same elements, or code, in several places and we want to avoid copying and pasting those elements everywhere because we like to keep it DRY (Don’t Repeat Yourself). That’s where pipeline templates come in handy when facing this dilemma while working with Azure Pipelines.</p><h3>What are Pipeline Templates?</h3><p>Pipeline templates help us define reusable blocks that can be used across as many pipelines as we need, making maintenance easier and less prone to errors.</p><p>We can define individual steps, jobs with several steps, and stages with several jobs in pipeline templates. Variables and parameters can also be specified.</p><p>Pipeline templates are only available for YAML pipelines, so it makes sense that the templates are also defined as YAML files. Classic pipelines have task groups, but they are more limited in functionality.</p><h3>Pipeline Template Structure</h3><p>As mentioned above, we can define parameters, variables, steps, jobs, and stages in our templates. Here we’ll see in more detail each of those elements.</p><h4>Parameters</h4><p>Parameters help us pass values from the main pipeline to our template. Parameters must be defined with a name and a type, a default value is optional. For parameters of data types string and number, we can optionally specify the allowed values that it will accept.</p><pre>parameters:<br>- name: myParam<br>  type: number<br>  default: 9<br>  values:<br>  - 3<br>  - 6<br>  - 9</pre><p>To use the parameter value in the template we use the following expression “<em>${{ parameters.&lt;parameter name&gt; }}</em>”. For example, to use the parameter we just defined we’d do it like this:</p><pre>${{ parameters.myParam }}</pre><h4>Variables</h4><p>We cannot define variables in a template where we will use steps, jobs, or stages. Variables in a pipeline template are used similarly as we would use a variable group. We can define a template with several variables and use that template in several pipelines to have access to those variables. For example:</p><pre>variables:<br>  myVarEng: &quot;Hello World!&quot;<br>  myVarEsp: &quot;Hola Mundo!&quot;</pre><p>That’s all we need to define in the template file. Then to use it in a pipeline we call it this way:</p><pre>variables:<br>- template: template-vars.yml # Name of the template file</pre><pre>steps:<br>- script: echo ${{ variables.myVarEng }}<br>- script: echo ${{ variables.myVarEsp }}</pre><p>This is a good option to share variables around different pipelines, but I would only recommend it if for some reason it is required for those variables to be stored in a repository. If that’s not the case, then a variable group would be a better implementation.</p><p>When a more secure implementation is necessary to share variables between pipelines; Azure Key Vault secrets and variables groups are a great option. Check out this post.</p><p><a href="https://medium.com/geekculture/how-to-use-key-vault-secrets-in-azure-pipelines-658198f2eea6">How to Use Key Vault Secrets in Azure Pipelines</a></p><h4>Steps</h4><p>We can create a template to reuse one or more steps in a job of a pipeline. Simply define the steps in the template as we would do in a YAML pipeline. Using a pipeline template this way is very similar to using task groups in classic pipelines.</p><pre>steps:<br>- script: echo &quot;First very useful step&quot;<br>- script: echo &quot;Second equally useful step&quot;</pre><p>Then, in the pipeline, we have to define a job and reference the template to use the steps.</p><pre>jobs:<br>- job: Linux<br>  pool:<br>    vmImage: &#39;ubuntu-20.04&#39;<br>  steps:<br>  - template: template-steps.yml # Name of the template file</pre><h4>Jobs</h4><p>Pipeline templates also give us the ability to define jobs. Again, we define the jobs the same way we would in a YAML pipeline.</p><pre>jobs:<br>- job: Ubuntu<br>  pool:<br>    vmImage: &#39;ubuntu-20.04&#39;<br>  steps:<br>  - script: echo &quot;Hello World from Ubuntu!&quot;</pre><pre>- job: Windows<br>  pool:<br>    vmImage: &#39;windows-latest&#39;<br>  steps:<br>  - powershell: echo &quot;Hello World from Windows!&quot;</pre><p>Using the template in a pipeline is very easy.</p><pre>jobs:<br>- template: template-jobs.yml # Name of the template file</pre><p>One thing to keep in mind when using templates that contain jobs is that job names must be unique within a pipeline. So if a template is used more than once in the same pipeline and the jobs in the template have a name, the pipeline will show an error that job names can only appear once. The easiest solution is to remove the name of the jobs in the template, names are not required.</p><h4>Stages</h4><p>The same principle applies to stages. We can define one or several stages in our template just like we would in a YAML pipeline.</p><pre>stages:<br>- stage: MyCoolStage<br>  jobs:<br>  - job: MyCoolJob<br>    pool:<br>      vmImage: &#39;ubuntu-20.04&#39;<br>    steps:<br>    - script: echo &quot;Hello World!&quot;</pre><p>Using the stages template is basically the same implementation used with the jobs template.</p><pre>stages:<br>- template: template-stages.yml # Name of the template file</pre><p>More stages and jobs can be added before and after the template reference in the pipeline.</p><pre>stages:<br>- stage:<br>  jobs:<br>  - job: MyCoolJob<br>    pool:<br>      vmImage: &#39;ubuntu-20.04&#39;<br>    steps:<br>    - script: echo &quot;Hello World!&quot;</pre><pre>- template: template-stages.yml # Name of the template file</pre><h3>Example Scenario</h3><p>Now let’s see an example scenario where pipeline templates are useful. We have three containerized applications with Docker, we need to create a pipeline for each app, they have their own repo. The build pipeline for the three apps needs to do the same thing; build the Docker image and push it to an ECR (Elastic Container Registry) repo in AWS with two tags: latest and a unique value to identify that specific image.</p><p>Without a pipeline template, we would have to add the required tasks in each of the pipelines. That means repeating the same process three times. Plus, if a change has to be done in the future, there are three different places where we would have to apply the changes.</p><p>The pipeline template for this scenario looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/938771238870fa9d5696d25db661a7be/href">https://medium.com/media/938771238870fa9d5696d25db661a7be/href</a></iframe><p>The template receives three parameters that are used by the tasks. We are only using steps, the job for the template will be defined in the pipeline itself.</p><p>The first step builds the Docker image with two tags: “<em>latest</em>” and the latest commit id from which the pipeline was triggered (learn more about predefined variables <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&amp;tabs=yaml">here</a>).</p><p>The second and third steps push the image to the same ECR repository using different tags. That’s the way the “<em>ECRPushImage@1</em>” task works, it can only push one tag at a time. It won’t create two images in the ECR repo, it will be only the one image with the two tags we specified.</p><p>Now we can use the pipeline template in our three pipelines, and if we have to make any update to how we build or push the image, we only have to update the template. We won’t even need to touch the pipelines unless there’s a change that affects the parameters.</p><p>The pipeline looks the same for the three apps, so here is how we use the template in the app-one pipeline:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/804e2be70816b9aacfaf133b65f4a909/href">https://medium.com/media/804e2be70816b9aacfaf133b65f4a909/href</a></iframe><p>We have to specify a repository resource because for this scenario we have our pipeline template in a different repository in Azure DevOps. So we have to specify where we are getting the template file from. When referencing it in the pipeline, we have to do it like this “<em>docker-ecr-pipeline-template.yml@templates</em>”, use the name of the file and the repository resource name.</p><p>Notice how we are not specifying the “<em>ecrRegion</em>” parameter, since we defined a default value for it we can ignore it when referencing the template, and it will use that default value.</p><p>This is an adaptation of a real implementation for a project. There are some details about the push to ECR task that are out of the scope of this post, but to learn more about it check out the <a href="https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-vsts-tools">AWS Toolkit for Azure DevOps</a>.</p><h3>Final Thoughts</h3><p>Pipeline templates are very helpful to keep our pipelines clean, organized, maintainable, and flexible. Using a template is very straightforward, it’s almost the same as a regular pipeline, but defining some parts in a different reusable file.</p><p>Whenever we might need to use a specific set of tasks in more than one pipeline, we should use a pipeline template.</p><p>This was an introduction to how to use pipeline templates. Please check <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops">the official Microsoft documentation about Azure pipeline templates</a> to learn more about them. There we can find out more about all the available parameter data types, template expressions, limits, and other very interesting details.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f81d7965bda6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/how-to-use-azure-pipeline-templates-f81d7965bda6">How to Use Azure Pipeline Templates</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shifting-Left Security in Azure Pipelines]]></title>
            <link>https://medium.com/geekculture/shifting-left-security-in-azure-pipelines-5d11a469ab11?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d11a469ab11</guid>
            <category><![CDATA[shiftleft]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Sun, 11 Jul 2021 13:49:19 GMT</pubDate>
            <atom:updated>2021-07-12T11:32:18.847Z</atom:updated>
            <content:encoded><![CDATA[<h4>DEVOPS GOOD PRACTICES</h4><h4>Tools for Azure Pipelines to have a more secure development process</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8zDssqFrWcDzfDKS" /><figcaption>Photo by <a href="https://unsplash.com/@lianhao?utm_source=medium&amp;utm_medium=referral">Lianhao Qu</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Shifting-left security is applying security validations to our software development process as soon as possible. Let’s say we have a development process with different steps that run from left to right consecutively. Those steps are: writing the code, creating a build, releasing it to a QA environment, releasing it to a Stage environment, releasing it to the production environment to be consumed by the end-users, and constantly monitoring the app, and the process repeats indefinitely. That’s a common and simple development cycle.</p><p>Checking the security of the app was usually done too far to the right of the development process, on the QA environment in the best cases, or when the app was already released to production, or just not at all. Finding security issues too late can be very costly for our app.</p><p>With shifting-left security what we want to achieve is to identify security issues as soon as possible. When creating a build and even while the developers are writing the code.</p><p>This post shows which tools can be used to shift-left security and how to do it using Azure Pipelines.</p><h3>Azure Pipeline Tools</h3><h4>Static Code Analysis</h4><p>Doing this type of analysis will help us detect common bugs, vulnerabilities, and code-smells in the app’s code at the moment of building the app.</p><p>One of the most common tools for static code analysis is called <a href="https://www.sonarqube.org/">SonarQube</a> (<a href="https://sonarcloud.io/">SonarCloud</a> for cloud-based code, more about the difference <a href="https://blog.sonarsource.com/sq-sc_guidance">here</a>), it has an Azure DevOps extension to easily analyze code in Azure Pipelines.</p><p>Other static code analyzers can be used with Azure Pipelines as well, like <a href="https://www.microfocus.com/en-us/cyberres/application-security">Fortify</a>, <a href="https://pmd.github.io/">PMD</a>, <a href="http://findbugs.sourceforge.net/">FindBugs</a>, <a href="https://codedx.com/">Code Dx</a>, and several others.</p><h4>Open-Source Management Solutions</h4><p>Checking the security of our open-source components is essential to make sure our app is truly secure. Using open-source components that have security vulnerabilities will make our app vulnerable as well.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=whitesource.ws-bolt">WhiteSource Bolt</a> is a good option to easily implement in Azure Pipelines to check for vulnerabilities in open-source components, and it also checks <a href="https://www.synopsys.com/blogs/software-security/top-open-source-licenses/">license risks</a>. It is very easy to implement and it’s free to use, although it is a limited version of the WhiteSource complete solution, it works pretty well.</p><p>There are other great tools to make security checks of open-source components, such as <a href="https://snyk.io/product/open-source-security-management/">Snyk</a> and<a href="https://www.synopsys.com/software-integrity/open-source-software-audit.html"> Black Duck</a>. These tools also have Azure DevOps extensions to be easily implemented in Azure Pipelines.</p><h4>Variable Groups and Key Vault Secrets</h4><p>Keeping sensitive information away from everyone’s eyes is another good practice to enforce security in the development cycle. We want sensitive information to be accessed and managed only by the chosen few and our pipeline.</p><p>To achieve this we can store our sensitive information, which needs to be accessed by the pipeline, as Key Vault secrets in Azure, and then read the secret values from Azure Pipelines using variable groups linked to the Key Vault. There are other ways to access Key Vault secrets from a pipeline, but this is the most effective one most of the time, it all depends on our needs.</p><h3>Azure Pipeline Example</h3><p>In this example, we’ll see how to implement SonarCloud and WhiteSource Bolt in a pipeline to analyze our app’s code and open-source components when building.</p><blockquote>Check out these two posts about how to install and implement SonarCloud in an Azure Pipeline and how to use Azure Key Vault secrets in Azure Pipelines.</blockquote><ul><li><a href="https://medium.com/geekculture/setting-up-sonarcloud-forazure-pipelines-3ab83eee0e79">Setting Up SonarCloud forAzure Pipelines</a></li><li><a href="https://medium.com/geekculture/how-to-use-key-vault-secrets-in-azure-pipelines-658198f2eea6">How to Use Key Vault Secrets in Azure Pipelines</a></li></ul><p>To use WhiteSource Bolt in our pipeline we simply install the extension to our organization and that’s it, we can start analyzing our project’s open-source dependencies.</p><p>Once we have our extensions installed we can start using them in our pipeline.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7dd8187c95087114378be5c3353f830/href">https://medium.com/media/e7dd8187c95087114378be5c3353f830/href</a></iframe><p>For the WhiteSource Bolt task, we must specify the directory where the libraries we want to analyze are located. We also define a name for the project that will be created in WhiteSource. In the example above, the open-source dependencies we want to analyze are located in “<em>$(System.DefaultWorkingDirectory)/src</em>”. It’s important to note that the WhiteSource Bolt task must be added after building those dependencies, in this case after doing “<em>npm install</em>”.</p><p>The Sonar Cloud tasks do the following; first, we indicate which SonarCloud project we are going to analyze. Then, after building the project, we run the SonarCloud analysis. Finally, we publish the results of the analysis to make them visible in Azure DevOps, this last step is optional, the results can always be seen in the SonarCloud portal.</p><h3>Additional Ways to Shift Security Left</h3><p>SonarCloud has a VS Code extension called SonarLint to help developers check their code as soon as they write it. Using a linter is a great option to add more security and code quality verifications to a development process.</p><p>When working with docker container registries, such as Azure Container Registry (ACR), they usually have options to analyze and update images. ACR tasks can be used to automatically build images when a base image is updated, more about ACR tasks <a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-tasks-base-images"><strong>here</strong></a>. Additionally, Azure Defender can be enabled in ACR to analyze every pushed image, more about it <a href="https://docs.microsoft.com/en-us/azure/security-center/defender-for-container-registries-introduction"><strong>here</strong></a>.</p><p>If you know other ways to shift security left that are not mentioned here, feel free to share them in a comment.</p><h3>Final Thoughts</h3><p>We are all humans, no one is perfect. Because of this, we need to identify and fix vulnerabilities in our projects as soon as we can. Shifting security left helps us achieve this with our code and our open-source dependencies.</p><p>Shifting-left security is a good way to start improving our development process. However, this is not the ultimate solution to all our security issues. Having an effective testing strategy, using penetration testing tools like <a href="https://www.zaproxy.org/">OWASP Zap</a>, following the least-privilege principle, constantly monitoring an app’s health and behavior, as well as the overall network and infrastructure’s health and state, all these things, and even more, must be taken into consideration when thinking about security</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d11a469ab11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/shifting-left-security-in-azure-pipelines-5d11a469ab11">Shifting-Left Security in Azure Pipelines</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Key Vault Secrets in Azure Pipelines]]></title>
            <link>https://medium.com/geekculture/how-to-use-key-vault-secrets-in-azure-pipelines-658198f2eea6?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/658198f2eea6</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[secrets]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-key-vault]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Mon, 14 Jun 2021 04:13:31 GMT</pubDate>
            <atom:updated>2021-06-14T06:35:27.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>DevOps Good Practices</h4><h4>Different ways to access Key Vault secrets in Azure Pipelines.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z9Qeq6pBuLQeYubA" /><figcaption>Photo by <a href="https://unsplash.com/@tinaflour?utm_source=medium&amp;utm_medium=referral">Kristina Flour</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Using Key Vault secrets to store sensitive data is essential to keep it safe. By using secrets we can control who has access to see and manipulate the data stored in them, making sure only the correct people have the appropriate level of access.</p><p>It is very common to have a pipeline that needs a key, a password, a connection string, or any other type of data that can be considered sensitive and we don’t want anyone seeing or manipulating its value. For these scenarios, most of the time the best solution is to use Key Vault secrets.</p><p>There are several different ways to access Key Vault secrets from an Azure Pipeline. This post will cover the two most common ones, using a variable group and using the Key Vault task. Another way of accessing secrets from the pipeline is by using the Azure CLI, but doing it this way is over-complicating the implementation when there are easier ways like the two mentioned above.</p><h4>Prerequisite</h4><p>Before creating a variable group or using the Key Vault task, we must configure an access policy in our Key Vault to allow the service connection to have get and list access to the secrets. To achieve this, we will need the service principal display name or application id. To get those values we can go to “P<em>roject settings”</em> in Azure DevOps, then click on “<em>Service connections</em>”, select the service connection that will be used by the variable group, and then click on “<em>Manage Service Principal</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SV9Gbvrju8bER08oeim4ig.png" /><figcaption>See service principal info.</figcaption></figure><p>That will takes us to Azure Active Directory, where we’ll be able to see all the information related to the service principal. There we can copy the display name or the application id, either of them will work to create the access policy in the Key Vault.</p><p>Now we must go to our Key Vault to create a new access policy. For this access policy, we only need the get and list permissions for secrets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mcywVPx8idmX_SXUWtlx4A.png" /><figcaption>Get and list secret permissions.</figcaption></figure><p>Now we must select the service principal that we are going to apply this policy to. In this example, we copied the display name of the service principal, we’ll use it to search for it, select it, and add it to the access policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUJ-tAU24fijk2IRxdmzeQ.png" /><figcaption>Add service principal to the access policy.</figcaption></figure><p><strong>Important, </strong>always make sure to save any change made to the “<em>Access policies</em>” section of a Key Vault, Azure even shows us an alert message to make sure we save our changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9pkrqra6yIqWixo35NYTZw.png" /><figcaption>Save access policy changes.</figcaption></figure><p>Now that we have provided access to get and list secrets from the Key Vault to our service principal we can implement the two methods to get secrets from a pipeline.</p><h4>Azure DevOps Variable Groups</h4><p>Variable groups are useful when we have several variables that are used across different pipelines. Instead of defining the same variable over and over again in each pipeline, simply add it to a variable group and link that group to the pipelines where the variable needs to be used.</p><p>To create a variable group we have to go to Azure DevOps, under “<em>Pipelines</em>” click on “<em>Library</em>”, and then “<em>+ Variable group</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vmr2ONrucLupSk9B4f7cEw.png" /><figcaption>Create a new variable group, part 1.</figcaption></figure><p>When creating a new variable group we must define a name, the description is optional, and toggle the option to link secrets from Key Vault. By toggling that option we’ll see two drop-down menus to select our service connection and Key Vault, we’ll choose the correct values we want to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRxkKVe1u2TrcU7GKkqJQA.png" /><figcaption>Create a new variable group, part 2.</figcaption></figure><p>When the Key Vault has been selected, we’ll see a new section appear called “<em>Variables</em>”, here we can choose exactly which secrets we want to add to the variable group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYGlmp36w61AQxTdmmORuQ.png" /><figcaption>Create a new variable group, part 3.</figcaption></figure><p>We only have one secret in our Key Vault, so we’ll select it and click on “<em>Ok</em>”. After choosing the secrets to add to the variable group we can save our changes and start using our new variable group in our pipelines.</p><p>First, let’s see how to access a variable group from a YAML pipeline. It is very simple, all we need to do is to call the group by its name in the variables section.</p><pre>variables:<br>    - group: &quot;Var Group 01&quot;</pre><p>To get the secret value, use it as a regular pipeline variable.</p><pre>$(my-first-secret)</pre><p>If we needed to have other variables in our pipeline, we can define them in the same variables section.</p><pre>variables:<br>    - group: &quot;Var Group 01&quot;<br>    - name: my-pipeline-var<br>      value: &quot;This is my pipeline variable&quot;</pre><p>Finally, using a variable group in release pipelines. For this, we need to go to the “<em>Variables</em>” section of our pipeline, select “<em>Variable groups</em>”, and “<em>Link variable group</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDhlq7g8JlWxcm4_mOtToQ.png" /><figcaption>Use variable group in a release pipeline, part 1.</figcaption></figure><p>Then we select the variable group that we want to link to our pipeline and set the scope for that variable group. The scope can be the whole release or, it can be specific to only certain stages. For simplicity, we’ll select the release as the scope. And click on “<em>Link</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHHKH5jp-FuqglKSCU30SQ.png" /><figcaption>Use variable group in a release pipeline, part 2.</figcaption></figure><p>Now we can access the secret by using it as a pipeline variable, within the scope defined for the variable group.</p><h4>Azure Pipeline Key Vault Task</h4><p>Azure pipelines have a task called “<a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-key-vault?view=azure-devops"><em>Azure Key Vault</em></a>” that can be used to download secrets and use them as pipeline variables. After setting up this task, all the following tasks will have access to the downloaded secrets.</p><p>Using this pipeline task is quite simple, in the pipeline assistant look for a task called “<em>Azure Key Vault</em>” and click on it. We must select the service connection we want to use and the Key Vault from where we must read the secrets. There is a task parameter called “<em>Secrets filter</em>”, with this parameter we can specify exactly which secrets, separated by a comma, we want to download from the Key Vault. We can also use “*” to get all the secrets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*OJapn21eni6EQWeuY1xXmQ.png" /><figcaption>Azure Key Vault pipeline task.</figcaption></figure><p>The option to “<em>Make secrets available to whole job</em>” makes the secrets downloaded using this task available to all the other tasks in the job, no matter their position. By default, only the tasks defined after this task will be able to use the downloaded secrets. Also, only tasks within the same job will be able to access the secret.</p><p>The task setup is the same for YAML and release pipelines. Accessing the secret is done the same way in both types of pipelines. It can be accessed as a pipeline variable.</p><pre>$(my-first-secert)</pre><p>This is what the task looks like in a YAML pipeline.</p><pre>- task: AzureKeyVault@2<br>  inputs:<br>    azureSubscription: &#39;personal-projects (...)&#39;<br>    KeyVaultName: &#39;kv-demotest-001&#39;<br>    SecretsFilter: &#39;*&#39;<br>    RunAsPreJob: false</pre><h4>Final Thoughts</h4><p>It’s essential to always avoid storing sensitive data as plain text in a variable which we can’t control who access its value. That’s why Key Vaults are a great tool to store sensitive data, and variable groups and the Key Vault pipeline task are the best methods to use secrets in a pipeline.</p><p>Choosing between one method or the other is going to depend on our needs. There is no good or wrong implementation, simply understand as clearly as possible what the needs are and use the method that best fits those needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=658198f2eea6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/how-to-use-key-vault-secrets-in-azure-pipelines-658198f2eea6">How to Use Key Vault Secrets in Azure Pipelines</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up SonarCloud forAzure Pipelines]]></title>
            <link>https://medium.com/geekculture/setting-up-sonarcloud-forazure-pipelines-3ab83eee0e79?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ab83eee0e79</guid>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[sonarcloud]]></category>
            <category><![CDATA[static-code-analysis]]></category>
            <category><![CDATA[azure-devops]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Thu, 27 May 2021 23:48:01 GMT</pubDate>
            <atom:updated>2021-07-09T02:35:43.440Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setting Up SonarCloud for Azure Pipelines</h3><h4>A detailed guide with screenshots.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bkCIl450lsqGmIff" /><figcaption>Photo by <a href="https://unsplash.com/@dianamia?utm_source=medium&amp;utm_medium=referral">C Dustin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Static code analysis is very useful to detect security issues and bad code practices in our projects. <a href="https://sonarcloud.io/?gads_campaign=South-America-SonarClouds&amp;gads_ad_group=SonarCloud&amp;gads_keyword=sonarcloud&amp;gclid=CjwKCAjw47eFBhA9EiwAy8kzNIRca483WDVlEpUJNI__uG2WgPI1p1AlOrQICVLhQ_X6q3vcae6R0BoCY74QAvD_BwE">SonarCloud</a> is a great static code analysis tool that can be easily integrated into Azure DevOps. It can be used for free in public Azure DevOps projects.</p><p>Without further ado, let’s get started.</p><p>Assuming we already have an Azure DevOps organization and a SonarCloud account, the first step is to associate our Azure DevOps organization with SonarCloud. For this, we need to create a Personal Access Token (PAT) in Azure DevOps.</p><p>Click on the user settings icon on the top right corner in Azure DevOps, then “<em>Personal access tokens</em>”. That will take us to a page where we can see an option to create a token. Clicking on “<em>New Token</em>” will show us a form we need to fill out to generate a new PAT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*geJyyIkOYA5QUd1S8I3vCg.png" /><figcaption>Create a Personal Access Token in Azure DevOps, part 1.</figcaption></figure><p>We must set a name for it, the organization it belongs to, an expiration date, and for SonarCloud we only need the “<em>Code (Read &amp; Write)</em>” permissions, always keep in mind the principle of least privilege when giving permissions for anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w45GU-8SW5OeePJ2ytYZ0A.png" /><figcaption>Create a Personal Access Token in Azure DevOps, part 2.</figcaption></figure><p>After clicking on “<em>Create</em>” we’ll see the actual token, this is the only time we will be able to see the token, make sure to copy it and save it in a safe place.</p><p>Now that we have a PAT, it’s time to start setting things up in SonarCloud.</p><p>In the SonarCloud portal click on the plus icon on the top right corner, then click on “<em>Create new organization</em>”. This will show us the required steps to associate our Azure DevOps organization.</p><p>We simply have to follow the steps that SonarCloud displays. Set the organization name as it is in Azure DevOps, paste the PAT we created, and click on “<em>Continue</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TrpLYtmBz-iOMDzm0W8rIw.png" /><figcaption>Add an Azure DevOps organization to SonarCloud, part 1.</figcaption></figure><p>Now we set a key to identify our organization, it can be anything. We’ll use the organization name and click on “<em>Continue</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pdgvCKIUcHAlY6gTY3GRCQ.png" /><figcaption>Add an Azure DevOps organization to SonarCloud, part 2.</figcaption></figure><p>We have to choose a plan. We’ll choose the free plan since we have a public project in Azure DevOps, and click on “<em>Create Organization</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZHmliACCwlBGnUU9P1Trw.png" /><figcaption>Add an Azure DevOps organization to SonarCloud, part 3.</figcaption></figure><p>Now that our Azure DevOps organization is associated with SonarCloud we can set up a project. Click one more time in the plus icon on the top right corner of the SonarCloud portal. Now click on “<em>Analyze new project</em>”, since we only have one organization it will be selected by default, but if we had more organizations we could choose between them. A list of all the projects that we have available in the organization will be displayed, we’ll select the project that was want to analyze and click on “<em>Set Up</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2J_BLehsufWIh282dLxVg.png" /><figcaption>Create a new project in SonarCloud.</figcaption></figure><p>Great, we have our Azure DevOps organization associated with our SonarCloud account 🎉. There are still a few more things to do before we can use SonarCloud in our pipelines. We must install the SonarCloud extension for Azure DevOps, create a service connection, and then we’ll be able to add the SonarCloud tasks to our pipelines.</p><p>Installing an extension is very simple if we have the correct permissions, if we don’t then we can submit a request for the Azure DevOps organization administrator to install it for us. Either way, we must go to the Visual Studio Marketplace, look for the <a href="https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud">SonarCloud extension</a> and click on “<em>Get it free</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DeW0Ps45UJtxSTGNYPjieA.png" /><figcaption>SonarClour extension for Azure DevOps.</figcaption></figure><p>Then select the organization where we want to install the extension and click on “<em>Install</em>”. If we didn’t have enough permissions to install the extension ourselves, here we would see a textbox to input a message to request to the organization admin to install it for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPrHcvNExDOu0QP5TeJ82A.png" /><figcaption>Install SonarCloud extension for Azure DevOps.</figcaption></figure><p>That’s it, now we have the SonarCloud extension installed.</p><p>In SonarCloud we created a project that has not been configured yet. Since we want to analyze our code from Azure Pipelines, we’ll choose “<em>With Azure DevOps Pipelines</em>” as the analysis method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQy3Uw1SA1FoM_jzr_pmFQ.png" /><figcaption>Configuring the project in SonarCloud, part 1.</figcaption></figure><p>This will tell us that we have to install the extension, which we have already installed. It will also automatically create a “<em>User Token</em>” that we’ll use to create a service connection in Azure DevOps. Finally, it will show us how to set up the pipeline tasks according to the language that we use in our project. In this case, we’ll analyze a JavaScript app, so we’ll select the option “<em>Other</em>”. It will also show additional information at the bottom for more configurations that can be implemented with SonarCloud in Azure Pipelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoGM-4TFu3Ag7juWb5RGHg.png" /><figcaption>Configuring the project in SonarCloud, part 2.</figcaption></figure><p>For us to be able to add the SonarCloud tasks to our pipelines, we must create a service connection. In Azure DevOps, we must go to our project settings, select “<em>Service connections</em>” and we need to create a new service connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K02GKUY0A2k2UDwRDzOYbw.png" /><figcaption>Create a Service Connection in Azure DevOps, part 1.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*yeMDF9I97F2Lw8jRegov5g.png" /><figcaption>Create a Service Connection in Azure DevOps, part 2.</figcaption></figure><p>We have to select the service connection type we want to create, we’ll select “<em>SonarCloud</em>” and click on “<em>Next</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*41MNHG3LBlWNh_d-evP_9A.png" /><figcaption>Configuring the project in SonarCloud, part 1.</figcaption></figure><p>Here we’ll need the user token that was created for us in SonarCloud a moment ago while configuring the project. We’ll paste that token here and verify that it works, we have to enter a name for the service connection and save it. We have the option to grant access permissions for all the pipelines or choose only some specific pipelines, we’ll grant access to all the pipelines for this example.</p><p>Now that we have a valid service connection we can start implementing SonarCloud in our pipelines.</p><p>To use the SonarCloud tasks in our pipeline we’ll follow the instructions provided when configuring the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zWwUfOBDv-lx7JzrGLk5Sw.png" /><figcaption>Steps to run SonarCloud analysis from an Azure Pipeline.</figcaption></figure><p>In Azure DevOps, we’ll edit our build pipeline to include those tasks. This is what our pipeline looks like without the SonarCloud tasks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XE7J9gRZ3wHkS_AQkYGDKA.png" /><figcaption>Azure Pipeline without SonarCloud tasks.</figcaption></figure><p>This is how our pipeline looks like after following the steps to add the SonarCloud tasks:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4098befa8f6b2b6ca45c42f5a78b6ca/href">https://medium.com/media/f4098befa8f6b2b6ca45c42f5a78b6ca/href</a></iframe><p>The “<em>SonarCloudPublish</em>” task is not required, but it allows us to decorate pull requests with information from the analysis.</p><p>Now we are good to go, that’s all we need to do to analyze our code with SonarCloud in our Azure Pipeline.</p><h4>Side Note</h4><p>Public projects in Azure DevOps will no longer have free access to use Microsoft-hosted agents to run the pipelines, starting on February 18th, 2021. This is due to the abusive use of the service using it for crypto mining, and other things, to know more about this check out the official statement <a href="https://devblogs.microsoft.com/devops/change-in-azure-pipelines-grant-for-public-projects/">here</a>.</p><p>We can fill out the form to try to get access to a hosted agent for our public project or set up a self-hosted agent, but that’s out of the scope of this post. The goal of this post is to show how to set up SonarCloud to work with Azure Pipeline.</p><h4>Final Thoughts</h4><p>Setting up SonarCloud to work with Azure Pipelines is a straightforward process. However, if this is the first time doing it, then it is easy to get a little lost trying to find the next step. SonarCloud does a great job telling us the steps to follow to configure our project, but it doesn&#39;t cover all the details.</p><p>Using static code analysis tools such as SonarCloud can make a big difference in our code’s quality and security, we must try to run this type of analysis in all of our projects. SonarCloud has a Visual Studio Code extension called <a href="https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarlint-vscode">SonarLint</a> that will help improving code even before committing it.</p><p>Hopefully, this post has helped you make your day a little bit easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ab83eee0e79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/setting-up-sonarcloud-forazure-pipelines-3ab83eee0e79">Setting Up SonarCloud forAzure Pipelines</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Sync Terraform State with Existing Azure Infrastructure Using the Terraform Import Command]]></title>
            <link>https://medium.com/codex/how-to-sync-terraform-state-with-existing-azure-infrastructure-using-the-terraform-import-command-937e1a90c916?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/937e1a90c916</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[cloud-infrastructure]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Thu, 15 Apr 2021 00:50:44 GMT</pubDate>
            <atom:updated>2021-05-30T20:32:54.748Z</atom:updated>
            <content:encoded><![CDATA[<h4>A detailed guide with two real-life examples.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5PJ3ic6XzW1lKPhq" /><figcaption>Photo by <a href="https://unsplash.com/@shawnanggg?utm_source=medium&amp;utm_medium=referral">Shawn Ang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are reading this post, you probably are in a situation where you have to use Terraform to manage your cloud infrastructure. But there are existing resources, not created using Terraform, that need to be managed by it.</p><p>I will show you how to sync your Terraform state with existing resources in Azure specifically. However, the steps to achieve this are virtually the same for other cloud providers.</p><p>To sync our Terraform state we’ll be using the terraform import command. This command allows us to bring under Terraform management resources that already exist or were created by other means. There is one important thing to know about the usage of this command:</p><blockquote>The current implementation of Terraform import can only import resources into the <a href="https://www.terraform.io/docs/language/state/index.html">state</a>. It does not generate configuration. A future version of Terraform will also generate configuration.</blockquote><blockquote>Because of this, prior to running terraform import it is necessary to write manually a resource configuration block for the resource, to which the imported object will be mapped.</blockquote><blockquote>— Terraform’s Documentation</blockquote><p>To implement terraform import we have to add the code in our Terraform file for the resource we want to import, then we can run the command. Here we have a simple example of the command:</p><pre>$ terraform import azurerm_resource_group.default &lt;fully qualified resource group id&gt;</pre><p>In that example, we are importing a resource group into our Terraform state. First, we specify the resource name that the Terraform Azure provider uses for resource groups, followed by the name that we’ll use in Terraform to identify the resource group. In this case, we called it default. Finally, we must include the fully qualified resource group id, the one that looks like this “/subscriptions/&lt;subscription id&gt;/resourceGroup/&lt;resource group name&gt;”.</p><h3>Examples</h3><p>I’ll show you two examples of how to import a resource into our Terraform state. One example will be a virtual machine, and the other one a key vault with a secret.</p><h4>Virtual Machine</h4><p>Remember that before executing the import command, we have to create the code for the resources we need. For this example, we will need a resource group, a virtual network with a subnet, a network security group, a network interface, and the virtual machine. We’ll assume that the resource group, virtual network, and subnet already exist in the Terraform state, so we don’t need to import those resources.</p><p>Our Terraform file to create the resources we need looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/679a3b833a067dd66a15331d25482b0b/href">https://medium.com/media/679a3b833a067dd66a15331d25482b0b/href</a></iframe><p>Now that we have the resources defined in our file, we can import them to our state. We will skip the initialization of Terraform, and we’ll see how to use the import command.</p><p>Let’s import the resources in the order they are in the file. Verify that the resource names are the same in the file as they are in the existing resource.</p><p><em>Network Security Group</em></p><pre>$ terraform import azurerm_network_security_group.nsg_ssh_allow /subscription/&lt;subscription id&gt;/resourceGroup/&lt;resource group name&gt;/providers/Microsoft.Network/networkSecurityGroups/nsg-allow-ssh</pre><p><em>Network Interface</em></p><pre>$ terraform import azurerm_network_interface.nic /subscription/&lt;subscription id&gt;/resourceGroup/&lt;resource group name&gt;/providers/Microsoft.Network/networkInterfaces/nic-test-001</pre><p><em>Network Interface and Network Security Group Association</em></p><pre>$ terraform import azurerm_network_interface_security_group_association.nsg_nic_association &#39;/subscription/&lt;subscription id&gt;/resourceGroup/&lt;resource group name&gt;/providers/Microsoft.Network/networkInterfaces/nic-test-001|/subscription/&lt;subscription id&gt;/resourceGroup/&lt;resource group name&gt;/providers/Microsoft.Network/networkSecurityGroups/nsg-allow-ssh&#39;</pre><p>Notice how the ids are separated by “|” and are enclosed by single quotes.</p><p><em>Virtual Machine</em></p><pre>$ terraform import azurerm_virtual_machine.test_vm /subscription/&lt;subscription id&gt;/resourceGroup/&lt;resource group name&gt;/providers/Microsoft.Compute/virtualMachines/vm-test</pre><p>Now that we have imported all the resources, we can run the terraform show command to check that they are in the Terraform state.</p><h4>Key Vault</h4><p>Now, let’s see another example. This time we’ll create a key vault with an access policy and one secret. The Terraform code looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cc80335b40559dba88c6521a10e4cb4/href">https://medium.com/media/5cc80335b40559dba88c6521a10e4cb4/href</a></iframe><p>There are a few things to notice on the previous GitHub gist. We are creating an access policy for the user applying the changes, we can do that inside the azurerm_key_vault Terraform resource, or we can create it as a separate resource using azurerm_key_vault_access_policy . That access policy gives all the permissions available to the specified user. However, the correct implementation would be to grant access only to what is needed.</p><p>One more thing to notice is how we are using a data source to obtain the tenant and object id of the current Azure CLI session when the Terraform templates are applied. It is an easy data source to call, just add data &quot;azurerm_client_config&quot; &quot;current&quot; {} to the .tf file and that’s it.</p><p>The last step to import our key vault with an access policy and one secret is to run the Terraform commands:</p><p><em>Key Vault (Access Policy Included)</em></p><pre>terraform import azurerm_key_vault.main /subscriptions/&lt;subscription id&gt;/resourceGroups/&lt;resource group name&gt;/providers/Microsoft.KeyVault/vaults/kv-myvault-001</pre><p><em>Key Vault Secret</em></p><pre>terraform import azurerm_key_vault_secret.my_secret <a href="https://kv-augmentor-prod.vault.azure.net/secrets/coturnVmAdminPassword/c7eabaa0a4544338bb2a778d03c1811d">https://kv-myvault-001.vault.azure.net/secrets/MySecretName/</a>&lt;secret version&gt;</pre><p>As you just noticed, for key vault secrets we don’t have a fully qualified resource id. We must use a “Secret Identifier”, and we can find it on the key vault secret details page in the Azure portal.</p><h3>Conclusion</h3><p>Knowing how to use the terraform import command properly is essential when working with Terraform since having existing infrastructure that needs to be managed by it is a common scenario.</p><p>Overall, using terraform import is very straightforward. However, there are some details to be aware of, I didn’t cover all of them in this post, but I tried to include some of the most common ones. For instance, when importing a virtual machine it’s important to remember and know how to import the NIC and NSG association. Likewise, when importing a key vault secret you need to use the secret identifier since there is no fully qualified resource id.</p><p>I hope this post has helped you understand how to sync the Terraform state with your existing infrastructure and made the whole process easier and smooth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=937e1a90c916" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/how-to-sync-terraform-state-with-existing-azure-infrastructure-using-the-terraform-import-command-937e1a90c916">How to Sync Terraform State with Existing Azure Infrastructure Using the Terraform Import Command</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Environment Variables on Terraform]]></title>
            <link>https://medium.com/codex/how-to-use-environment-variables-on-terraform-f2ab6f95f82d?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2ab6f95f82d</guid>
            <category><![CDATA[terraform-provider]]></category>
            <category><![CDATA[cloud-infrastructure]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Tue, 23 Mar 2021 21:53:31 GMT</pubDate>
            <atom:updated>2021-05-30T20:26:50.780Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="http://medium.com/codex">CODEX</a></h4><h4>A beginner&#39;s guide.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9H3IomuA29If7usX" /><figcaption>Photo by <a href="https://unsplash.com/@nikola43?utm_source=medium&amp;utm_medium=referral">Nikola Mihajloski</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Using environment variables with Terraform is very easy, but if you are a beginner at it then it can be a little bit tricky. Using them as input variables is fairly simple and the documentation, blogs, and other sources I found online were pretty useful. However, implementing environment variables that the Terraform providers have predefined for their configurations is not explicitly detailed in the documentation. I’ll try to explain as simple as I possibly can for anyone to easily understand how to use them.</p><h3>Using Env Variables as Input Variables</h3><p>This is very straightforward, if you have ever used environment variables then you already know how to do this. Let’s do a simple example:</p><p>We’ll define a couple of env variables in our .bashrc, or .zshrc, configuration file:</p><pre># ...<br>export TF_VAR_EXAMPLE_ONE=&quot;&lt;value&gt;&quot;<br>export TF_VAR_example_two=&quot;&lt;value&gt;&quot;<br># ...</pre><p>Notice that to use environment variables with Terraform they must have the “<em>TF_VAR</em>” prefix. Now we have to define our variables in Terraform:</p><pre>variable &quot;EXAMPLE_ONE&quot; {<br>    type        = string<br>    description = &quot;This is an example input variable using env variables.&quot;<br>}</pre><pre>variable &quot;example_two&quot; {<br>    type        = string<br>    description = &quot;This is another example input variable using env variables.&quot;<br>}</pre><p>Terraform identifies the environment variables with the specified prefix and now those variables can be used as regular input variables.</p><h3>Using Env Variables as Provider Configuration Variables</h3><p>With most Terraform providers you can use environment variables for some configuration arguments. HashiCorp recommends using environment variables to set those values whenever possible to avoid having credentials saved in source-controlled Terraform code.</p><p>This is very simple, you just need to check the provider’s documentation to know what env variables it supports, here we’ll use the <a href="https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs">Azure provider</a> as an example. Let’s say we want to specify the subscription id, all we have to do is set the next environment variable, and Terraform will automatically identify it:</p><pre>export ARM_SUBSCRIPTION_ID=&quot;&lt;value&gt;&quot;</pre><p>Notice that all the environment variables that can be used with the Azure provider have the “ARM” prefix. Other providers have their own prefixes as well.</p><p>Now let’s see another common example of environment variables implementation.</p><p>We need to configure Terraform to store the state remotely so that more people can contribute. To do this we’ll create a blob container in Azure Storage, we’ll keep using the Azure provider, and configure our Terraform project to save the state there. To achieve what I just mentioned we can make two different implementations.</p><p>The first option is to set the following configuration in our Terraform file:</p><pre>terraform {<br>    backend &quot;azurerm&quot; {<br>        resource_group_name  = &quot;&lt;storage account rg name&gt;&quot;<br>        storage_account_name = &quot;&lt;azure storage account name&gt;&quot;<br>        container_name       = &quot;&lt;blob container name&gt;&quot;<br>        key                  = &quot;&lt;name of the state file&gt;&quot;<br>    }</pre><pre>    required_providers {<br>        azurerm = {<br>            source  = &quot;hashicorp/azurerm&quot;<br>            version = &quot;2.42.0&quot;<br>        }<br>    }<br>}</pre><pre>provider &quot;azurerm&quot; {<br>    features {}<br>}</pre><p>In that backend configuration, there is an argument missing that allows Terraform to access the blob container to read and write the state. That argument is the Storage Account Access Key. That is a sensitive piece of information, so we don’t want it to be in our code.</p><p>We’ll set an environment variable for the Storage Account Access Key:</p><pre>export ARM_ACCESS_KEY=&quot;&lt;storage account access key value&gt;&quot;</pre><p>By doing those two simple steps you can now run terraform init and you’ll have Terraform configured to store the state on a remote location to promote collaboration.</p><p>Now, the second option is to not set any argument related to the backend configuration on your Terraform file and do it at the moment of executing terraform init . Our provider configuration would look like this:</p><pre>terraform {<br>    backend &quot;azurerm&quot; {}</pre><pre>    required_providers {<br>        azurerm = {<br>            source  = &quot;hashicorp/azurerm&quot;<br>            version = &quot;2.42.0&quot;<br>        }<br>    }<br>}</pre><pre>provider &quot;azurerm&quot; {<br>    features {}<br>}</pre><p>The terraform init command, using some example values, would look like this:</p><pre>terraform init \<br>-backend-config=&quot;resource_group_name=rg-terraformexample-001&quot; \<br>-backend-config=&quot;storage_account_name=stterraformexample001&quot; \<br>-backend-config=&quot;container_name=terraform-state&quot; \<br>-backend-config=&quot;key=terraform.tfstate&quot; \<br>-backend-config=&quot;access_key=&lt;storage account access key value&gt;&quot;</pre><p>or we can use our own custom environment variables as well:</p><pre>$ terraform init \<br>-backend-config=&quot;resource_group_name=$resource_group_name&quot; \<br>-backend-config=&quot;storage_account_name=$storage_account_name&quot; \<br>-backend-config=&quot;container_name=$container_name&quot; \<br>-backend-config=&quot;key=$tf_state_file_name&quot; \<br>-backend-config=&quot;access_key=$my_access_key&quot;</pre><p>or we can even set the “<em>ARM_ACCESS_KEY</em>” environment variables and run terraform init specifying the other 4 arguments:</p><pre>$ export ARM_ACCESS_KEY=&quot;&lt;storage account access key value&gt;&quot;</pre><pre>$ terraform init \<br>-backend-config=&quot;resource_group_name=$resource_group_name&quot; \<br>-backend-config=&quot;storage_account_name=$storage_account_name&quot; \<br>-backend-config=&quot;container_name=$container_name&quot; \<br>-backend-config=&quot;key=$tf_state_file_name&quot;</pre><p>Whatever works best for you. Now you know how to use environment variables with Terraform, and also how to configure a remote state.</p><p>Using environment variables with Terraform is very straightforward, but I decided to write this article to give a clear and simple description of how to implement them. Anyone can figure this out with a bit of research and testing. Hopefully, I was able to make your research and testing shorter and easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2ab6f95f82d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/how-to-use-environment-variables-on-terraform-f2ab6f95f82d">How to Use Environment Variables on Terraform</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy a Docker Image from ACR to Azure App Service]]></title>
            <link>https://dolivasm.medium.com/deploy-a-docker-image-from-acr-to-azure-app-service-5b24ef68cafd?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b24ef68cafd</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-container-registry]]></category>
            <category><![CDATA[azure-app-service]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[azure-pipelines]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Fri, 19 Feb 2021 02:11:01 GMT</pubDate>
            <atom:updated>2021-05-30T20:18:36.360Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploy a Docker Image from ACR to Azure App Service Using Pipelines</h3><h4>A guide with detailed steps and screenshots.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sJZ_PZHdT0GJgu5P" /><figcaption>Photo by <a href="https://unsplash.com/@drewdempsey?utm_source=medium&amp;utm_medium=referral">Drew Dempsey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Containerized apps have been on everyone’s lips for a while now, and it’s no surprise, they can be very useful. This article will show you how to build and deploy your Dockerized app seamlessly into an <a href="https://azure.microsoft.com/es-es/services/app-service/">Azure App Service</a>.</p><p>For this guide I have created a demo environment where the Dockerfile is already set up and ready to go, an <a href="https://azure.microsoft.com/es-es/services/container-registry/">Azure Container Registry</a> (ACR) has been created (Basic SKU for this demo), I’ll use ACR; however, there are multiple options for container registries that can be used. And the project’s code is allocated in a private Azure DevOps repo.</p><h3>Create and Configure The App Service</h3><p>First, we’ll create the App Service in the Azure Portal. You probably already know how to create a new resource in the Azure portal, but I’ll quickly show you how to do it. First, you need a Resource Group, then on the home page you can select “<em>Create a resource</em>”, then “<em>Web App</em>” and fill out the options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jp7Kqal3mBbL-nttm6QE9A.png" /><figcaption>Create Web App</figcaption></figure><p>Select the subscription where you want the App Service to live in, set a name and a region, create or use an existing App Service Plan, and make sure you select “<em>Docker Container</em>” in the Publish option. Select the correct operating system, whether your base image is Linux or Windows.</p><p>If you click on “<em>Next: Docker</em>” you can configure the App Service to get the image from ACR, but we’ll skip it and click on “<em>Review + Create</em>” and in the summary page click on “<em>Create</em>”.</p><p>Azure will create an App Service with a default application that is being pulled from a Microsoft Container Registry.</p><p>In the App Service, under Deployment, select “<em>Deployment Center</em>”. There you’ll be able to see logs about the image being pulled from the container registry and executing “<em>docker run</em>” to start the application. Also, in the “<em>Settings</em>” tab you can see the current container registry configuration, there you can manually configure the container registry to be used, but we’ll use pipelines for that in this guide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUcxf2NJYURLuDNrNJu4kw.png" /><figcaption>Web App container registry configuration</figcaption></figure><p>In a scenario where we have our ACR and App Service in different subscriptions, we must enable a managed identity for the App Service. Go under the “<em>Settings</em>” section in the App Service left side menu, click on “<em>Identity</em>” and change the “<em>Status</em>” toggle to “<em>On</em>”. We’ll work with a system-assigned managed identity for ease of use. If we have the ACR and App Service under the same subscription this step is not required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVeBrCYGhoIcABRoi3r8IQ.png" /><figcaption>Enable system-assigned managed identity</figcaption></figure><p>Continuing with the scenario where we have the two resources in different subscriptions, in ACR we must assign the “<em>AcrPull</em>” role to the managed identity we just created for the App Service. After doing this it will be able to pull docker images from ACR. To do this go to ACR in the Azure portal, “<em>Access control (IAM)</em>”, “<em>Role assignments</em>”, “<em>Add</em>”, “<em>Add role assignment</em>”, select the role and managed identity we just created, and click “<em>Save</em>”. Again, in the scenario where the two resources are in the same subscription, this step is not required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QN9fB3d1G3YldMdaIUwFXw.png" /><figcaption>Assign “AcrPull” role to the App Service managed identity</figcaption></figure><p>There is one more thing that we need to set in ACR. Go to ACR, in the Settings section select “<em>Access keys</em>” and enable “<em>Admin user</em>”. This will give us a username and a password to authenticate to ACR and pull the image from it, we’ll use these values in the release pipeline. This is also required to log in to our ACR and push docker images to it from our local environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4qeRQZoMJzC6K0uLO9N0w.png" /><figcaption>Enable Access keys for ACR</figcaption></figure><p>Alright, now we are ready to start setting up the pipelines.</p><h3>Setup a CI Pipeline</h3><p>Now, let’s set up a CI pipeline using YAML to build the Docker image and push it to ACR. For this pipeline what we need is very simple. Here is the YAML file:</p><pre>trigger: none</pre><pre>pool:</pre><pre>  vmImage: ubuntu-18.04</pre><pre>name: &quot;$(Date:yyyyMMdd)$(Rev:.r)&quot;</pre><pre>jobs:</pre><pre>  - job: job_1</pre><pre>    steps:</pre><pre>      - task: Docker@2</pre><pre>        inputs:</pre><pre>          containerRegistry: &#39;my-acr-service-connection&#39;</pre><pre>          repository: &#39;demo-app&#39;</pre><pre>          command: &#39;buildAndPush&#39;</pre><pre>          Dockerfile: &#39;**/Dockerfile&#39;</pre><pre>          tags: &#39;$(Build.BuildNumber)&#39;</pre><p>We are setting the pipeline to have no triggers for the sake of this demo, meaning it can only be triggered manually, but you can configure it to trigger whenever there is a change to a specific branch. We are running it on an ubuntu agent, a custom build number is being set in the “<em>name</em>” instruction, and we are defining one single task to build and push the docker image to ACR. To be able to push the image to ACR we need to have a working “<em>Docker Registry</em>” <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&amp;tabs=yaml">service connection</a> configured for the ACR service that we want to use.</p><h3>Set up a CD pipeline</h3><p>Here we’ll use a Release Pipeline in Azure DevOps. Simply create a new Release pipeline, choose to start with an empty job, go to the tasks of the stage created by default and search and add a task called “<em>Azure Web App for Containers</em>” and fill out the fields with the required information, you’ll need a working service connection for the subscription where the App Service lives in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oo5suTjMOgFV-xUFPxnFKg.png" /><figcaption>CD pipeline setup</figcaption></figure><p>Please notice that the docker image name must include the full container registry name (<strong>&lt;<em>acr-name&gt;.azurecr.io</em></strong>) and the image name and tag. Also, I set the app settings values for “<em>DOCKER_REGISTRY_SERVER_PASSWORD</em>”, “<em>DOCKER_REGISTRY_SERVER_URL</em>”, and “<em>DOCKER_REGISTRY_SERVER_USERNAME</em>” to make sure the App Service is always pulling the image from the right registry and has the right credentials to do so. This is where we’ll use the credentials we enabled before in ACR. Make sure that the “<em>DOCKER_REGISTRY_SERVER_URL</em>” setting has the next format “<em>https://</em><strong><em>&lt;acr-name&gt;</em></strong><em>.azurecr.io</em>”.</p><p>That is all the setup we need to make our pipeline work. Additionally, you can add the build pipeline as an artifact, enable triggers to run after the build pipeline completes, deploy to a slot and swap it, set the image tag as a variable, etc. There are many other configurations you can make, but for this demo, we’ll simply add the task to deploy the image to the App Service.</p><p>Another option for continuous deployment is to turn on the “<em>Continuous deployment</em>” setting in the Deployment Center Settings in the App Service. If it is turned on, every time the image is updated in ACR it will update automatically the App Service. I prefer to set up a CD pipeline to have more control over when the new version is going to be deployed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ev7Icoe7BijrlhZSrYlbYA.png" /><figcaption>Enable continuous deployment in the App Service</figcaption></figure><h3>Side Note</h3><p>Working on an image for a Node.js application I used an Alpine Linux base image, everything was working fine. The problem was when trying to run the image in the App Service, I kept getting a permissions error about the ports the App Service uses, 80 and 443.</p><p>To solve this I needed to give permissions to use ports below 1024 to the none root user that I was setting up in the Dockerfile to run the application, I used “<em>setcap</em>” to achieve this. My Dockerfile ended up looks something like this:</p><pre># Image for 64-bit systems</pre><pre>FROM node:8.9.4-alpine</pre><pre># ...</pre><pre># Install setcap package</pre><pre>RUN apk update</pre><pre>RUN apk add libcap</pre><pre># ...</pre><pre># Give access to the ports below 1024 to non-root users</pre><pre>RUN setcap &#39;cap_net_bind_service=+ep&#39; `readlink -f \`which node\``</pre><pre># Create a non root user to run the app...</pre><pre># ...</pre><p>Please notice that the “<em>setcap</em>” command is run before creating the non-root user because it must be run by the root user. Another solution to this issue is to expose a different port higher than 1024.</p><h3>Conclusion</h3><p>Being able to deploy a docker image from ACR to an App Service is pretty cool and it is very convenient when you have a Dockerized application. Here I showed a couple of options to set up a continuous deployment flow, you can implement the one that better adapts to your needs.</p><p>I hope this article is useful to you. If you have any questions or comments about this quick demo please feel free to post it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b24ef68cafd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YAML vs Classic and Release Azure Pipelines]]></title>
            <link>https://dolivasm.medium.com/yaml-vs-classic-and-release-azure-pipelines-8b5951fa49c3?source=rss-6a47d4805daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b5951fa49c3</guid>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[David Olivas]]></dc:creator>
            <pubDate>Sat, 16 Jan 2021 05:30:07 GMT</pubDate>
            <atom:updated>2021-05-30T20:08:56.443Z</atom:updated>
            <content:encoded><![CDATA[<h3>YAML vs Classic Azure Pipelines</h3><h4>An honest comparison based on experience.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNRmZb0AOl9FUYCfp-X6AA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@realaxer">tian kuan</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>Classic pipelines are set up using a UI and clicking around, moving through tabs, and choosing between the options the UI shows you. The same definition applies to release pipelines, the difference is that the former are used generally to build applications and the latter to deploy them.</p><p>On the other hand, YAML<em> </em>pipelines are set up using code on, you guessed it, a YAML file. Azure DevOps has a task assistant that helps you find the tasks you need and add them to the YAML file.</p><p>You can build and deploy an application using classic pipelines. However, release pipelines have more features to manage deployments for different environments, triggers, pre, and post-deployment conditions, etc.</p><p>With YAML pipelines you can build and deploy an application as well. They have something called “<a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/deployment-jobs?view=azure-devops#:~:text=A%20deployment%20job%20is%20a,exist%20in%20the%20same%20stage.">deployment jobs</a>” and “<a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/environments?view=azure-devops">environments</a>” that can be used to deploy to different environments, similar to what the release pipelines do.</p><h3>Pros and Cons</h3><h4>YAML Pipelines</h4><p>✅ Collaboration is easier since it is code and it can be treated as such (code reviews, pull requests, formatting tools, in-code comments).</p><p>✅ Another benefit of it being code is that it is easy to make changes to multiple values at the same time. For example, using your IDE’s search tool to find and replace several appearances of the same value.</p><p>✅ Using a version control tool, such as git, makes it very easy to compare changes.</p><p>✅ Since the pipeline is in a YAML file in the repo, if the repo needs to be reverted to an older commit, the pipeline version will also be reverted.</p><p>✅ It is now the default option in Azure DevOps for build pipelines.</p><p>✅ Most CI/CD tools support YAML, which makes it easier for you to change from one tool to another.</p><p>✅ <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops">Container jobs</a> are exclusive to YAML pipelines.</p><p>🚫 It may take a bit more effort and time to get the hang of it. However, you can use the task assistant to add the tasks you need. Similarly, an existing classic pipeline can be exported as YAML, though a few adjustments will be necessary to get it working properly.</p><p>🚫 Some configurations cannot be modified in the file, they have to be changed using the UI, which can be a little hard to find the first time (in the pipeline editor, click on the ellipsis menu icon, and click on Triggers). One example of these configurations is the “<a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops&amp;tabs=yaml">Default branch for manual and scheduled builds</a>” option.</p><p>🚫 Some of the CD features available for the release pipelines are not available yet for YAML pipelines. This “con” will eventually disappear, as Microsoft adds more features to the YAML pipelines, but that might take a while.</p><h4>Classic Pipelines</h4><p>✅ They are very user-friendly. Everyone knows how to click around.</p><p>✅ It is easy to quickly discover a setting by just clicking around and not having to visit the documentation all the time.</p><p>🚫 It is not the default option in Azure DevOps for pipelines anymore. It will be deprecated eventually.</p><h3>Conclusion</h3><p>In my experience, and in the state Azure Pipelines are at the moment of writing this article, YAML pipelines are better for CI, and release pipelines are better for CD.</p><p>The truth is, it depends on what requirements you have at the moment of selecting the pipeline implementation. Make sure to analyze how the pipelines will be triggered and the environments where the application will be deployed, how the branching strategy works, and affects the deployment flow. If you need to have a single CI/CD pipeline or two individual pipelines. Make sure to know well your workflow and requirements.</p><p>YAML pipelines are continuously improving, but for CD they are still missing important features. I once tried to set up a CD YAML pipeline to be triggered after a CI pipeline was automatically triggered by a Pull Request, that’s a very easy setup for release pipelines, but for a YAML pipeline you’d have to do a more complex workaround to get it working, I ended up using release pipelines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b5951fa49c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>