<?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"><channel><title><![CDATA[kzankpe]]></title><description><![CDATA[kzankpe]]></description><link>https://blog.kzankpe.com</link><generator>RSS for Node</generator><lastBuildDate>Sat, 09 May 2026 12:43:23 GMT</lastBuildDate><atom:link href="https://blog.kzankpe.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Infrastructure as Code]]></title><description><![CDATA[Infrastructure as Code (IaC) transforms manual cloud provisioning into reproductible, versionable code. This approach accelerates deployments, enhance consistency.
What is IaC?
IaC treats servers, networks and storage as software artifacts. Instead o...]]></description><link>https://blog.kzankpe.com/infrastructure-as-code</link><guid isPermaLink="true">https://blog.kzankpe.com/infrastructure-as-code</guid><category><![CDATA[#IaC]]></category><category><![CDATA[Terraform]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 07 Sep 2025 22:00:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1757271300774/f4b12a5a-aa8e-4ce4-9d31-035bccc135cf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Infrastructure as Code (IaC) transforms manual cloud provisioning into reproductible, versionable code. This approach accelerates deployments, enhance consistency.</p>
<h2 id="heading-what-is-iac">What is IaC?</h2>
<p>IaC treats servers, networks and storage as software artifacts. Instead of using GUI, you declare your desired state in files. Those files become a single source of truth for building and managing infrastructure.</p>
<h2 id="heading-key-benefits">Key Benefits</h2>
<ul>
<li><p>Consistency and repeatability</p>
</li>
<li><p>Version control and collaboration</p>
</li>
<li><p>Automation and speed</p>
</li>
<li><p>Cost management</p>
</li>
</ul>
<h2 id="heading-popular-iac-tools">Popular IaC tools</h2>
<ol>
<li><p>Terraform : a cloud agnostic declarative tool that uses HCL (Hashicorp Configuration Language)</p>
</li>
<li><p>CloudFormation : AWS native IaC service using YAML or JSON template to provision AWS resources</p>
</li>
<li><p>ARM Template / Bicep: Azure native tool to write IaC to provision Azure resources.</p>
</li>
<li><p>Pulumi : You can write IaC in general purpose languages like Typescript, Python or Go</p>
</li>
</ol>
<h2 id="heading-best-practices-for-writing-iac">Best practices for writing IaC</h2>
<ul>
<li><p>Keep modules small and focused on a single responsibility</p>
</li>
<li><p>Parameterize values to reuse code across environment</p>
</li>
<li><p>Enforce code review and merge checks for any infrastructure changes</p>
</li>
<li><p>Continuously validate templates with linters and automated tests.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>IaC is the cornerstone of modern DevOps and cloud native strategies. By using code to deploy resources, teams gain speed, reliability and clarity in their operations.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding SLA, SLO, SLI]]></title><description><![CDATA[A Service Level Agreement, Service Level Objective, and Service Level Indicator form the foundation of reliability planning in modern operations. Each term plays a distinct role in how teams define, measure, and commit to service performance targets....]]></description><link>https://blog.kzankpe.com/understanding-sla-slo-sli</link><guid isPermaLink="true">https://blog.kzankpe.com/understanding-sla-slo-sli</guid><category><![CDATA[SRE]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Mon, 14 Jul 2025 17:38:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1752509901912/838d580e-be48-4c30-94ea-0b83c239f9bb.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A Service Level Agreement, Service Level Objective, and Service Level Indicator form the foundation of reliability planning in modern operations. Each term plays a distinct role in how teams define, measure, and commit to service performance targets. This article breaks down their definitions, relationships, and practical implementation steps.</p>
<h2 id="heading-service-level-indicator-sli">Service Level Indicator (SLI)</h2>
<p>It represents the raw measurement of some aspect of system performance. An SLI is numerical value derived from monitoring data and reflects service health over time. Find some example below:</p>
<ul>
<li><p>Request latency measured in milliseconds</p>
</li>
<li><p>Success rate defined as the ratio of successful to total requests</p>
</li>
<li><p>Error rate calculated as percentage of failed transactions</p>
</li>
</ul>
<h2 id="heading-service-level-objective-slo">Service Level Objective (SLO)</h2>
<p>It is a target value or range for a specific SLI over a defined period. This target serves as an internal reliability benchmark that teams aims to meet consistently. Some example below:</p>
<ul>
<li><p>A percentage goal such as 99.9 percent availability</p>
</li>
<li><p>A defined measurement window</p>
</li>
<li><p>Alignment with user expectations</p>
</li>
</ul>
<h2 id="heading-service-level-agreement-sla">Service Level Agreement (SLA)</h2>
<p>An SLA is a formal, often contractual, commitment between a service provider and its customers. It outlines the established SLOs, the measures to address breaches, and any corresponding penalties or credits. Components of an SLA include:</p>
<ul>
<li><p>The exact SLOs that the provider guarantees</p>
</li>
<li><p>Definitions of service credits or penalties if targets are missed</p>
</li>
<li><p>Exclusions and limitations such as scheduled maintenance windows</p>
</li>
</ul>
<h2 id="heading-relationship-among-sli-slo-and-sla">Relationship among SLI, SLO and SLA</h2>
<p>SLI, SLO, SLA build on each other in a hierarchy of measurement, targets and commitment. An SLI provides the data, an SLO set the performance goal, and an SLA formalizes that goal at the customer level.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Term</td><td>Definition</td><td>Role</td><td>Example</td></tr>
</thead>
<tbody>
<tr>
<td>SLI</td><td>Measure metric of a service</td><td>Data source</td><td>Latency</td></tr>
<tr>
<td>SLO</td><td>Target on an SLI over time</td><td>Reliability goal</td><td>99.9% success rate</td></tr>
<tr>
<td>SLA</td><td>Contractual promise of an SLO</td><td>Customer guarantee</td><td>Uptime credits</td></tr>
</tbody>
</table>
</div><h2 id="heading-implementing-sre">Implementing SRE</h2>
<p>Integrating SLIs, SLOs, and SLAs into your reliability strategy follows a structured process. Each step ensures alignment between technical capabilities and customer expectations.</p>
<ol>
<li><p>Identify critical user journey and select relevant SLIs</p>
</li>
<li><p>Defined realistic SLO targets based on historical data</p>
</li>
<li><p>Set up alerting and dashboard to monitor SLI performance against SLOs</p>
</li>
<li><p>Draft SLAs that reflect SLOs and outlines remedies for breaches</p>
</li>
<li><p>Continuously review and adjust targets as the service and user needs evolve</p>
</li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Understanding and applying SLIs, SLOs, and SLAs empowers teams to deliver reliable services while managing risk and expectations. By measuring what matters, setting clear goals, and formalizing commitments, Site Reliability Engineers can foster trust and drive continuous improvement.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding JSON Web Tokens]]></title><description><![CDATA[One of the most popular methods for implementing secure, stateless authentication is the use of JSON Web Tokens (JWTs). Whether you are building a web application, an API, or even a mobile app, JWT can help simplify your authentication process.
What ...]]></description><link>https://blog.kzankpe.com/understanding-json-web-tokens</link><guid isPermaLink="true">https://blog.kzankpe.com/understanding-json-web-tokens</guid><category><![CDATA[JWT]]></category><category><![CDATA[authentication]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 08 Jun 2025 18:07:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1749402018324/bbeb8b27-4e0d-4186-b5b3-f3c65340553e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the most popular methods for implementing secure, stateless authentication is the use of JSON Web Tokens (JWTs). Whether you are building a web application, an API, or even a mobile app, JWT can help simplify your authentication process.</p>
<h2 id="heading-what-is-jwt">What is JWT?</h2>
<p>JWT is a compact, URL safe means of representing claims between two parties. It is a way for a server to prove that the client is who they say they are without storing session data on the server side. JWT is a string that securely transmits information as JSON object. This includes a header, a payload and a signature.</p>
<ul>
<li><p><strong>Header</strong>: Contains metadata about the token, such as the type of token and the algorithm used for signing (HMAC SHA256)</p>
</li>
<li><p><strong>Payload</strong>: Contains the claims information about an entity (user for instance) and additional metadata. It can include standard fields like the expiration time or custom fields (needed by the system).</p>
</li>
<li><p><strong>Signature</strong>: It’s created by combining the encoded header, payload, and a secret key. This ensures that the token hasn’t be altered.</p>
</li>
</ul>
<p>By design, JWT is self-contained, it carries all the information required for authentication, eliminating the need for storing session data on the server.</p>
<h2 id="heading-how-does-a-jwt-work">How does a JWT work?</h2>
<p>A JWT based authentication process involves the steps below:</p>
<ol>
<li><p>User Login: A user sends their credentials (login/password) to the server</p>
</li>
<li><p>Token Issuance: Once the credentials are verified, it generates a JWT that encapsulates the user’s identity an other information. Token is sent back to the client.</p>
</li>
<li><p>Client uses token: For future requests to protected routes, the client includes JWT within the HTTP Authorization header.</p>
</li>
<li><p>Token verification: When the server receives a request, it extract the token, decodes it, and verifies it by using the secret. If the token is valid and not expired, the server process the request; otherwise, it send an error.</p>
</li>
</ol>
<h2 id="heading-jwt-composition">JWT composition</h2>
<p>A JWT is made up of three parts separated by dots (.):</p>
<pre><code class="lang-plaintext">Header.Payload.Signature
</code></pre>
<ul>
<li>Header:</li>
</ul>
<pre><code class="lang-json">{
  <span class="hljs-attr">"alg"</span>: <span class="hljs-string">"HS256"</span>,
  <span class="hljs-attr">"typ"</span>: <span class="hljs-string">"JWT"</span>
}
</code></pre>
<ul>
<li>Payload:</li>
</ul>
<pre><code class="lang-json">{
  <span class="hljs-attr">"sub"</span>: <span class="hljs-string">"123456"</span>,
  <span class="hljs-attr">"name"</span>: <span class="hljs-string">"Alex Joe"</span>,
  <span class="hljs-attr">"iat"</span>: <span class="hljs-number">1516239022</span>,
  <span class="hljs-attr">"exp"</span>: <span class="hljs-number">1516242622</span>
}
</code></pre>
<ul>
<li>Signature:</li>
</ul>
<pre><code class="lang-json">HMACSHA256(
  base64UrlEncode(header) + <span class="hljs-string">"."</span> + base64UrlEncode(payload),
  secret
)
</code></pre>
<p>Comprehending this structure is essential for understanding how JWTs maintain data integrity and authenticity. Since any alteration to the header or the payload would result in different signature, the token is only trusted if the signature is valid.</p>
<h2 id="heading-why-use-jwt">Why use JWT?</h2>
<p>There are several reasons for developers to use JWT in applications:</p>
<ul>
<li><p><strong>Stateless Authentication</strong>: It allows you to authenticate requests without storing session information on the server, useful in distributed and microservices architecture.</p>
</li>
<li><p><strong>Scalability</strong>: the token carries all the data needed for authentication, scaling your application across multiple servers is easier.</p>
</li>
<li><p><strong>Interoperability</strong>: JWT is not tied to any specific language or platform, which makes it a universal acceptable standard for authentication.</p>
</li>
<li><p><strong>Security</strong>: When implemented correctly, JWTs help ensure that token data remains secure and tamper-proof.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>JWTs provide a secure way to handle authentication across distributed systems. By understanding the structure of JWTs, how it is generated, and how to verify it, you can implement robust, scalable authentication in your applications.</p>
]]></content:encoded></item><item><title><![CDATA[API in Go with Gin]]></title><description><![CDATA[Creating a web API with Golang is a great way to leverage its speed and efficiency. One of the most popular frameworks for building APIs in Go is Gin
What is Gin?
Gin is a web framework written in Golang. It features a Martini-like API, but with perf...]]></description><link>https://blog.kzankpe.com/api-in-go-with-gin</link><guid isPermaLink="true">https://blog.kzankpe.com/api-in-go-with-gin</guid><category><![CDATA[golang]]></category><category><![CDATA[APIs]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 18 May 2025 14:09:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1747569111799/7d999450-3570-40cd-bc80-56716ed81552.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Creating a web API with Golang is a great way to leverage its speed and efficiency. One of the most popular frameworks for building APIs in Go is <strong>Gin</strong></p>
<h2 id="heading-what-is-gin">What is Gin?</h2>
<p>Gin is a web framework written in Golang. It features a Martini-like API, but with performance up to 40 times faster than Martini. If you need performance and productivity, you will love Gin.</p>
<ul>
<li><p><strong>Fast</strong>: Radix tree based routing, small memory foot print</p>
</li>
<li><p><strong>Middleware support</strong>: An incoming HTTP request can be handled by a chain of middleware and the final action</p>
</li>
<li><p><strong>Crash Free</strong>: Gin can catch a panic occurred during a HTTP request and recover it</p>
</li>
<li><p><strong>JSON validation</strong>: Gin can parse and validate the JSON of a request</p>
</li>
<li><p><strong>Routes grouping</strong>: Organize your routes better. Authorization required vs non required, different API versions</p>
</li>
<li><p><strong>Error management</strong>: Gin provides a convenient way to collect all the errors occurred during a HTTP request</p>
</li>
<li><p>etc..</p>
</li>
</ul>
<p>Find more detailed information on the project official page <a target="_blank" href="https://gin-gonic.com/en/">here</a>.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li><p>Go 1.16 or above</p>
</li>
<li><p>A text editor (I use VS Code )</p>
</li>
<li><p>API Client to test your API, like Postman</p>
</li>
</ul>
<h2 id="heading-project-setup">Project Setup</h2>
<p>Open a terminal and create a new project using the command below:</p>
<pre><code class="lang-bash">mkdir rest-api
<span class="hljs-built_in">cd</span> rest-api
<span class="hljs-comment"># Initialize the projet go.mod</span>
go mod init github.com/&lt;user&gt;/rest-api

<span class="hljs-comment"># Install Gin</span>
go get -u github.com/gin-gonic/gin
</code></pre>
<p>You should get two file in your project folder <code>go.mod</code> and <code>go.sum</code>.</p>
<h2 id="heading-simple-api">Simple API</h2>
<p>Let create a minimal API with few lines of code. For instance an hello-world endpoint:</p>
<pre><code class="lang-go"><span class="hljs-keyword">package</span> main

<span class="hljs-keyword">import</span> (
    <span class="hljs-string">"github.com/gin-gonic/gin"</span>
)

<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {
    r := gin.Default()

    <span class="hljs-comment">// Define a simple GET route</span>
    r.GET(<span class="hljs-string">"/hello"</span>, <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">(c *gin.Context)</span></span> {
        c.JSON(<span class="hljs-number">200</span>, gin.H{
            <span class="hljs-string">"message"</span>: <span class="hljs-string">"Hello, World!"</span>,
        })
    })

    <span class="hljs-comment">// Run the server on port 8080</span>
    r.Run(<span class="hljs-string">":8080"</span>)
}
</code></pre>
<h2 id="heading-running-the-api">Running the API</h2>
<p>To start your server, run:</p>
<pre><code class="lang-bash">go run main.go
</code></pre>
<p>Now, navigate to <a target="_blank" href="http://localhost:8080/hello"><code>http://localhost:8080/hello</code></a> in your browser or use <code>curl</code>:</p>
<pre><code class="lang-bash">curl http://localhost:8080/hello
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Building an API with <strong>Golang</strong> and the <strong>Gin framework</strong> is an excellent choice for developers looking for speed, efficiency, and simplicity. With its minimalistic design and powerful capabilities, Gin makes it easy to set up routes, handle requests, and scale applications efficiently.</p>
]]></content:encoded></item><item><title><![CDATA[DevOps Deployment strategies]]></title><description><![CDATA[Historically, deployments were big-bang events, a single monolithic push of code to production. This approach often led to outages and significant risk because there was no safety net if things went wrong. Modern strategy embrace automation, incremen...]]></description><link>https://blog.kzankpe.com/devops-deployment-strategies</link><guid isPermaLink="true">https://blog.kzankpe.com/devops-deployment-strategies</guid><category><![CDATA[Devops]]></category><category><![CDATA[deployment]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sat, 19 Apr 2025 22:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745254777783/13a5fb43-ad31-4fe4-85e1-8180987c0d89.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Historically, deployments were big-bang events, a single monolithic push of code to production. This approach often led to outages and significant risk because there was no safety net if things went wrong. Modern strategy embrace automation, incremental changes and monitoring.</p>
<h2 id="heading-introduction">Introduction</h2>
<p>Modern software delivery demands that changes roll out smoothly and safely. Enterprise-scale systems require strategies that let teams deploy, test and roll back without disrupting users.We will explore various deployment strategies. Understanding these methods will help you refine your DevOps practices ensuring a resilient process.</p>
<h2 id="heading-bluegreen-deployment">Blue/Green Deployment</h2>
<p>This deployment involves maintaining two identical production environments. One environment, Blue, actively serves all traffic while the other, Green, holds the new release. Once the release in Green environment passes all testings and validations, traffic is switched over, making Green the active environment.</p>
<p><strong>Benefits:</strong></p>
<ul>
<li><p>Zero-downtime deployments: users experience no service disruption during the switch</p>
</li>
<li><p>Quick rollback: In case of issues, reverting back to Blue environment is immediate and straightforward</p>
</li>
</ul>
<p><strong>Challenges:</strong></p>
<ul>
<li><p>Cost: Maintaining two parallel environments can double resource usage</p>
</li>
<li><p>Infrastructure complexity: Requires robust routing and load balancing</p>
</li>
</ul>
<h2 id="heading-canary-deployment">Canary Deployment</h2>
<p>With canary deployments, new versions are rolled out to a small subset of users first before a full-scale launch. This approach helps to mitigate risk by exposing only a limited audience to potential issues.</p>
<p>Benefits:</p>
<ul>
<li><p>Reduced risk: Potential errors affect only a small percentage of users.</p>
</li>
<li><p>Data-driven feedback: Early metrics and user feedback enable quick adjustments before full release.</p>
</li>
</ul>
<p>Challenges:</p>
<ul>
<li><p>Complex routing logic: Managing and identifying canary traffic calls for advanced traffic segmentation.</p>
</li>
<li><p>Monitoring: Continuous performance monitoring is critical to detect anomalies early.</p>
</li>
</ul>
<h2 id="heading-rolling-updates">Rolling Updates</h2>
<p>This strategy gradually replaces instances of the previous version with the new version, one by one or in small batches. This ensures that a portion of your infrastructure is always running stable version.</p>
<p><strong>Benefits:</strong></p>
<ul>
<li><p>Resource efficiency: No need to duplicate environments fully, reducing costs.</p>
</li>
<li><p>Availability: The service remains online as only a subset of instances is drained at any given time.</p>
</li>
</ul>
<p><strong>Challenges:</strong></p>
<ul>
<li><p>Inconsistencies: Modifications to shared state (database) during updates can lead to inconsistencies if not carefully managed.</p>
</li>
<li><p>Strain on load balancing: Requires distributed traffic management to ensure consistent performance across all instances.</p>
</li>
</ul>
<h2 id="heading-ab-testing">A/B Testing</h2>
<p>This sophisticated method empowers organization to evaluate and compare two different versions of an application in production environment. Two versions (A and B) of an application or service run simultaneously to compare performance, engagement and reliability.</p>
<p><strong>Benefits:</strong></p>
<ul>
<li><p>User insights: Directly assess how users react to changes</p>
</li>
<li><p>Incremental improvements: Use metrics to drive decision on version to keep</p>
</li>
</ul>
<p><strong>Challenges:</strong></p>
<ul>
<li><p>Statistics: Determining whether a change is beneficial requires robust data collection and analysis measure</p>
</li>
<li><p>Resource duplication: May require additional backend logic to support both routes concurrently</p>
</li>
</ul>
<h2 id="heading-feature-flags">Feature Flags</h2>
<p>It decouples code deployments from feature releases. This means that new code is pushed to production but hidden behind flags until it’s ready for exposure.</p>
<p><strong>Benefits:</strong></p>
<ul>
<li><p>Granular control: Enable or disable feature in real time without further deployment</p>
</li>
<li><p>Experimentation: A/B test features without risking overall system stability.</p>
</li>
</ul>
<p><strong>Challenges:</strong></p>
<ul>
<li>Technical debt: Overuse or mismanagement of flags can complicate code maintenance.</li>
</ul>
<ul>
<li>Configuration complexity: Managing and tracking flags across different environments requires diligent processes and tooling.</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Choosing the right deployment strategy is crucial for the success of DevOps initiative. Each strategy has its own set of advantages and is suited for different scenarios. By understanding these strategies, team can make decisions aligned with their business goals, enhance user experience.</p>
]]></content:encoded></item><item><title><![CDATA[Azure Bastion: Secure your Azure environment]]></title><description><![CDATA[Azure Bastion is a fully managed service that provides secure and seamless RDP (Remote Desktop Protocol) and SSH (Secure Shell) connectivity to your Azure VMs directly through the Azure portal.
What is Azure Bastion
Azure Bastion is a platform-as-a-s...]]></description><link>https://blog.kzankpe.com/azure-bastion-secure-your-azure-environment</link><guid isPermaLink="true">https://blog.kzankpe.com/azure-bastion-secure-your-azure-environment</guid><category><![CDATA[Azure]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 13 Apr 2025 14:16:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744379982741/9dfb2eaa-4462-41aa-bd94-00ccaac435dd.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Azure Bastion is a fully managed service that provides secure and seamless RDP (Remote Desktop Protocol) and SSH (Secure Shell) connectivity to your Azure VMs directly through the Azure portal.</p>
<h2 id="heading-what-is-azure-bastion">What is Azure Bastion</h2>
<p>Azure Bastion is a platform-as-a-service (PaaS) offering that allows you to connect to your Azure VMs without exposing them to the public internet. It acts as a secure gateway, enabling you to access your VMs using RDP and SSH protocols directly from the Azure portal. It eliminates the need for public IP address on the VMs and reducing the attack surface and enhancing security.</p>
<h2 id="heading-benefits-of-azure-bastion">Benefits of Azure Bastion</h2>
<ul>
<li><p><strong>Enhanced Security:</strong> By eliminating the need for public IP addresses on your VMs, it also provides a secure connection over SSL, ensuring that your data is encrypted in transit.</p>
</li>
<li><p><strong>Seamless Connectivity:</strong> Azure Bastion allows you to connect to your VMs directly from the Azure portal without the need for additional client software. You can also use Azure CLI with the bastion extension, but it requires Standard Tier. This simplifies the process of managing your VMs and enhances user experience.</p>
</li>
<li><p><strong>Integrated with Azure Services:</strong> It integrates seamlessly with other Azure services, such as Azure Entra ID (AAD) for authentication, providing a unified security model across your Azure environment.</p>
</li>
<li><p><strong>Scalability:</strong> Azure Bastion automatically scales to meet your needs, ensuring that you have the resources required for your workloads.</p>
</li>
</ul>
<h2 id="heading-how-to-set-up-azure-bastion"><strong>How to Set Up Azure Bastion</strong></h2>
<p>Setting up Azure Bastion is a straightforward process. Here’s a step-by-step guide to get you started:</p>
<ol>
<li><p>Create a Virtual Network, ensure that you create a subnet specifically for Azure Bastion named <code>AzureBastionSubnet</code></p>
</li>
<li><p>Create Azure Bastion Host. Fill in the necessary details</p>
<ol>
<li><p><strong>Name</strong>: Provide a name for your Bastion host.</p>
</li>
<li><p><strong>Region</strong>: Select the same region as your virtual network.</p>
</li>
<li><p><strong>Virtual Network</strong>: Choose the virtual network you created in Step 1.</p>
</li>
<li><p><strong>Public IP</strong>: Create a new public IP address for the Bastion host.</p>
</li>
</ol>
</li>
<li><p>Once the Bastion host is deployed, navigate to your VM and choose Bastion under the Connect menu. Enter username and password.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744378725492/0fab24a2-aea8-4f97-8a92-44ba11d4750e.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Azure Bastion is an essential service for organizations looking to enhance the security of their Azure environments. By providing secure and seamless access to VMs without the need for public IP addresses, Azure Bastion significantly reduces the risk of cyber threats while simplifying the management of your resources.</p>
]]></content:encoded></item><item><title><![CDATA[GitOps Explained]]></title><description><![CDATA[In the fast-evolving world of DevOps, GitOps has emerged as a game-changing approach to manage and deliver applications and infrastructure. By combining the power of Git with operational best practices, GitOps offers a framework that enables teams to...]]></description><link>https://blog.kzankpe.com/gitops-explained</link><guid isPermaLink="true">https://blog.kzankpe.com/gitops-explained</guid><category><![CDATA[Git]]></category><category><![CDATA[gitops]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 06 Apr 2025 14:37:36 GMT</pubDate><content:encoded><![CDATA[<p>In the fast-evolving world of DevOps, GitOps has emerged as a game-changing approach to manage and deliver applications and infrastructure. By combining the power of Git with operational best practices, GitOps offers a framework that enables teams to achieve seamless, secure, and automated deployment workflows. But what exactly is GitOps, and why is it gaining traction in modern software development? Let’s dive in.</p>
<h2 id="heading-what-is-gitops">What is GitOps?</h2>
<p>GitOps is a methodology that uses Git, a popular version control system, as the single source of truth for declarative infrastructure and application management. In simpler terms, GitOps treats Git repositories as the authoritative record for how systems should be configured and deployed.</p>
<p>At its core, GitOps is built around two main principles:</p>
<ol>
<li><p><strong>Declarative Configuration</strong>: All infrastructure and application states are described declaratively (e.g., using YAML or JSON files).</p>
</li>
<li><p><strong>Version Control</strong>: Changes to these configurations are managed in Git, allowing teams to track every change with full transparency.</p>
</li>
</ol>
<p>When a change is made to the desired state stored in the Git repository, automation tools (like Flux or ArgoCD) detect the change and apply it to the target environment, ensuring the system's actual state matches the desired state.</p>
<h2 id="heading-key-benefits-of-gitops">Key Benefits of GitOps</h2>
<ol>
<li><p><strong>Automation and Consistency</strong>: GitOps automates deployment processes, reducing manual errors and maintaining consistent environments across development, staging, and production.</p>
</li>
<li><p><strong>Versioned History</strong>: Every change made to the infrastructure or application is versioned in Git, enabling auditability and easy rollback in case of issues.</p>
</li>
<li><p><strong>Security and Transparency</strong>: Changes must go through Git pull requests, creating an auditable trail and ensuring proper approvals before deployment.</p>
</li>
<li><p><strong>Improved Developer Experience</strong>: With GitOps, developers can manage infrastructure just as they manage application code, using familiar Git workflows.</p>
</li>
<li><p><strong>Faster Recovery and Rollbacks</strong>: If something goes wrong, reverting to a previous stable state is as simple as rolling back to a previous Git commit.</p>
</li>
</ol>
<h2 id="heading-how-does-gitops-work">How Does GitOps Work?</h2>
<p>Here's a simplified GitOps workflow:</p>
<ol>
<li><p><strong>Git Repository as Source of Truth</strong>: Developers define the desired state (e.g., infrastructure configuration or application deployment) in a Git repository.</p>
</li>
<li><p><strong>Pull Request Workflow</strong>: Changes are proposed through pull requests, reviewed, and approved by team members.</p>
</li>
<li><p><strong>Automation Tools Apply Changes</strong>: GitOps tools like ArgoCD or Flux detect the changes in the Git repository and synchronize the actual environment to match the desired state.</p>
</li>
<li><p><strong>Continuous Reconciliation</strong>: GitOps continuously monitors the state of the system. If the actual state drifts from the desired state, it automatically brings the system back into compliance.</p>
</li>
</ol>
<h2 id="heading-gitops-in-action-a-practical-example">GitOps in Action: A Practical Example</h2>
<p>Imagine you're deploying a web application using Kubernetes. With GitOps:</p>
<ol>
<li><p>The Kubernetes deployment YAML is stored in a Git repository.</p>
</li>
<li><p>A new version of the application is built and tagged in the repository.</p>
</li>
<li><p>The GitOps tool detects the change and applies the updated configuration to the Kubernetes cluster.</p>
</li>
<li><p>If something breaks, the team can revert the deployment by rolling back the Git commit.</p>
</li>
</ol>
<h2 id="heading-popular-tools-for-gitops">Popular Tools for GitOps</h2>
<p>There are several tools that support GitOps workflows, including:</p>
<ul>
<li><p><strong>ArgoCD</strong>: A declarative continuous delivery tool for Kubernetes.</p>
</li>
<li><p><strong>Flux</strong>: A GitOps toolkit for Kubernetes.</p>
</li>
<li><p><strong>Terraform with GitOps</strong>: While not specifically a GitOps tool, Terraform is often used in GitOps workflows for infrastructure provisioning.</p>
</li>
<li><p><strong>Jenkins X</strong>: A CI/CD platform with GitOps-based automation.</p>
</li>
</ul>
<h2 id="heading-challenges-with-gitops">Challenges with GitOps</h2>
<p>While GitOps offers many benefits, it’s not without challenges:</p>
<ul>
<li><p><strong>Learning Curve</strong>: Teams new to GitOps may require time to adapt to the workflow and tools.</p>
</li>
<li><p><strong>Complexity</strong>: Managing large-scale applications and infrastructure configurations with GitOps can become intricate.</p>
</li>
<li><p><strong>Tooling Integration</strong>: Not all systems seamlessly integrate into GitOps workflows, which may require additional tooling.</p>
</li>
</ul>
<h2 id="heading-the-future-of-gitops">The Future of GitOps</h2>
<p>As organizations continue to embrace DevOps, GitOps represents a natural evolution toward greater automation, consistency, and reliability. Its declarative nature and use of Git as a source of truth make it an essential methodology for managing modern cloud-native applications and infrastructure.</p>
<p>GitOps is more than just a buzzword—it's a paradigm shift that empowers developers and operations teams to collaborate better, move faster, and innovate with confidence. Whether you're running Kubernetes clusters or managing multi-cloud environments, GitOps is a practice worth adopting.</p>
]]></content:encoded></item><item><title><![CDATA[Pull images from Azure Container Registry from Azure VM using Managed Identity]]></title><description><![CDATA[This post will describe the required steps to follow in order to pull container images from Azure Container Registry (ACR) using Managed identity attached to the instance.
Managed identity provides seamless authentication to Azure resources.
Prerequi...]]></description><link>https://blog.kzankpe.com/pull-images-from-azure-container-registry-from-azure-vm-using-managed-identity</link><guid isPermaLink="true">https://blog.kzankpe.com/pull-images-from-azure-container-registry-from-azure-vm-using-managed-identity</guid><category><![CDATA[Azure]]></category><category><![CDATA[containers]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Mon, 24 Mar 2025 14:29:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1742764559656/a938850e-5480-421a-b1c5-89caf263b620.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post will describe the required steps to follow in order to pull container images from Azure Container Registry (ACR) using Managed identity attached to the instance.</p>
<p>Managed identity provides seamless authentication to Azure resources.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li><p>Create ACR</p>
</li>
<li><p>Create Azure VM with managed identity attached to it (System or User assigned)</p>
</li>
<li><p>Add <code>AcrPull</code> role on the managed identity</p>
</li>
<li><p>Install Az CLI on the VM. Follow the documentation <a target="_blank" href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt&amp;view=azure-cli-latest">here</a></p>
</li>
</ul>
<h2 id="heading-login-to-az-cli-using-managed-identity">Login to Az CLI using Managed Identity</h2>
<pre><code class="lang-bash">az login --identity
</code></pre>
<h2 id="heading-login-to-acr">Login to ACR</h2>
<pre><code class="lang-bash">az acr login —name &lt;registryName&gt;
</code></pre>
<h2 id="heading-pull-image-from-the-container">Pull image from the container</h2>
<pre><code class="lang-bash">docker pull &lt;registryName&gt;.azurecr.io/imageName:tag
</code></pre>
]]></content:encoded></item><item><title><![CDATA[DORA Metrics: Key to DevOps Success]]></title><description><![CDATA[One of the most effective framework for measuring DevOps success is DORA (DevOps Research and Assessment) metrics. In this article, I will explore what DORA metrics are and how you can leverage them to enhance your DevOps practice.
What are DORA metr...]]></description><link>https://blog.kzankpe.com/dora-metrics-key-to-devops-success</link><guid isPermaLink="true">https://blog.kzankpe.com/dora-metrics-key-to-devops-success</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 16 Mar 2025 03:41:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1742037736973/9130df24-5d0c-4a64-b5ea-20dc58908401.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the most effective framework for measuring DevOps success is DORA (DevOps Research and Assessment) metrics. In this article, I will explore what DORA metrics are and how you can leverage them to enhance your DevOps practice.</p>
<h2 id="heading-what-are-dora-metrics">What are DORA metrics?</h2>
<p>DORA was a team at Google Cloud focused on assessing DevOps practices using standard set of metrics. It’s a set of key performance indicators (KPIs) that help organizations assess their software delivery performance. The four primary DORA metrics are:</p>
<h3 id="heading-deployment-frequency">Deployment frequency</h3>
<p>This metric measure how often an organization deploys code to production. High performing team deploys multiple times a day. Lower performing team deploys may deploy only once a month or less.</p>
<h3 id="heading-lead-time-for-changes">Lead Time for Changes</h3>
<p>This metric tracks the time it takes for a code change to go to from development to production. Shorter lead times indicate a more efficient development process. Team can respond quickly to customer needs and market changes.</p>
<h3 id="heading-mean-time-to-restore-mttr">Mean Time to Restore (MTTR)</h3>
<p>MTTR measure the average time it takes to recover from a failure in production. A lower MTTR indicates that a team can quickly address an issue and minimize downtime, important to maintain customer satisfaction.</p>
<h3 id="heading-change-failure-rate">Change failure Rate</h3>
<p>This represents the percentage of changes that result in a failure in production. A lower percentage suggest that a team has effective testing and development practice, reducing the risk of disruptions.</p>
<h2 id="heading-how-to-implement-dora-metrics">How to implement DORA metrics?</h2>
<p>To effectively implement DORA metrics in your organization, you should consider the steps below:</p>
<ol>
<li><p><strong>Establish baseline</strong> : measure the current performance against the metrics</p>
</li>
<li><p><strong>Set goals</strong> : Define clear and measurable (SMART) goals for each metrics.</p>
</li>
<li><p><strong>Monitor the progress</strong> : Track and review your DORA metrics to assess progress. Use dashboard to visualize your data.</p>
</li>
<li><p><strong>Foster a culture of learning</strong> : Encourage team to share insights and learning.</p>
</li>
<li><p><strong>Iterate and adapt</strong> : As you evolve and progress, revisit your goals and metrics to ensure they remain aligned with your business objectives.</p>
</li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>DORA metrics provide a powerful framework for organizations looking to enhance their DevOps practices and improve software delivery performance. By focusing on deployment frequency, lead time for changes, mean time to restore, and change failure rate, teams can gain valuable insights into their processes and drive continuous improvement.</p>
]]></content:encoded></item><item><title><![CDATA[Git Cheat Sheet : For-each-ref]]></title><description><![CDATA[Git offers commands to manage repository efficiently. Today we will talk about the command git for-each-ref . This command is helpful if you are dealing with multiple branches, tags or refs in your repository and need an advance filtering.
What is gi...]]></description><link>https://blog.kzankpe.com/git-cheat-sheet-for-each-ref</link><guid isPermaLink="true">https://blog.kzankpe.com/git-cheat-sheet-for-each-ref</guid><category><![CDATA[Git]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 09 Mar 2025 15:26:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1741435861973/cb8adbd9-d585-4142-ac87-f90a319f13c5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Git offers commands to manage repository efficiently. Today we will talk about the command <code>git for-each-ref</code> . This command is helpful if you are dealing with multiple branches, tags or refs in your repository and need an advance filtering.</p>
<h2 id="heading-what-is-git-for-each-ref">What is <code>git for-each-ref</code>?</h2>
<p>The command allows you to iterate over and examine refs in your repository. Refs are pointers to commits and are located in directories like <code>.git/refs/heads</code> (branches) and <code>.git/refs/tags</code> (tags).</p>
<h2 id="heading-basic-syntax">Basic Syntax</h2>
<pre><code class="lang-bash">git for-each-ref [&lt;option&gt;] [&lt;ref-path&gt;]
</code></pre>
<ul>
<li><p><code>&lt;option&gt;</code> : Modify the output format</p>
</li>
<li><p><code>&lt;ref-path&gt;</code> : Specify the category of refs to include. For example:</p>
<ul>
<li><p><code>refs/heads/</code> list branches</p>
</li>
<li><p><code>refs/tags/</code> list tags</p>
</li>
<li><p><code>refs/remotes/</code> list remote branches</p>
</li>
</ul>
</li>
</ul>
<h2 id="heading-use-cases-and-examples">Use Cases and Examples</h2>
<ol>
<li><p><strong>List all branches</strong></p>
<pre><code class="lang-bash"> git for-each-ref refs/heads/
</code></pre>
<p> This command will display the refs for all local branches.</p>
</li>
<li><p><strong>Customizing Output</strong></p>
<p> Use the <code>--format</code> option to control the output. For instance, to display each branch name along with the last commit message:</p>
<pre><code class="lang-bash"> git for-each-ref refs/heads/ --format=<span class="hljs-string">"%(refname:short) - %(subject)"</span>
</code></pre>
<ul>
<li><p><code>%(refname:short)</code>: Displays the branch name without the full <code>refs/heads/</code> prefix.</p>
</li>
<li><p><code>%(subject)</code>: Shows the commit message.</p>
</li>
</ul>
</li>
<li><p><strong>Sort Branches by Date</strong></p>
<pre><code class="lang-bash"> git for-each-ref refs/heads/ --sort=-committerdate --format=<span class="hljs-string">"%(refname:short) - %(committerdate)"</span>
</code></pre>
<p> <code>--sort=-committerdate</code>: Sorts by the committer date in descending order.</p>
</li>
<li><p><strong>List Tags with Commit Info</strong></p>
<pre><code class="lang-bash"> git for-each-ref refs/tags/ --format=<span class="hljs-string">"Tag: %(refname:short), Commit: %(objectname), Message: %(subject)"</span>
</code></pre>
<p> <code>%(objectname)</code>: Displays the commit ID (hash) associated with the tag.</p>
</li>
</ol>
<h2 id="heading-formatting-placeholders">Formatting Placeholders</h2>
<p>Here’s a quick reference for some commonly used placeholders in <code>--format</code>:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Placeholder</strong></td><td><strong>Description</strong></td></tr>
</thead>
<tbody>
<tr>
<td><code>%(refname)</code></td><td>Full ref name: <code>refs/heads/main</code></td></tr>
<tr>
<td><code>%(refname:short)</code></td><td>Short ref name : <code>main</code></td></tr>
<tr>
<td><code>%(objectname)</code></td><td>SHA-1 of the object the ref points to.</td></tr>
<tr>
<td><code>%(authorname)</code></td><td>Author of the commit</td></tr>
<tr>
<td><code>%(authordate)</code></td><td>Date when the commit was authored</td></tr>
<tr>
<td><code>%(subject)</code></td><td>First line of the commit message</td></tr>
</tbody>
</table>
</div><h2 id="heading-conclusion">Conclusion</h2>
<p>This command is helpful when you need advanced customization or insights into your refs. Instead or relying on git branch or git tag commands, for-each-ref will tailor the output to your exact needs.</p>
]]></content:encoded></item><item><title><![CDATA[Azure DevOps: Share a service connection across projects]]></title><description><![CDATA[Prerequisite

Azure DevOps organization and projects

The appropriate permissions to create and manage service connection. See official page here


Create a service connection
If you don’t have service connection ready to be shared, please the steps ...]]></description><link>https://blog.kzankpe.com/azure-devops-share-a-service-connection-across-projects</link><guid isPermaLink="true">https://blog.kzankpe.com/azure-devops-share-a-service-connection-across-projects</guid><category><![CDATA[azure-devops]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 02 Mar 2025 15:42:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1740652300052/a68ba1be-fa62-4f8f-aa78-aa142937ba56.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-prerequisite">Prerequisite</h2>
<ul>
<li><p>Azure DevOps organization and projects</p>
</li>
<li><p>The appropriate permissions to create and manage service connection. See official page <a target="_blank" href="https://learn.microsoft.com/en-us/azure/devops/pipelines/policies/service-connection-permissions?view=azure-devops">here</a></p>
</li>
</ul>
<h2 id="heading-create-a-service-connection">Create a service connection</h2>
<p>If you don’t have service connection ready to be shared, please the steps below to create one.</p>
<ol>
<li><p>In your DevOps project settings</p>
</li>
<li><p>Select service connections</p>
</li>
<li><p>On the next page select New service connection at the top right</p>
</li>
<li><p>On the opened panel, select the authentication method and enter the required parameters</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740913683135/cdad93b0-3a41-4832-baea-5d8b18b5249d.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<h2 id="heading-share-a-service-connection">Share a service connection</h2>
<p>To share a service connection, go to the service connection menu and select the service connection. Click on the three dots to display the security menu.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740914468002/0f29e1e7-6459-466e-971d-2a22f4fe5825.png" alt class="image--center mx-auto" /></p>
<p>On the security page, you will find at he bottom, you will find <strong><mark>Project permissions</mark>.</strong> By adding others projects in your organization, you will be able to use the service connection in those projects.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740914522751/b934669f-8f46-44a3-be45-82a8919f8a0c.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Having one service connection that is shared between project reduce the maintenance task. If the service need to be updated, a token renewal for instance, it will be done in one place.</p>
<p>The shared service connection name will slightly change in the projects:</p>
<p>In the original project : The service connection will have a tagged <code>Shared</code></p>
<p>In the other projects : In other project the service connection name will be as follow : <code>OrignalName-ProjectName</code></p>
<p>For example: if we decide to share the service connection <strong>AZ-POC</strong> with the project Sandbox. The service connection name in Sandbox will be <strong>AZ-POC-Sandbox</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[Git Cheat Sheet : Remove previous commit]]></title><description><![CDATA[Git is a powerful version control system that allows developers to manage their code efficiently.
Remove local committed changes
If you have accidentally made a wrong commit in Git on you local repository (not pushed to the remote). You have used git...]]></description><link>https://blog.kzankpe.com/git-cheat-sheet-remove-previous-commit</link><guid isPermaLink="true">https://blog.kzankpe.com/git-cheat-sheet-remove-previous-commit</guid><category><![CDATA[Git]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 23 Feb 2025 14:18:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/842ofHC6MaI/upload/956e45f22d07c26787900a71a6e7595d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Git is a powerful version control system that allows developers to manage their code efficiently.</p>
<h2 id="heading-remove-local-committed-changes">Remove local committed changes</h2>
<p>If you have accidentally made a wrong commit in Git on you local repository (not pushed to the remote). You have used <code>git commit</code> command, meaning the commit only exist only locally.</p>
<p>You can use <code>git status</code> to verify the last commit on your branch.</p>
<p>Use the following command to undo you commit:</p>
<pre><code class="lang-bash">git reset --soft HEAD~1
</code></pre>
<p>The command will undo (remove) the last commit on your branch, but it will keep the changes.</p>
<h2 id="heading-remove-remote-committed-changes">Remove remote committed changes</h2>
<p>Sadly your faulty commit was pushed to the remote and you want to undo it.</p>
<p>⚠️ I recommend to not undo commit on the remote as you will rewrite the branch history. Instead use the revert command.⚠️</p>
<p>First identity the commit hash with the command below :</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span> --onleline
</code></pre>
<p>Then you can undo the faulty commit using the hash and push the modification to the remote</p>
<pre><code class="lang-bash">git revert &lt;commit-hash&gt; --no-edit <span class="hljs-comment"># Revert the commit</span>
git push <span class="hljs-comment"># Push the modification to the remote</span>
</code></pre>
<p>The branch history will show the commit and the revert commit.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>There are <strong>several</strong> ways to remove commits from Git, we exposed two simple methods to perform this task.</p>
<ul>
<li><p><code>git reset</code> : This command is used to undo a commit that has not been pushed to the remote, allowing you to update your local repository.</p>
</li>
<li><p><code>git revert</code> : This command safely undoes a commit that has already been pushed to the remote by creating a new commit that revert the changes</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Azure Action Run Command]]></title><description><![CDATA[Azure Run Command is a feature that allows you to execute script or commands directly on your Azure virtual Machines (VMs) without logging in to them. The command will add an extension to your VM instance an execute the command or script. It simplifi...]]></description><link>https://blog.kzankpe.com/azure-action-run-command</link><guid isPermaLink="true">https://blog.kzankpe.com/azure-action-run-command</guid><category><![CDATA[Azure]]></category><dc:creator><![CDATA[kzankpe]]></dc:creator><pubDate>Sun, 16 Feb 2025 16:05:04 GMT</pubDate><content:encoded><![CDATA[<p>Azure Run Command is a feature that allows you to execute script or commands directly on your Azure virtual Machines (VMs) without logging in to them. The command will add an extension to your VM instance an execute the command or script. It simplifies management tasks but you may encounter some issues when using this feature. In this blog post, I will explore the command for Windows VMs.</p>
<h2 id="heading-available-commands-for-windows-vms"><strong>Available commands for Windows VMs</strong></h2>
<p>The table below shows a part of commands available for Windows VMs. You can find the complete list <a target="_blank" href="https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command#available-commands">here</a></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Name</strong></td><td><strong>Description</strong></td></tr>
</thead>
<tbody>
<tr>
<td>RunPowerShellScript</td><td>Runs a PowerShell script</td></tr>
<tr>
<td>EnableRemotePS</td><td>Configures the machine to enable remote PowerShell.</td></tr>
<tr>
<td>EnableWindowsUpdate</td><td>Enable Windows Update Automatic Updates</td></tr>
</tbody>
</table>
</div><h2 id="heading-azure-cli">Azure CLI</h2>
<p>To run the command using Azure CLI, use the template below and adapt it to your needs. The script can be a file, please report to the command documentation.</p>
<pre><code class="lang-powershell">az vm run<span class="hljs-literal">-command</span> invoke  -<span class="hljs-literal">-command</span><span class="hljs-literal">-id</span> RunPowerShellScript -<span class="hljs-literal">-name</span> &lt;vmName&gt; <span class="hljs-literal">-g</span> &lt;rgName&gt; \
-<span class="hljs-literal">-scripts</span> <span class="hljs-string">'param([string]$arg1,[string]$arg2)'</span> <span class="hljs-string">'Write-Host This is a sample script with parameters $arg1 and $arg2'</span> -<span class="hljs-literal">-parameters</span> <span class="hljs-string">'arg1=somefoo'</span> <span class="hljs-string">'arg2=somebar'</span>
</code></pre>
<h2 id="heading-permissions">Permissions</h2>
<p>Running a command requires the <code>Microsoft.Compute/virtualMachines/runCommands/action</code> permission. The Virtual Machine Contributor role and higher levels have this permission.</p>
<h2 id="heading-action-run-command-windows-troubleshooting"><strong>Action Run Command Windows troubleshooting</strong></h2>
<p>I noticed a weird behavior from the Run Command that impacted our production. The script executed with the run command fails and that script was executed each time the Azure VM was restarted. The Instance was trying to install the extension on the VM even if it failed on the first run.</p>
<h3 id="heading-log-location">Log location</h3>
<p>The run command for Windows log is usually located in the following directory: <code>C:\WindowsAzure\Logs\Plugins\Microsoft.CPlat.Core.RunCommandWindows\&lt;version&gt;\RunCommandExtension.log</code></p>
<h3 id="heading-remove-the-extension">Remove the extension</h3>
<p>If you need to remove the extension from your instance, use the command below and adapt it your needs.</p>
<pre><code class="lang-powershell">az vm run<span class="hljs-literal">-command</span> invoke  -<span class="hljs-literal">-command</span><span class="hljs-literal">-id</span> RemoveRunCommandWindowsExtension -<span class="hljs-literal">-name</span> &lt;vmName&gt; <span class="hljs-literal">-g</span> &lt;rgName&gt;
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The Run Command feature can help you quickly diagnose VM issues. You can use the feature through the Azure portal, REST API, PowerShell for Windows VMs or Azure CLI</p>
]]></content:encoded></item></channel></rss>