<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harnoor Puniyani</title>
    <description>The latest articles on DEV Community by Harnoor Puniyani (@harnoorpuniyani).</description>
    <link>https://dev.to/harnoorpuniyani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F478333%2F12baeb98-ada0-409e-944f-7010263bf7f2.jpg</url>
      <title>DEV Community: Harnoor Puniyani</title>
      <link>https://dev.to/harnoorpuniyani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harnoorpuniyani"/>
    <language>en</language>
    <item>
      <title>Understanding Azure Service Bus: How to Manage Routing, Sessions, and Atomicity</title>
      <dc:creator>Harnoor Puniyani</dc:creator>
      <pubDate>Sat, 18 Oct 2025 09:25:39 +0000</pubDate>
      <link>https://dev.to/harnoorpuniyani/understanding-azure-service-bus-how-to-manage-routing-sessions-and-atomicity-4539</link>
      <guid>https://dev.to/harnoorpuniyani/understanding-azure-service-bus-how-to-manage-routing-sessions-and-atomicity-4539</guid>
      <description>&lt;p&gt;When I first used Azure Service Bus, I thought it was “just a queue.” It’s much more: routing, ordering, retries, DLQ, and transactions—useful for high‑volume, near real‑time, stateful integrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Service Bus in 60 seconds
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Queues: point‑to‑point&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Topics &amp;amp; Subscriptions: pub/sub with SQL filters on message properties&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sessions: FIFO per key (keeps order for a customer/order)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Retries &amp;amp; DLQ: automatic retries; poison messages move to DLQ&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extras: duplicate detection, scheduled delivery, deferral, transactions&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Using Service Bus in Modern Architectures
&lt;/h2&gt;

&lt;p&gt;I’m highlighting three common use cases that are easily handled with queues and topics.&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Event‑Driven Architecture with Routed Messages
&lt;/h3&gt;

&lt;p&gt;Scenario: accept requests, fan‑out by properties, and keep downstreams isolated.&lt;/p&gt;

&lt;p&gt;For an asynchronous inbound flow, expose a Topic where a client can send messages. Based on custom metadata (for example, a &lt;code&gt;type&lt;/code&gt; property), if &lt;code&gt;type&lt;/code&gt; is &lt;code&gt;ERP_PRODUCT_MASTER&lt;/code&gt; it goes to the product subscription; if &lt;code&gt;type&lt;/code&gt; is &lt;code&gt;ERP_CUSTOMER_MASTER&lt;/code&gt; it goes to the customer subscription. Messages are filtered into their respective subscriptions. If a subscription needs to receive all events, omit the filter—product events will go to both the logs subscription and the product subscription, and similarly for customer events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5dtvbsmi59uabs4pps4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5dtvbsmi59uabs4pps4.png" alt="High level Event Driven architecture flow" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Sessions as a Keyed Index (the “HashMap” trick)
&lt;/h3&gt;

&lt;p&gt;Docs focus on sessions for strict ordering. You can also use a session as a single‑item, keyed bucket for quick lookups.&lt;/p&gt;

&lt;p&gt;Imagine a transactional flow where you store the data in Service Bus and keep only a reference to that message in the client system. When the client later sends the reference, you need to fetch the message from Service Bus. The simplest method is to use sessions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Set &lt;code&gt;SessionId&lt;/code&gt; to a business key (e.g., &lt;code&gt;REF-123&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Store one message per session (acts like key → value)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The consumer accepts the session with that ID to fetch the message directly&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;No scanning/deferring through many messages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Avoids long lock durations while you hunt for the right payload&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3) Transactional Atomicity
&lt;/h3&gt;

&lt;p&gt;Goal: process a batch atomically; complete only on success.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Receive in peek‑lock, do work, then &lt;code&gt;complete&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On transient failure: &lt;code&gt;abandon&lt;/code&gt; (retry)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On business retry later: &lt;code&gt;defer&lt;/code&gt; (preserve for targeted pickup)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On poison: let it exceed max deliveries → DLQ&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tune &lt;code&gt;MaxDeliveryCount&lt;/code&gt; to balance retries vs. fast DLQ&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Renew locks if processing may exceed &lt;code&gt;LockDuration&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make handlers idempotent (at‑least‑once delivery)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Ops and Security Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Enable duplicate detection if producers can retry sends&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alert on DLQ &amp;gt; 0, retry spikes, handler failures&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prefer Premium + private endpoints/VNet where possible&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use Managed Identities/App Registrations over SAS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Log &lt;code&gt;CorrelationId&lt;/code&gt; and business keys; avoid payload logging&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thanks for reading. If you want configuration‑focused examples (Functions/Logic Apps, sessions, filters, or DLQ replay), let me know.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>microservices</category>
      <category>architecture</category>
      <category>devops</category>
    </item>
    <item>
      <title>Create Multi Architecture Images using Docker with Azure DevOps CICD</title>
      <dc:creator>Harnoor Puniyani</dc:creator>
      <pubDate>Thu, 03 Jul 2025 15:08:01 +0000</pubDate>
      <link>https://dev.to/harnoorpuniyani/create-multi-architecture-images-using-docker-with-azure-devops-cicd-4267</link>
      <guid>https://dev.to/harnoorpuniyani/create-multi-architecture-images-using-docker-with-azure-devops-cicd-4267</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Whenever we create the Docker images, mostly it would be for dev-test purposes or to create a production ready images for the kubernetes. Either of the scenarios, we need the images to built on multi architecture so either they can be deployed on different nodes not limited by the architecture and we can also share our images to the different people.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prepare Application
&lt;/h3&gt;

&lt;p&gt;In this example I would be using a python based flask application, which just displays a welcome message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptdoru7mpj6ikxwt63oi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptdoru7mpj6ikxwt63oi.png" alt="Flask Application Frontend UI" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tools
&lt;/h3&gt;

&lt;p&gt;Ideally this can be achieved using various methods, but the easiest and the fastest thing to do would be to use the docker buildx plugin.&lt;/p&gt;

&lt;p&gt;I am using a debian based instance so the steps for installing docker are listed &lt;a href="https://docs.docker.com/engine/install/debian/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PS: Even after installing, &lt;code&gt;docker buildx version&lt;/code&gt; does not work, then try doing &lt;code&gt;docker&lt;/code&gt; it would show if there's any error loading the plugin, for me it was not able to access the plugin files, so I just sudoed as any root user should :p &lt;code&gt;sudo docker buildx version&lt;/code&gt; and it worked.&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure DevOps
&lt;/h3&gt;

&lt;p&gt;Step 0: Create an account on the docker hub, and have the generate the access token, or configure any other registry for that matter.&lt;/p&gt;

&lt;p&gt;Step 1: Make sure you have created the service connection to the docker hub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l95ahxkb9ag79c6zq0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l95ahxkb9ag79c6zq0y.png" alt="Azure Devops Service Connection" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Create a git repo for your application with the Dockerfile, make sure in this app you do not have any credentials or secrets embedded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffc7zqiy6ic31em4p7wvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffc7zqiy6ic31em4p7wvg.png" alt="Repository Structure" width="291" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Lets create a CICD&lt;/p&gt;

&lt;p&gt;Step 4: Use the action docker install Cli, you can give any version or the latest version. To get the list of the docker versions, refer the documentation &lt;a href="https://docs.docker.com/engine/release-notes/28/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 5: Verify if the docker buildx is installed, probably using a script which says version &lt;code&gt;docker buildx version&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Step 6: Now, we can proceed with creating our own builder, as we want our builder to work for multiple architectures/ platform hence we are using a custom builder.&lt;/p&gt;

&lt;p&gt;Step 7: Once the builder is created, lets put it to build, remember that the built images remain local to the builder only unless we push it to the registry, alternatively you can also load it into the docker if its not a multi-architecture image&lt;/p&gt;

&lt;p&gt;Step 8: That's it for the building, but as a next step you can use image scanners, to scan them for any vulnerabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  CICD YAML
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;master&lt;/span&gt;

&lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;self&lt;/span&gt;

&lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;basetag&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;user/imageName'&lt;/span&gt;
  &lt;span class="na"&gt;buildtag&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(Build.BuildNumber)'&lt;/span&gt;
  &lt;span class="na"&gt;latesttag&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;latest'&lt;/span&gt;

&lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
  &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build image&lt;/span&gt;
  &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;job&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
    &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
    &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;vmImage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DockerInstaller@0&lt;/span&gt;
      &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;dockerVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;28.3.0'&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker buildx version&lt;/span&gt;
      &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check docker buildx&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Docker@2&lt;/span&gt;
      &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;containerRegistry&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;docker-harnoorpuniyani'&lt;/span&gt;
        &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;login'&lt;/span&gt;
        &lt;span class="na"&gt;addPipelineData&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
        &lt;span class="na"&gt;addBaseImageData&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;docker buildx create --use --name builder&lt;/span&gt;
      &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;create Buildx Builder&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;docker buildx build --platform linux/amd64,linux/arm64 -t '$(basetag):$(buildtag)' -t '$(basetag):$(latesttag)' . --push&lt;/span&gt;
      &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create and Push Multi Architecture Image&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;Github Repo - &lt;a href="https://github.com/harnoor-puniyani/echo-app" rel="noopener noreferrer"&gt;harnoor-puniyani/echo-app&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Feel free to contribute to this application and Fork it for updates on this repository.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Reach out to me - &lt;br&gt;
&lt;a href="https://www.linkedin.com/in/harnoor-puniyani/" rel="noopener noreferrer"&gt;linkedin&lt;/a&gt; | &lt;a href="//mailto:puniyaniharnoor@gmail.com"&gt;puniyaniharnoor@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>kubernetes</category>
      <category>python</category>
    </item>
    <item>
      <title>Multiple Django apps on same port</title>
      <dc:creator>Harnoor Puniyani</dc:creator>
      <pubDate>Thu, 15 May 2025 18:16:58 +0000</pubDate>
      <link>https://dev.to/harnoorpuniyani/multiple-django-apps-on-same-port-31ma</link>
      <guid>https://dev.to/harnoorpuniyani/multiple-django-apps-on-same-port-31ma</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;The focus of this article is to run multiple services on a single port, such as hosting two websites on port 80 and port 443.&lt;br&gt;
Although docker allows us to map the ports from container to the host as we want, and eliminates the need to run multiple services on a single port, But there are lot of legacy Business Applications being used where docker is not supported.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ports
&lt;/h3&gt;

&lt;p&gt;As we all know from the facts that in a system there are total 65536 ports that is from 0 - 65535 ports that are being used, out of this many are system reserved ports and only small amount of ports are available on which we can expose services. Such as port 80 for HTTP, 443 for HTTPS, 22 for SSH , 3389 for RDP and so on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Network Adaptors
&lt;/h3&gt;

&lt;p&gt;By default every system has at least 2 network cards, one is the loopback or the localhost network card (127.0.0.1), and another one would be either WiFi or the LAN network card (192.168.1.1).&lt;/p&gt;

&lt;p&gt;This can be checked using the command &lt;code&gt;ipconfig&lt;/code&gt; if you are using the windows system or if you are Debian/Ubuntu distribution use &lt;code&gt;ifconfig&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhudo0akn5atuvwkjwssi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhudo0akn5atuvwkjwssi.png" alt="Image description" width="800" height="575"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have docker installed on my system so one more network adaptor is visible for the docker. You can create multiple network adaptors if needed, simplest way is to use the docker or the virtual box to create network cards.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup Django applications
&lt;/h3&gt;

&lt;p&gt;I have forked two different Django applications from GitHub for this demo, or you can simply create one if needed.&lt;br&gt;
We are runing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One Django app with &lt;code&gt;devops.settings&lt;/code&gt; on &lt;code&gt;http://localhost:3000&lt;/code&gt;, having the route demo&lt;/li&gt;
&lt;li&gt;Another Django app with &lt;code&gt;mysite.settings&lt;/code&gt; on &lt;code&gt;http://10.160.0.4:3000&lt;/code&gt;, does not have the route demo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Despite both using port 3000, they operate without conflict because they are bound to different network interfaces&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Localhost&lt;/code&gt; is bound to the loopback interface&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;10.160.0.4&lt;/code&gt; binds to the machine's network interface IP.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Running the Applications
&lt;/h4&gt;

&lt;p&gt;Please ensure you have activated the required virtual environment, and are already in the correct directory&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Starting the application only on Localhost, &lt;br&gt;
&lt;code&gt;python3 manage.py runserver localhost:3000&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Starting the application only the IP address&lt;br&gt;
&lt;code&gt;python3 manage.py runserver 10.160.0.4:3000&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Observing the Behavior
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Both the servers start successfully on port 3000&lt;/li&gt;
&lt;li&gt;The Localhost redirected the requests for the route /demo, here I was not following the redirects, as redirects on Django mostly indicates its a custom route, but you can follow the redirects using the &lt;code&gt;curl -L &amp;lt;url&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The IP address on /demo path returned 404, as demo path is not defined on this application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference in the behavior for the same route is a clear indicator that 2 different applications are getting called.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faq3ge7crc3xxgcriijvn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faq3ge7crc3xxgcriijvn.png" alt="Image description" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Observe the server URL and debug logs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Just in case if you want to expose the service to all the network adaptors you can use &lt;code&gt;0.0.0.0:&amp;lt;port&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From what we saw, the ports can be scoped to the network adaptor level and can be used parallelly without any conflicts. So if we assume there are x number of usable ports in the system, and there are y network interfaces on the system, so its safe to say that we can actually expose &lt;code&gt;x*y&lt;/code&gt;  services.&lt;/p&gt;

&lt;p&gt;Please feel free to add or discuss, that you feel I might have missed out.&lt;/p&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>networking</category>
      <category>devops</category>
    </item>
    <item>
      <title>Dev: It works on my machine. Ops: Cool. Let’s ship your machine to production</title>
      <dc:creator>Harnoor Puniyani</dc:creator>
      <pubDate>Tue, 22 Apr 2025 09:39:54 +0000</pubDate>
      <link>https://dev.to/harnoorpuniyani/dev-it-works-on-my-machine-ops-cool-lets-ship-your-machine-to-production-devops-meme-411n</link>
      <guid>https://dev.to/harnoorpuniyani/dev-it-works-on-my-machine-ops-cool-lets-ship-your-machine-to-production-devops-meme-411n</guid>
      <description></description>
      <category>devops</category>
      <category>sre</category>
      <category>devmeme</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Exploiting Websites</title>
      <dc:creator>Harnoor Puniyani</dc:creator>
      <pubDate>Sun, 20 Apr 2025 14:02:32 +0000</pubDate>
      <link>https://dev.to/harnoorpuniyani/exploiting-websites-370a</link>
      <guid>https://dev.to/harnoorpuniyani/exploiting-websites-370a</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Today, I’m going to discuss about the small scale applications, their vulnerabilities and how they can be secured.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Often the websites, or the web-apps which come out as well developed in specific aspects such as performance, UI and responsiveness often turns out to be vulnerable in many ways.&lt;/p&gt;

&lt;p&gt;For example, I came across as one of the translators &lt;a href="https://talktogenz.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Which seemed like a 2-tier application inclusive of frontend and backend, where on submit button frontend requests the backend.&lt;/p&gt;

&lt;p&gt;So far things seemed quite normal, right? But when I started tracking the API, it turned out to be fully open, no security implemented on it whatsoever. Since it was only an translator it might seem like what a person could do even the API is open.&lt;/p&gt;

&lt;p&gt;APIs can be leveraged in many ways, lets say if the underlying service is an paid service and API is just an wrapper, then by repeatedly calling the same API I can increase the consumption charges for the individual or the company, incurring the losses.&lt;/p&gt;

&lt;p&gt;If it serves any business value, then by using DDOS or similar attacks I can make it unavailable for the actual users, which might delay the operations and cause disruptions leading to monetary losses.&lt;/p&gt;

&lt;p&gt;It is suggested to use the authentication on the backend, along with CORS and origin headers so that requests are allowed only from specific locations. Additionally, have some security solution installed to monitor the application to detect anomalies and send alerts.&lt;/p&gt;

&lt;p&gt;Please let me know in the comments if you need a detailed guide of how to extract APIs.&lt;br&gt;
You can reach out to me through email - &lt;a href="//mailto:puniyaniharnoor@gmail.com"&gt;puniyaniharnoor@gmail.com&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/harnoor-puniyani/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>vulnerabilities</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to ACE Coporate</title>
      <dc:creator>Harnoor Puniyani</dc:creator>
      <pubDate>Thu, 27 Mar 2025 07:34:41 +0000</pubDate>
      <link>https://dev.to/harnoorpuniyani/how-to-ace-coporate-2m4l</link>
      <guid>https://dev.to/harnoorpuniyani/how-to-ace-coporate-2m4l</guid>
      <description>&lt;p&gt;Get the Blog &lt;a href="https://medium.com/@18042000harjee/which-technical-skills-to-learn-to-ace-corporate-07c6f343054f?source=friends_link&amp;amp;sk=94ab95f77191e70fd1a3191c0882b10e" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>developer</category>
      <category>learning</category>
      <category>programming</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
