<?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 Nemchand on Medium]]></title>
        <description><![CDATA[Stories by Nemchand on Medium]]></description>
        <link>https://medium.com/@nemchand.kushwaha?source=rss-9473e0edc399------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Mkz12UkloSr1eo4P</url>
            <title>Stories by Nemchand on Medium</title>
            <link>https://medium.com/@nemchand.kushwaha?source=rss-9473e0edc399------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 23:34:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nemchand.kushwaha/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[Azure Blob Storage]]></title>
            <link>https://medium.com/@nemchand.kushwaha/azure-blob-storage-363d21b5c7b9?source=rss-9473e0edc399------2</link>
            <guid isPermaLink="false">https://medium.com/p/363d21b5c7b9</guid>
            <dc:creator><![CDATA[Nemchand]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 17:43:47 GMT</pubDate>
            <atom:updated>2026-06-06T17:43:47.367Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In modern cloud architecture, data is the lifeblood of the enterprise. Whether you are building a high-throughput analytics engine, a cloud-native microservices application, or a robust disaster recovery pipeline, you need a storage foundation that is virtually limitless, highly durable, and secure.</p><p><strong>Azure Blob Storage</strong> is Microsoft’s object storage solution for the cloud. It is optimized for storing massive amounts of unstructured data — data that does not adhere to a particular data model or definition, such as text or binary data.</p><h3>Why Azure Blob Storage?</h3><p>From a business perspective, Azure Blob Storage eliminates the capital expenditure and operational overhead of managing physical SAN/NAS hardware. It offers:</p><ul><li><strong>Exabyte-Scale Elasticity:</strong> Scale up to hundreds of terabytes per account without provisioning disk space.</li><li><strong>High Availability and Durability:</strong> Up to 16 nines (99.99999999999999%99.99999999999999%) of durability using geo-redundant storage (GRS).</li><li><strong>Cost Optimization:</strong> Automated lifecycle management policies transition data to colder, cheaper tiers based on access patterns.</li></ul><h3>Target Use Cases</h3><ol><li><strong>Data Lakes &amp; Big Data Analytics:</strong> Serving as the underlying storage engine for Azure Synapse, Azure Databricks, and HDInsight via Azure Data Lake Storage Gen2 (ADLS Gen2) hierarchical namespaces.</li><li><strong>Backup and Disaster Recovery:</strong> Storing enterprise backups, database transaction logs, and archival data for compliance.</li><li><strong>Media Streaming &amp; Content Delivery:</strong> Serving images, documents, and video streams directly to web browsers via Azure CDN integration.</li><li><strong>Cloud-Native Application Data:</strong> Storing application logs, user-uploaded files, and state files.</li></ol><h3>Core Terminology</h3><p>To master Azure Blob Storage, you must understand its three-tier hierarchy:</p><pre>[ Storage Account ] ──&gt; [ Container ] ──&gt; [ Blob ]</pre><ul><li><strong>Storage Account:</strong> The unique, top-level namespace in Azure for your data. All data objects stored in Azure Storage are grouped together under a storage account.</li><li><strong>Container:</strong> A container organizes a set of blobs, similar to a directory in a file system. A storage account can contain an unlimited number of containers, and a container can store an unlimited number of blobs.</li><li><strong>Blob:</strong> An individual file of any type and size. Azure Storage supports three types of blobs:</li><li><strong>Block Blobs:</strong> Optimized for streaming and storing cloud objects (up to 4.75 TB per blob).</li><li><strong>Append Blobs:</strong> Optimized for append operations (e.g., continuous logging).</li><li><strong>Page Blobs:</strong> Optimized for random read/write operations (used for Azure VM virtual hard disks).</li></ul><h3>Architecture &amp; Mermaid Diagram</h3><p>In an enterprise production environment, Azure Blob Storage should never be exposed directly to the public internet. Instead, it must be integrated into a secure virtual network (VNet) using <strong>Private Endpoints</strong> and accessed securely via <strong>Azure Entra ID (formerly Azure Active Directory)</strong>.</p><p>The diagram below illustrates a secure, enterprise-grade integration of Azure Blob Storage within a hub-spoke network topology:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCA11R0xON8Fsy_Wxtms-Q.png" /></figure><h3>Architectural Flow Description</h3><ol><li><strong>Network Isolation:</strong> The application workload running inside the Spoke VNet communicates with the storage account using a private IP address mapped to a <strong>Private Endpoint</strong>.</li><li><strong>DNS Resolution:</strong> The application resolves the storage account’s fully qualified domain name (FQDN) to its private IP address using an Azure Private DNS Zone (privatelink.blob.core.windows.net).</li><li><strong>Identity-Based Access:</strong> The application uses its <strong>System-Assigned Managed Identity</strong> to request an OAuth 2.0 token from Azure Entra ID, completely eliminating the need to store connection strings or access keys in code.</li><li><strong>Data Encryption:</strong> All data is encrypted at rest using Customer-Managed Keys (CMK) stored securely in <strong>Azure Key Vault</strong>.</li><li><strong>Perimeter Security:</strong> The Storage Account firewall is configured to deny all traffic from the public internet, allowing access only from designated subnets and trusted Microsoft services.</li></ol><h3>Service Details &amp; Critical Components</h3><h3>1. Storage Account SKUs &amp; Redundancy Options</h3><p>Azure Storage offers different performance tiers and redundancy levels to balance cost, latency, and availability:</p><ul><li><strong>Standard Performance:</strong> Backed by magnetic hard drives (HDDs). Best for high-capacity, general-purpose workloads.</li><li><strong>Premium Performance:</strong> Backed by solid-state drives (SSDs). Offers single-digit millisecond latency. Premium is split into specific types: <em>Block Blobs</em>, <em>Page Blobs</em>, or <em>File Shares</em>.</li><li><strong>Redundancy Levels:</strong></li><li><strong>LRS (Locally Redundant Storage):</strong> Synchronously replicates data three times within a single physical facility in the primary region. Protects against disk/rack failure.</li><li><strong>ZRS (Zone-Redundant Storage):</strong> Synchronously replicates data across three Azure availability zones in the primary region. Protects against datacenter outages.</li><li><strong>GRS (Geo-Redundant Storage):</strong> Asynchronously replicates data to a secondary paired region hundreds of miles away.</li><li><strong>GZRS (Geo-Zone-Redundant Storage):</strong> Combines the high availability of ZRS in the primary region with geo-replication to a secondary region.</li></ul><h3>2. Network Security &amp; Private Link</h3><p>By default, storage accounts accept connections from clients on any network. To secure your data, you must configure:</p><ul><li><strong>Firewalls and Virtual Networks:</strong> Restrict access to specific public IP ranges or virtual network subnets.</li><li><strong>Private Endpoints:</strong> Assigns a private IP address from your VNet to the storage account, routing all traffic over the Microsoft backbone network instead of the public internet.</li><li><strong>TLS Configuration:</strong> Enforce a minimum TLS version of 1.2 or 1.3 for all incoming transit traffic.</li></ul><h3>3. Access Control &amp; Identity</h3><p>Managing access to your data should follow the principle of least privilege:</p><ul><li><strong>Azure Entra ID RBAC:</strong> The gold standard for storage security. Assign roles like Storage Blob Data Reader, Storage Blob Data Contributor, or Storage Blob Data Owner to security principals.</li><li><strong>Shared Access Signatures (SAS):</strong> Used for granting limited, time-bound access to specific containers or blobs without exposing account keys. Always use <strong>User Delegation SAS</strong> (backed by Entra ID credentials) rather than Service or Account SAS (backed by storage account keys).</li><li><strong>Storage Account Keys:</strong> Two 512-bit master keys. <em>Architectural Recommendation:</em> Disable Shared Key access entirely in production to enforce Entra ID authentication.</li></ul><h3>4. Lifecycle Management Policies</h3><p>To optimize costs, you can define rule-based policies to transition data to the most cost-effective access tier:</p><ul><li><strong>Hot Tier:</strong> Optimized for frequent access. High storage cost, low access cost.</li><li><strong>Cool Tier:</strong> Optimized for infrequently accessed data (stored for at least 30 days). Lower storage cost, higher access cost.</li><li><strong>Cold Tier:</strong> Optimized for rarely accessed data (stored for at least 90 days). Very low storage cost, high access cost.</li><li><strong>Archive Tier:</strong> Offline tier for historical data (stored for at least 180 days). Lowest storage cost, highest retrieval latency (hours).</li></ul><h3>Provisioning &amp; Creation Guide</h3><h3>Method A: Azure Portal (GUI)</h3><ol><li>Log in to the <strong>Azure Portal</strong> and search for <strong>Storage accounts</strong>, then click <strong>Create</strong>.</li><li><strong>Basics Tab:</strong></li></ol><ul><li>Select your <strong>Subscription</strong> and <strong>Resource Group</strong>.</li><li>Enter a globally unique <strong>Storage account name</strong> (lowercase letters and numbers only, 3–24 characters).</li><li>Select your <strong>Region</strong> (e.g., East US 2).</li><li>Performance: Select <strong>Standard</strong>.</li><li>Redundancy: Select <strong>Zone-redundant storage (ZRS)</strong>.</li></ul><ol><li><strong>Advanced Tab:</strong></li></ol><ul><li>Check <strong>Require secure transfer for REST API operations</strong>.</li><li>Check <strong>Allow enabling public access on individual containers</strong> -&gt; Set to <strong>Disabled</strong> (uncheck).</li><li>Set <strong>Minimum TLS version</strong> to <strong>Version 1.2</strong>.</li><li>Enable <strong>Hierarchical namespace</strong> if building a Data Lake (ADLS Gen2).</li></ul><ol><li><strong>Networking Tab:</strong></li></ol><ul><li>Network access: Select <strong>Disable public access and use private endpoints</strong>.</li><li>Click <strong>+ Add private endpoint</strong> to configure your Private Endpoint, mapping it to your target VNet and Subnet.</li></ul><ol><li><strong>Data Protection Tab:</strong></li></ol><ul><li>Enable <strong>Point-in-time restore for containers</strong>.</li><li>Enable <strong>Soft delete for blobs</strong> (set retention to 7 or 14 days).</li><li>Enable <strong>Soft delete for containers</strong>.</li></ul><ol><li><strong>Review + Create:</strong> Click <strong>Create</strong> after validation passes.</li></ol><h3>Method B: Azure CLI</h3><p>Below is a production-ready shell script to provision a secure Azure Storage Account and container.</p><pre>#!/usr/bin/env bash<br>set -euo pipefail</pre><pre># Variables<br>RESOURCE_GROUP=&quot;rg-enterprise-storage-prod&quot;<br>LOCATION=&quot;eastus2&quot;<br>STORAGE_ACCOUNT=&quot;saenterprisedatalakeprod001&quot;<br>CONTAINER_NAME=&quot;telemetry-data&quot;</pre><pre>echo &quot;Creating Resource Group...&quot;<br>az group create --name &quot;$RESOURCE_GROUP&quot; --location &quot;$LOCATION&quot;</pre><pre>echo &quot;Creating Storage Account with enterprise security defaults...&quot;<br>az storage account create \<br>    --name &quot;$STORAGE_ACCOUNT&quot; \<br>    --resource-group &quot;$RESOURCE_GROUP&quot; \<br>    --location &quot;$LOCATION&quot; \<br>    --sku Standard_ZRS \<br>    --kind StorageV2 \<br>    --min-tls-version TLS1_2 \<br>    --allow-blob-public-access false \<br>    --allow-shared-key-access false \<br>    --public-network-access Disabled \<br>    --https-only true \<br>    --assign-identity</pre><pre>echo &quot;Creating Blob Container...&quot;<br># Note: Since public network access is disabled, this command must be run <br># from a network that has access, or using &#39;--auth-mode login&#39; with appropriate RBAC.<br>az storage container create \<br>    --name &quot;$CONTAINER_NAME&quot; \<br>    --account-name &quot;$STORAGE_ACCOUNT&quot; \<br>    --auth-mode login</pre><pre>echo &quot;Storage Account $STORAGE_ACCOUNT successfully provisioned.&quot;</pre><h3>Method C: Terraform</h3><p>This Terraform configuration provisions a secure Storage Account, disables public access, configures network rules, and creates a container.</p><pre>terraform {<br>  required_version = &quot;&gt;= 1.5.0&quot;<br>  required_providers {<br>    azurerm = {<br>      source  = &quot;hashicorp/azurerm&quot;<br>      version = &quot;~&gt; 3.90.0&quot;<br>    }<br>  }<br>}</pre><pre>provider &quot;azurerm&quot; {<br>  features {}<br>}</pre><pre>variable &quot;location&quot; {<br>  type    = string<br>  default = &quot;eastus2&quot;<br>}</pre><pre>variable &quot;environment&quot; {<br>  type    = string<br>  default = &quot;prod&quot;<br>}</pre><pre>resource &quot;azurerm_resource_group&quot; &quot;rg&quot; {<br>  name     = &quot;rg-storage-${var.environment}-001&quot;<br>  location = var.location<br>}</pre><pre>resource &quot;azurerm_storage_account&quot; &quot;storage&quot; {<br>  name                     = &quot;sadata${var.environment}datalake001&quot;<br>  resource_group_name      = azurerm_resource_group.rg.name<br>  location                 = azurerm_resource_group.rg.location<br>  account_tier             = &quot;Standard&quot;<br>  account_replication_type = &quot;ZRS&quot;<br>  account_kind             = &quot;StorageV2&quot;</pre><pre>  # Security Hardening<br>  enable_https_traffic_only       = true<br>  min_tls_version                 = &quot;TLS1_2&quot;<br>  allow_nested_items_to_be_public = false<br>  shared_access_key_enabled       = false # Enforces Entra ID Auth<br>  public_network_access_enabled   = false # Traffic must go through Private Endpoint</pre><pre>  identity {<br>    type = &quot;SystemAssigned&quot;<br>  }</pre><pre>  lifecycle_rule {<br>    name    = &quot;archive-old-telemetry&quot;<br>    enabled = true<br>    filters {<br>      prefix_match = [&quot;telemetry-data/&quot;]<br>      blob_types   = [&quot;blockBlob&quot;]<br>    }<br>    actions {<br>      base_blob {<br>        tier_to_cool_after_days_since_modification_greater_than    = 30<br>        tier_to_archive_after_days_since_modification_greater_than = 90<br>        delete_after_days_since_modification_greater_than          = 365<br>      }<br>    }<br>  }</pre><pre>  tags = {<br>    Environment = var.environment<br>    ManagedBy   = &quot;Terraform&quot;<br>  }<br>}</pre><pre>resource &quot;azurerm_storage_container&quot; &quot;container&quot; {<br>  name                  = &quot;telemetry-data&quot;<br>  storage_account_name  = azurerm_storage_account.storage.name<br>  container_access_type = &quot;private&quot; # No public read access<br>}</pre><pre>output &quot;storage_account_id&quot; {<br>  value       = azurerm_storage_account.storage.id<br>  description = &quot;The ID of the provisioned Storage Account.&quot;<br>}</pre><h3>Real-World Example / Integration Code</h3><p>To interact with Azure Blob Storage securely without hardcoded credentials, we use the official Azure SDK for Python along with azure-identity for passwordless authentication.</p><h3>Prerequisites</h3><p>Install the required Python packages:</p><pre>pip install azure-storage-blob azure-identity</pre><h3>Python Implementation: Secure Blob Uploader</h3><p>This script authenticates using DefaultAzureCredential, which automatically resolves credentials from environment variables, managed identities, or developer CLI sessions.</p><pre>import os<br>import sys<br>from azure.identity import DefaultAzureCredential<br>from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient</pre><pre>def upload_file_to_blob(storage_account_name: str, container_name: str, source_file_path: str, destination_blob_name: str):<br>    &quot;&quot;&quot;<br>    Uploads a local file to an Azure Blob Storage container using Entra ID authentication.<br>    &quot;&quot;&quot;<br>    # Construct the secure endpoint URL<br>    account_url = f&quot;https://{storage_account_name}.blob.core.windows.net&quot;<br>    <br>    print(f&quot;Initializing connection to {account_url} using DefaultAzureCredential...&quot;)<br>    <br>    try:<br>        # DefaultAzureCredential handles Managed Identity, Environment Variables, and Azure CLI sign-ins<br>        credential = DefaultAzureCredential()<br>        <br>        # Instantiate the BlobServiceClient<br>        blob_service_client = BlobServiceClient(account_url, credential=credential)<br>        <br>        # Get a client to interact with the specific container<br>        container_client = blob_service_client.get_container_client(container_name)<br>        <br>        # Ensure container exists (will fail if user lacks permission to create/read)<br>        if not container_client.exists():<br>            print(f&quot;Container &#39;{container_name}&#39; does not exist. Attempting to create...&quot;)<br>            container_client.create_container()<br>            <br>        # Get a client to interact with the target blob<br>        blob_client = container_client.get_blob_client(destination_blob_name)<br>        <br>        print(f&quot;Uploading &#39;{source_file_path}&#39; to blob &#39;{destination_blob_name}&#39;...&quot;)<br>        with open(source_file_path, &quot;rb&quot;) as data:<br>            blob_client.upload_blob(data, overwrite=True)<br>            <br>        print(&quot;Upload completed successfully!&quot;)<br>        <br>    except Exception as e:<br>        print(f&quot;An error occurred during the upload process: {e}&quot;, file=sys.stderr)<br>        sys.exit(1)</pre><pre>if __name__ == &quot;__main__&quot;:<br>    # Replace these with your actual configuration values<br>    STORAGE_ACCOUNT = &quot;saenterprisedatalakeprod001&quot;<br>    CONTAINER = &quot;telemetry-data&quot;<br>    LOCAL_FILE = &quot;sample_payload.json&quot;<br>    BLOB_NAME = &quot;uploads/2024/05/payload.json&quot;<br>    <br>    # Create a dummy file for demonstration purposes<br>    with open(LOCAL_FILE, &quot;w&quot;) as f:<br>        f.write(&#39;{&quot;status&quot;: &quot;success&quot;, &quot;source&quot;: &quot;edge-device-01&quot;}&#39;)<br>        <br>    upload_file_to_blob(<br>        storage_account_name=STORAGE_ACCOUNT,<br>        container_name=CONTAINER,<br>        source_file_path=LOCAL_FILE,<br>        destination_blob_name=BLOB_NAME<br>    )<br>    <br>    # Clean up local file<br>    if os.path.exists(LOCAL_FILE):<br>        os.remove(LOCAL_FILE)</pre><h3>Best Practices &amp; Summary</h3><h3>1. Security First: Enforce Passwordless Authentication</h3><ul><li><strong>Action:</strong> Disable Shared Key access (shared_access_key_enabled = false in Terraform).</li><li><strong>Why:</strong> Shared keys grant full administrative access to the storage account and are prone to credential leakage. Enforcing Azure Entra ID RBAC ensures granular, auditable access control.</li></ul><h3>2. Network Isolation: Eliminate Public Endpoints</h3><ul><li><strong>Action:</strong> Set Public Network Access to Disabled and route all traffic through <strong>Private Endpoints</strong>.</li><li><strong>Why:</strong> This ensures your data is completely unreachable from the public internet, mitigating data exfiltration risks and DDoS attacks.</li></ul><h3>3. Enable Data Protection Features</h3><ul><li><strong>Action:</strong> Turn on <strong>Soft Delete</strong> for both blobs and containers, and enable <strong>Blob Versioning</strong>.</li><li><strong>Why:</strong> Protects against accidental deletion or malicious modification by allowing you to restore previous versions or deleted objects within a retention window.</li></ul><h3>4. Optimize Costs with Lifecycle Management</h3><ul><li><strong>Action:</strong> Implement policies to move data from Hot to Cool after 30 days, to Archive after 90 days, and delete old logs after a year.</li><li><strong>Why:</strong> Storage costs drop significantly (up to 90%) when moving data from the Hot tier to the Archive tier.</li></ul><h3>5. Monitor and Audit Access</h3><ul><li><strong>Action:</strong> Enable <strong>Azure Diagnostic Settings</strong> to stream Storage Read, Write, and Delete logs to a Log Analytics Workspace.</li><li><strong>Why:</strong> Provides full visibility into who accessed what data and when, which is critical for compliance and security forensics.</li></ul><h3>Summary</h3><p>Azure Blob Storage is a cornerstone of cloud architecture. By moving away from legacy access keys and public endpoints, and adopting <strong>Entra ID authentication</strong>, <strong>Private Link</strong>, and <strong>Infrastructure as Code (Terraform)</strong>, you can build a highly secure, resilient, and cost-optimized data platform capable of scaling to meet any enterprise demand.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=363d21b5c7b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing a SecretStore Vault in PowerShell]]></title>
            <link>https://medium.com/@nemchand.kushwaha/managing-a-secretstore-vault-449e38f52711?source=rss-9473e0edc399------2</link>
            <guid isPermaLink="false">https://medium.com/p/449e38f52711</guid>
            <dc:creator><![CDATA[Nemchand]]></dc:creator>
            <pubDate>Sat, 19 Oct 2024 10:56:45 GMT</pubDate>
            <atom:updated>2024-10-19T10:57:50.440Z</atom:updated>
            <content:encoded><![CDATA[<p>The SecretStore module is an extension vault for the PowerShell <strong>SecretManagement </strong>module. It stores secrets, locally, in files for the current user account context, and uses .NET crypto APIs to encrypt file contents. The <strong>SecretStore </strong>module has several configuration options. In the default configuration, a password is required to store and access secrets, and provides the strongest protection. <strong>SecretStore </strong>also supports the storage of metadata about secrets.</p><p>Use below command to install SecretStore &amp; SecretManagement module.</p><pre>Install-Module -Name Microsoft.PowerShell.SecretStore -Repository PSGallery -Force<br>Install-Module -Name Microsoft.PowerShell.SecretManagement -Repository PSGallery -Force<br>Import-Module Microsoft.PowerShell.SecretStore<br>Import-Module Microsoft.PowerShell.SecretManagement</pre><pre>Get-Command -Module Microsoft.PowerShell.SecretStore<br><br>Get-SecretStoreConfiguration    : Finds SecretStore configuration information and outputs the properties.<br>Reset-SecretStore               : Deletes secret data and resets the SecretStore to the default values.<br>Set-SecretStoreConfiguration    : Configures the SecretStore properties.<br>Set-SecretStorePassword         : Changes current SecretStore password with a new one.<br>Unlock-SecretStore              : Decrypts SecretStore with password.</pre><h3>Registering a new vault</h3><p>Before you can create new secret you must register a vault. The Name parameter is a friendly name and can be any valid string.</p><pre>Register-SecretVault -Name SecretStore -ModuleName Microsoft.PowerShell.SecretStore -DefaultVault</pre><p>Run <strong>Get-SecretVault</strong> to verify the vault named <strong>MySecret</strong> exists. It should return a value of True.</p><pre>Get-SecretVault<br><br>Name        ModuleName                       IsDefaultVault<br>----        ----------                       --------------<br>SecretStore Microsoft.PowerShell.SecretStore True</pre><p>To create a secret, run <strong>Set-Secret</strong> with a name and value. For example, to add a secret, execute the following command:</p><pre>Set-Secret -Name Password -Secret &quot;P@ssword&quot;</pre><p>Now that you have added the secrets you need to use Get- Secret command to access your secrets. Console will prompt or the Vault password. Enter correct Vault password then your secret value will be displayed.</p><p>You can use -AsPlainText parameter to see the secret as plain text.</p><pre>Get-Secret -Name Password<br>Vault MySecretStore requires a password.<br>Enter password:<br>***<br>System.Security.SecureString</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=449e38f52711" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EC2 Provisioning and Configuration with Terraform and Ansible]]></title>
            <link>https://medium.com/@nemchand.kushwaha/aws-ec2-provisioning-and-configuration-with-terraform-and-ansible-bd67760f8d62?source=rss-9473e0edc399------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd67760f8d62</guid>
            <dc:creator><![CDATA[Nemchand]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 21:43:09 GMT</pubDate>
            <atom:updated>2024-10-07T21:43:09.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*DFfpyzg4H86FhgFVrykPNQ.png" /></figure><h3>Task:</h3><p>The following tasks outline the process of provisioning and infrastructure using Terraform and parameterized Jenkins job: </p><ul><li>Configure Terraform with new ssh key which will be used as key pair for launching VMs Write Terraform script to provision and empty sandbox  Add various setting to the sandbox like VPC, security group, route table, subnets, and key pair </li><li>Create Ansible playbook which will be invoked by Terraform for configuration management operations </li><li>Executing Terraform script with the created keys to establish connection and configure the provisioned VM</li></ul><h3>Steps1:</h3><p>Write the Terraform configuration file.</p><pre># Local values - to be used during resource creation<br>locals { <br> ami_id = &quot;ami-0a0e5d9c7acc336f1&quot;<br> ssh_user = &quot;ubuntu&quot;<br>} <br># Provider section<br>provider &quot;aws&quot; { <br> #access_key = &quot;&quot;<br> #secret_key = &quot;&quot;<br> region = &quot;us-east-1&quot;<br>} <br># Create AWS VPC<br>resource &quot;aws_vpc&quot; &quot;sl-vpc&quot; { <br> cidr_block = &quot;10.0.0.0/16&quot;<br> tags = { <br> Name = &quot;sl-vpc&quot;<br> } <br>} <br># Create AWS Subnet<br>resource &quot;aws_subnet&quot; &quot;subnet-1&quot; { <br> vpc_id = aws_vpc.sl-vpc.id<br> cidr_block = &quot;10.0.1.0/24&quot;<br> map_public_ip_on_launch = true<br> depends_on = [aws_vpc.sl-vpc] <br> tags = { <br> Name = &quot;sl-subnet&quot;<br> } <br>} <br># Create AWS Route Table<br>resource &quot;aws_route_table&quot; &quot;sl-route-table&quot; { <br> vpc_id = aws_vpc.sl-vpc.id<br> tags = { <br> Name = &quot;sl-route-table&quot;<br> } <br>} <br># Create AWS Route Table Association<br>resource &quot;aws_route_table_association&quot; &quot;a&quot; { <br> subnet_id = aws_subnet.subnet-1.id<br> route_table_id = aws_route_table.sl-route-table.id<br>} <br># Create AWS Internet Gateway<br>resource &quot;aws_internet_gateway&quot; &quot;gw&quot; { <br> vpc_id = aws_vpc.sl-vpc.id<br> depends_on = [aws_vpc.sl-vpc] <br> tags = { <br> Name = &quot;sl-gw&quot;<br> } <br>} <br># Create AWS Route<br>resource &quot;aws_route&quot; &quot;sl-route&quot; { <br> route_table_id = aws_route_table.sl-route-table.id<br> destination_cidr_block = &quot;0.0.0.0/0&quot;<br> gateway_id = aws_internet_gateway.gw.id<br>} <br># AWS security group resource block - 3 inbound &amp; 1 outbound rule added<br>resource &quot;aws_security_group&quot; &quot;sl-sg&quot; { <br> name = &quot;sl-sg&quot;<br> vpc_id = aws_vpc.sl-vpc.id<br> ingress { <br> from_port = 22<br> to_port = 22<br> protocol = &quot;tcp&quot;<br> cidr_blocks = [&quot;0.0.0.0/0&quot;] <br> } <br> ingress { <br> from_port = 80<br> to_port = 80<br> protocol = &quot;tcp&quot;<br> cidr_blocks = [&quot;0.0.0.0/0&quot;] <br> } <br> ingress { <br> from_port = 443<br> to_port = 443<br> protocol = &quot;tcp&quot;<br> cidr_blocks = [&quot;0.0.0.0/0&quot;] <br> } <br> egress { <br> from_port = 0<br> to_port = 0<br> protocol = &quot;-1&quot;<br> cidr_blocks = [&quot;0.0.0.0/0&quot;] <br> } <br> tags = { <br> Name = &quot;sl-sg&quot;<br> } <br>} <br># TLS provider<br>resource &quot;tls_private_key&quot; &quot;tls-key&quot; { <br> algorithm = &quot;RSA&quot;<br>} <br># AWS Keypair with TLS<br>resource &quot;aws_key_pair&quot; &quot;app-key&quot; { <br> key_name = &quot;sl-key&quot;<br> public_key = tls_private_key.tls-key.public_key_openssh<br>} <br># Saving the key file<br>resource &quot;local_file&quot; &quot;sl-key&quot; { <br> content = tls_private_key.tls-key.private_key_pem<br> filename = &quot;sl-key.pem&quot;<br> file_permission = &quot;0400&quot;<br>} <br>resource &quot;aws_instance&quot; &quot;web&quot; { <br> ami = local.ami_id<br> instance_type = &quot;t2.micro&quot;<br> associate_public_ip_address = true<br> subnet_id = aws_subnet.subnet-1.id<br> security_groups = [aws_security_group.sl-sg.id] <br> key_name = aws_key_pair.app-key.key_name<br> tags = { <br> Name = &quot;Infra pro&quot;<br> } <br> # SSH Connection block which will be used by the provisioners - remote-exec<br> connection { <br> type = &quot;ssh&quot;<br> host = self.public_ip<br> user = local.ssh_user<br> # private_key = file(local.private_key_path)<br> private_key = tls_private_key.tls-key.private_key_pem<br> timeout = &quot;2m&quot;<br> } <br> # Step 1: Copy the local file to the remote machine&#39;s temporary location<br> provisioner &quot;file&quot; { <br> source = &quot;~/.ssh/id_rsa.pub&quot; # Local file path<br> destination = &quot;/home/ubuntu/temp-file.txt&quot; # Temporary file location on remote<br> } <br> # Remote-exec Provisioner Block - wait for SSH connection<br> provisioner &quot;remote-exec&quot; { <br> inline = [ <br> &quot;echo &#39;wait for SSH connection to be ready...&#39;&quot;, <br> &quot;touch /home/ubuntu/demo-file-from-terraform.txt&quot;, <br> &quot;cat /home/ubuntu/temp-file.txt &gt;&gt; ~/.ssh/authorized_keys&quot;, # Append local <br>content to the remote file<br> &quot;rm /home/ubuntu/temp-file.txt&quot; # Optional: Clean up temporary file after <br>appending<br> ] <br> } <br> # Local-exec Provisioner Block - create an Ansible Dynamic Inventory<br> provisioner &quot;local-exec&quot; { <br> command = &quot;echo ${self.public_ip} &gt;&gt; myhosts&quot;<br> } <br> # Local-exec Provisioner Block - create an Ansible Dynamic Inventory<br> provisioner &quot;local-exec&quot; { <br> command = &quot;echo Hello_Me &gt; hello.txt&quot;<br> working_dir = &quot;${path.module}/&quot;<br> interpreter = [&quot;/bin/bash&quot;, &quot;-c&quot;] <br> } <br>} <br># Output block to print the public ip of instance<br>output &quot;instance_ip&quot; { <br> value = aws_instance.web.public_ip</pre><h3>Code Description:</h3><p>This Terraform code automates the provisioning of AWS infrastructure, including a VPC, subnet, route table, security group, EC2 instance, and key management. Here’s a breakdown of each section:</p><p><strong>Local Values</strong>:</p><ul><li>Defines two local values: ami_id for the AMI (Amazon Machine Image) ID, and ssh_user for the SSH user, in this case, “ubuntu.”</li></ul><p><strong>Provider Configuration</strong>:</p><ul><li>Specifies the AWS provider and sets the region to “us-east-1.” Credentials (access_key and secret_key) are commented out, implying they are provided elsewhere, such as via environment variables or an AWS credentials file.</li></ul><p><strong>VPC Creation</strong>:</p><ul><li>A VPC (Virtual Private Cloud) is created with a CIDR block of 10.0.0.0/16 and tagged as sl-vpc.</li></ul><p><strong>Subnet Creation</strong>:</p><ul><li>A subnet is created within the VPC with a CIDR block of 10.0.1.0/24. It automatically assigns public IP addresses to instances launched in it.</li></ul><p><strong>Route Table and Association</strong>:</p><ul><li>A route table (sl-route-table) is created for the VPC, and the subnet is associated with this route table.</li><li>A default route (0.0.0.0/0) is created to allow outbound traffic via the internet gateway.</li></ul><p><strong>Internet Gateway</strong>:</p><ul><li>An internet gateway is created and attached to the VPC, allowing internet access.</li></ul><p><strong>Security Group</strong>:</p><ul><li>A security group is created with three inbound rules (allowing SSH on port 22, HTTP on port 80, and HTTPS on port 443) and one outbound rule (allowing all traffic).</li></ul><p><strong>TLS Key and Keypair</strong>:</p><ul><li>A TLS private key is generated using the RSA algorithm.</li><li>An AWS key pair is created using the public key generated from the TLS private key.</li><li>The private key is saved locally in the file sl-key.pem with restricted permissions.</li></ul><p><strong>EC2 Instance</strong>:</p><ul><li>An EC2 instance is created using the defined AMI ID, within the subnet and security group. The instance is tagged as Infra pro.</li><li>The instance is connected via SSH using the private key, and multiple provisioners are defined:</li><li><strong>File Provisioner</strong>: Copies a local file to the remote instance.</li><li><strong>Remote-exec</strong>: Waits for the SSH connection, creates a demo file on the remote machine, and appends local content to the authorized_keys file.</li><li><strong>Local-exec</strong>: Updates a local Ansible inventory with the instance’s public IP and creates a local hello.txt file.</li></ul><p><strong>Output</strong>:</p><ul><li>Outputs the public IP of the EC2 instance to the console after deployment.</li></ul><p>This setup automates the creation and configuration of network components and an EC2 instance, including SSH setup, file transfers, and key management.</p><h3><strong>Setp2</strong>:</h3><p>Install awscli and boto2 module</p><p>$ pip install awscli</p><p>$ pip install boto3</p><h3><strong>Setp3</strong>:</h3><p>Configure AWS secrets and access key: using below command.</p><p>$ aws configure</p><h3><strong>Step4</strong>:</h3><p>Crate python file with below code: This file will be used to generate the dynamic inventory.</p><pre>#!/usr/bin/env python<br><br>import boto3<br>import json<br><br>def get_ec2_instances():<br>    # Create an EC2 resource<br>    ec2 = boto3.resource(&#39;ec2&#39;, region_name=&#39;us-east-1&#39;)<br><br>    # Retrieve a list of running instances<br>    instances = ec2.instances.filter(Filters=[{&#39;Name&#39;: &#39;instance-state-name&#39;, &#39;Values&#39;: [&#39;running&#39;]}])<br>    inventory = {&#39;all&#39;: {&#39;hosts&#39;: []}}<br><br>    # Iterate over the instances<br>    for instance in instances:<br>        instance_name = None<br>        # Get the instance&#39;s tags<br>        if instance.tags:<br>            for tag in instance.tags:<br>                if tag[&#39;Key&#39;] == &#39;Name&#39;:<br>                    instance_name = tag[&#39;Value&#39;]<br>                    break<br>        <br>        # Add instance details to the inventory<br>        #inventory[&#39;all&#39;][&#39;hosts&#39;].append(instance.public_dns_name)<br>        inventory[&#39;all&#39;][&#39;hosts&#39;].append(instance.public_ip_address)<br><br>    return inventory<br><br>if __name__ == &quot;__main__&quot;:<br>    inventory = get_ec2_instances()<br>    print(json.dumps(inventory, indent=2))</pre><p>Code Description:</p><p>This Python script, designed for use in an AWS environment, retrieves a list of running EC2 instances and generates a simple inventory in JSON format, which is useful for tools like Ansible. Below is a detailed breakdown of the code:</p><p><strong>1. Imports:</strong></p><ul><li>boto3: The official AWS SDK for Python, used here to interact with AWS services like EC2.</li><li>json: A standard Python library to work with JSON data (for printing the inventory in JSON format).</li></ul><p><strong>2. get_ec2_instances() Function:</strong></p><ul><li><strong>Purpose</strong>: This function retrieves all running EC2 instances in the specified AWS region (us-east-1) and returns their public IP addresses in a JSON inventory format.</li><li><strong>Steps</strong>:</li></ul><ol><li><strong>Create an EC2 resource</strong>:</li></ol><ul><li>ec2 = boto3.resource(‘ec2’, region_name=’us-east-1&#39;): Creates an EC2 resource object that allows interaction with EC2 instances in the us-east-1 region.</li></ul><ol><li><strong>Filter running EC2 instances</strong>:</li></ol><ul><li>instances = ec2.instances.filter(Filters=[{‘Name’: ‘instance-state-name’, ‘Values’: [‘running’]}]): Filters and retrieves only the EC2 instances that are currently in a running state.</li></ul><ol><li><strong>Initialize inventory dictionary</strong>:</li></ol><ul><li>inventory = {‘all’: {‘hosts’: []}}: Initializes an empty dictionary with a structure that Ansible understands. It includes a group all containing the hosts list, where the EC2 instance details will be stored.</li></ul><ol><li><strong>Iterate over instances</strong>:</li></ol><ul><li>For each running EC2 instance:</li><li>The script checks if the instance has a tag with the key Name to retrieve a human-readable identifier for the instance.</li><li>It then appends the instance’s public IP address to the hosts list under inventory[‘all’][‘hosts’]. (The commented-out line suggests that the script can also use public_dns_name instead.)</li></ul><p><strong>3. Main Block:</strong></p><ul><li>When the script is executed directly, it calls get_ec2_instances() and prints the JSON output in a pretty-printed format (indent=2).</li></ul><p><strong>Functionality:</strong></p><ul><li>This script dynamically fetches information about running EC2 instances in the us-east-1 region, creating a JSON output in a format suitable for Ansible inventories. This inventory can be used by tools like Ansible to run automated tasks on these EC2 instances.</li></ul><h3>Running the python code:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mqy1bVwJLVeguCM75Eahzw.png" /></figure><h3><strong><em>Step5</em></strong><em>:</em></h3><p><em>Write a ansible play book with below code to install and configure Nginx server.</em></p><pre># nginx-install.yml<br>---<br>- name: Install NGINX on EC2 Instances<br>  hosts: all<br>  become: true<br>  tasks:<br>    - name: Ensure NGINX is installed<br>      apt:<br>        name: nginx<br>        state: present<br>        update_cache: true<br><br>    - name: Start and enable NGINX service<br>      service:<br>        name: nginx<br>        state: started<br>        enabled: true</pre><p>Code Description:</p><p>This Ansible playbook, nginx-install.yml, automates the installation and configuration of the NGINX web server on remote EC2 instances. Here’s a breakdown of its structure:</p><ol><li><strong>Playbook Definition</strong>:</li></ol><ul><li>The playbook is titled Install NGINX on EC2 Instances.</li><li>hosts: all: The playbook targets all hosts defined in the Ansible inventory.</li><li>become: true: This enables privilege escalation (similar to using sudo) to execute tasks with elevated permissions on the remote hosts.</li></ul><ol><li><strong>Tasks Section</strong>: The playbook contains two tasks:</li></ol><ul><li><strong>Task 1: Ensure NGINX is installed</strong>:</li><li>Uses the apt module (for Debian/Ubuntu-based systems) to ensure that the NGINX package is installed.</li><li>name: nginx: Specifies the package to install.</li><li>state: present: Ensures NGINX is installed. If it’s not present, it will be installed.</li><li>update_cache: true: Updates the package cache before attempting the installation to ensure the latest version is fetched.</li><li><strong>Task 2: Start and enable NGINX service</strong>:</li><li>Uses the service module to manage the NGINX service.</li><li>state: started: Ensures that the NGINX service is running.</li><li>enabled: true: Ensures that the NGINX service is enabled to start on boot.</li></ul><p>This playbook automates both the installation and initialization of NGINX on target EC2 instances, ensuring the web server is always installed, running, and set to start automatically after reboot.</p><h3><em>Running the nginx-install.yml:</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjhVnjMrz3p22F_pF1Y0Rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkzkHIQv69LptEWn5E9D9A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd67760f8d62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform Modules]]></title>
            <link>https://medium.com/@nemchand.kushwaha/terraform-modules-9d24c6e58f4b?source=rss-9473e0edc399------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d24c6e58f4b</guid>
            <category><![CDATA[terraform-modules]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Nemchand]]></dc:creator>
            <pubDate>Thu, 03 Oct 2024 10:46:05 GMT</pubDate>
            <atom:updated>2024-10-03T10:46:05.632Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>Terraform module</strong> is a collection of standard configuration files in a dedicated directory. These files typically include:</p><ul><li><strong>main.tf</strong>: Contains the primary configuration.</li><li><strong>variables.tf</strong>: Defines input variables.</li><li><strong>outputs.tf</strong>: Specifies output values.</li><li><strong>README.md</strong>: Provides documentation for the module.</li></ul><h3><strong>Types of Terraform Modules</strong></h3><ol><li><strong>Root Module</strong>: This is the main working directory where you run Terraform commands. Any configuration in this directory is considered the root module.</li><li><strong>Child Module</strong>: These are modules called from within the root module or other modules. They help in organizing and reusing code.</li></ol><h3><strong>How Do Terraform Modules Work?</strong></h3><ol><li><strong>Encapsulation</strong>: Modules encapsulate groups of resources dedicated to a specific task, reducing the amount of code you need to write for similar infrastructure components<a href="https://spacelift.io/blog/what-are-terraform-modules-and-how-do-they-work">1</a>.</li><li><strong>Reusability</strong>: By grouping resources into modules, you can reuse these configurations across different parts of your infrastructure. For example, you can create a module for a virtual server and reuse it to deploy multiple servers with the same configuration<a href="https://www.freecodecamp.org/news/terraform-modules-explained/">2</a>.</li><li><strong>Abstraction</strong>: Modules provide a way to create logical abstractions on top of resource sets. This means you can group related resources together and manage them as a single unit<a href="https://www.freecodecamp.org/news/terraform-modules-explained/">2</a>.</li><li><strong>Compliance</strong>: Modules can enforce compliance by hard-coding certain configurations, such as encryption settings, ensuring that every time the module is used, the configurations are applied consistently<a href="https://spacelift.io/blog/what-are-terraform-modules-and-how-do-they-work">1</a>.</li></ol><h3><strong>Example Usage</strong></h3><p>Here’s a simple example of how you might use a module in your Terraform configuration:</p><pre>module &quot;server&quot; {<br>source = &quot;./modules/server&quot;<br>count = 5<br>some_variable = &quot;some_value&quot;<br>}</pre><p><em>In this example, the </em><em>server module is called with a count of 5, meaning it will create five instances of the server configuration defined in the </em><em>./modules/server directory2</em></p><h3><em>Practical LAB</em></h3><p>This is how the directory structure looks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*3Ul6EklbwXVIG2O6stvk5g.png" /></figure><p><strong>main.tf</strong></p><pre>provider &quot;aws&quot; {<br>region = &quot;us-east-1&quot;<br>}<br>module &quot;ec2_instance&quot; {<br>source = &quot;./modules/ec2_instance&quot;<br>ami_value = &quot;ami-0866a3c8686eaeeba&quot;<br>instancetype_value = &quot;t2.micro&quot;<br>}</pre><p><strong>module\ec2_instance\main.tf</strong></p><pre>provider &quot;aws&quot; {<br>region = &quot;us-east-1&quot;<br>}<br>resource &quot;aws_instance&quot; &quot;example&quot; {<br>ami = var.ami_value<br>instance_type = var.instancetype_value<br>}</pre><p><strong>module\ec2_instance\outpus.tf</strong></p><pre>output &quot;public_ip&quot; {<br>value = aws_instance.example.public_ip<br>}</pre><p><strong>module\ec2_instance\variables.tf</strong></p><pre>variable &quot;ami_value&quot; {<br>description = &quot;value for the ami&quot;<br>}<br>variable &quot;instancetype_value&quot; {<br>description = &quot;value for instance type&quot;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d24c6e58f4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform Workspace]]></title>
            <link>https://medium.com/@nemchand.kushwaha/terraform-workspace-11d004e5b7ae?source=rss-9473e0edc399------2</link>
            <guid isPermaLink="false">https://medium.com/p/11d004e5b7ae</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terraform-workspace]]></category>
            <dc:creator><![CDATA[Nemchand]]></dc:creator>
            <pubDate>Thu, 03 Oct 2024 04:26:13 GMT</pubDate>
            <atom:updated>2024-10-03T04:26:13.512Z</atom:updated>
            <content:encoded><![CDATA[<p>Terraform workspaces help organize infrastructure by environments and variables within a single directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*gMgB3ztt3a6aTGOtWTQ7cA.gif" /></figure><h3>Given below are the features of Terraform workspace:</h3><p><strong>Environment Segregation</strong>: Manage multiple environments (for example, dev, staging, production) within the same configuration</p><p><strong>State Separation: </strong>Maintain isolated states, preventing changes in one from affecting another</p><p><strong>Reduced Code Duplication: </strong>You can manage multiple environments with a single configuration file, reducing code duplication and making it easier to maintain and update your infrastructure</p><p><strong>Modular Infrastructure</strong>: Workspaces help in converting monolithic infrastructure into modular infrastructure, which simplifies management and reduces the surface area and impact of errors</p><h3>Command Structure of Terraform Workspaces</h3><p><em>$</em> <em>terraform workspace list</em>: <strong>Lists all available workspaces</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*vwWOvpXNfdas1KBBzJgMew.png" /></figure><p><em>$</em> <em>terraform workspace delete</em>: <strong>Deletes an existing workspace</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*VEZuBjeattnTUyx1qlO8fw.png" /></figure><p><em>$</em> <em>terraform workspace new</em>: <strong>Creates a new workspace</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*OAY0p7JzlXo31oIrQii6Rw.png" /></figure><p><em>$</em> <em>terraform workspace show</em>: <strong>Displays the current workspace</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*KXto1r1sg67FGTw5GwSSpg.png" /></figure><p><em>$</em> <em>terraform workspace delete</em>: <strong>Delete workspace</strong></p><p>To delete a workspace, it must already exist, it must not be tracking resources, and it must not be your current workspace. If the workspace is tracking resources, Terraform will not allow you to delete it unless the -force flag is specified</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*wuyyrPDq-i3kFiFbL44iEQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11d004e5b7ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Jenkins Plugin using URL]]></title>
            <link>https://medium.com/@nemchand.kushwaha/install-jenkins-plugin-using-url-9511dd79e024?source=rss-9473e0edc399------2</link>
            <guid isPermaLink="false">https://medium.com/p/9511dd79e024</guid>
            <category><![CDATA[jenkins-plugins]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Nemchand]]></dc:creator>
            <pubDate>Wed, 17 Jul 2024 10:18:49 GMT</pubDate>
            <atom:updated>2024-07-17T10:18:49.509Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*0e5yhCsn5Tgs_7SHsQOofg.png" /><figcaption>Install Jenkins Plugin using URL</figcaption></figure><p>To install a Jenkins plugin using a URL, follow these steps:</p><p>1. <strong>Open Jenkins Dashboard and Navigate to Plugin Manager</strong>:</p><ul><li>Go to `Manage Jenkins` &gt; `Manage Plugins`.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*Uv3eTBDmiFYs-1FfuesFyA.png" /></figure><p><strong>2. Advanced Settings:</strong></p><ul><li>Click on the `Advanced` tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*AW-ET9od7vTDISyzMHoeSA.png" /></figure><p><strong>3. Under <em>Advance settings</em> go Deploy <em>Plugin session</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*WitW79bSjRR0poMNezJ0ig.png" /></figure><p><strong>4. Use the plugin URL which you want to install and then click on deploy button. In my case I am install <em>artifactory</em> plugin version <em>4.0.6.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*38r6c6RaeTWgEQx0ER9zVw.png" /></figure><p><strong>5. Restart Jenkins (if necessary):</strong></p><p>- Some plugins require Jenkins to be restarted to complete the installation process.</p><h3>How to find the Plugin URL</h3><ol><li><strong>Navigate to </strong><a href="https://plugins.jenkins.io/"><strong>https://plugins.jenkins.io</strong></a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CF2PzgkGAo30_ynE7Y9fZw.png" /></figure><p><strong>2. Type the plugin name you are searching for. In my case I am using Artifactory and click on search button.</strong></p><p><strong>3. Select the one you are looking for:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_t899vYgQxp9-Jfz70kBDA.png" /></figure><p><strong>4. You will be redirected to the plugin detail page. Select the Releases link:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49OfSI2Ya7A63HLlq2gtWw.png" /></figure><p><strong>5. Choose the appropriate plugin version and copy the URL as below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRCoOezd7v2aeoqy6xe5PQ.png" /></figure><p><strong>6. URL should be should end with .hpi or .jpi as below:</strong></p><p><a href="https://updates.jenkins.io/download/plugins/artifactory/4.0.6/artifactory.hpi"><strong><em>https://updates.jenkins.io/download/plugins/artifactory/4.0.6/artifactory.hpi</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9511dd79e024" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>