<?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 Tzahi Ariel on Medium]]></title>
        <description><![CDATA[Stories by Tzahi Ariel on Medium]]></description>
        <link>https://medium.com/@zaki.rel?source=rss-b814a28aabf0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oWZ6WD2LLQwOg092kz1XMA.png</url>
            <title>Stories by Tzahi Ariel on Medium</title>
            <link>https://medium.com/@zaki.rel?source=rss-b814a28aabf0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:36:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zaki.rel/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[The 9 Problems Every Serious AI Platform Eventually Has to Solve]]></title>
            <link>https://medium.com/@zaki.rel/the-9-problems-every-serious-ai-platform-eventually-has-to-solve-1721ac2c1bb8?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1721ac2c1bb8</guid>
            <category><![CDATA[azure-api-management]]></category>
            <category><![CDATA[ai-gateway]]></category>
            <category><![CDATA[portkey-ai]]></category>
            <category><![CDATA[litellm]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 14:13:38 GMT</pubDate>
            <atom:updated>2026-04-26T14:13:38.628Z</atom:updated>
            <content:encoded><![CDATA[<h3>And the 2 ways teams are solving them in 2026</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5UzvbUrFgS9xCRcfPHd1Q.png" /><figcaption>Created with AI</figcaption></figure><p><em>Your first LLM call is delightful:</em></p><p><em>Three lines of Python.<br> An API key in an environment variable.<br> One prompt.<br> And suddenly your product has AI in it.</em></p><p><em>You demo something impressive before lunch.</em></p><p><em>But a few weeks later, reality shows up.</em></p><ul><li><em>Someone pasted a provider key into Slack.</em></li><li><em>One agent accidentally burned another team’s quota overnight.</em></li><li><em>Finance asks who spent </em><strong><em>$40,000 on tokens last month</em></strong><em>, and the answer is… unclear.</em></li><li><em>Security asks whether any PII left your network boundary.</em></li><li><em>The “best” model you standardized on six weeks ago isn’t the best model anymore.</em></li></ul><p>Welcome to the part of the AI journey <strong>nobody</strong> tweets about.</p><p>Every organization building production AI arrives here eventually.<br>And almost all of them end up building the same thing: <strong>an AI gateway.</strong></p><p>This article walks through:</p><ol><li><strong>The 9 problems</strong> every serious AI platform eventually needs to solve.</li><li><strong>The open‑source pattern</strong>: <a href="https://docs.litellm.ai/docs/">LiteLLM</a> as the router + <a href="https://github.com/Portkey-AI/gateway">Portkey </a>as the control plane.</li><li><strong>The Azure‑native approach</strong>: <a href="https://learn.microsoft.com/en-us/azure/api-management/api-management-key-concepts">Azure API Management </a>acting as an AI gateway using primitives&#39; enterprise teams already trust.</li></ol><p>If you’re an architect shaping platform direction, a DevOps engineer who will have to operate it, or an AI practitioner curious where the infrastructure layer of AI is heading - <strong>this is for you.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nq2PjkyXbOTNcf4TvOJ2xw.jpeg" /><figcaption>Created using AI</figcaption></figure><h3>Act 1 - The 9 Problems You Don’t Know You Have (Yet)</h3><p>LLM traffic behaves very differently from the REST APIs most platforms already manage.</p><p>A few characteristics make it unique:</p><ul><li><strong>Cost is token‑based, not request‑based:</strong><br> One request might cost fractions of a cent; another could cost a dollar or more.</li><li><strong>Responses stream:</strong><br> Chunked or SSE responses mean anything buffering traffic breaks the user experience.</li><li><strong>Payloads are sensitive:</strong><br> Prompts and responses are invaluable for debugging — and dangerous from a compliance perspective.</li><li><strong>The vendor ecosystem evolves every quarter:</strong><br> OpenAI, Azure OpenAI, Anthropic, Bedrock, Vertex, Mistral, and dozens of others.</li><li><strong>Caching actually works:</strong><br> Many queries are repeated or only slightly varied.</li></ul><p>Once multiple teams start using LLMs, these quirks create a familiar set of platform problems.</p><p>Here they are:</p><h3>1. Whose API key is this?”</h3><p>Application code shouldn’t hold <strong>the provider’s real API key</strong>.</p><p>Instead, each tenant or application should receive a credential owned by <strong><em>your</em></strong> platform. The gateway translates that credential into provider authentication behind the scenes.</p><p>Otherwise:</p><ul><li>One <strong>leaked key</strong> forces a global rotation</li><li>You can’t isolate or audit tenants properly</li></ul><p>Most platforms resolve this by introducing <strong>virtual API keys</strong>.</p><h3>2. “Which model deployment should handle the request?”</h3><p>Real platforms rarely rely on a single deployment.</p><p>A typical environment might include:</p><ul><li>A <strong>cheap Azure OpenAI PTU deployment</strong></li><li>A <strong>PAYG fallback</strong> in another region</li><li>A <strong>different provider</strong> used by experiment-heavy teams</li></ul><p>Some requests need the cheap option. Others need the most capable model.</p><p>So, the platform must decide - <strong>per request, </strong>where the traffic should go.<br>And when capacity throttles, something must <strong>fail over automatically</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FrNpg7ZDkexzuZYI5bHXQ.jpeg" /><figcaption>Create with AI (and manual modifications)</figcaption></figure><h3>3. Stop them before they burn the entire budget</h3><p>Traditional rate limits measure <strong>requests per second</strong>.<br>LLMs make that nearly meaningless.</p><p>One request might use 50,000 tokens…<br>What platforms actually need instead:</p><ul><li><strong>tokens‑per‑minute limits (TPM)</strong></li><li><strong>daily token budgets</strong></li><li><strong>optional monthly call or spend limits</strong></li></ul><p>Without them, someone will accidentally run a loop that quietly drains your AI budget (as a FinOps champ it might be a major problem :))</p><h3>4. Who spent my $40K?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdgTK_AlIKfeSoRPV1lbqQ.jpeg" /><figcaption>Created with AI</figcaption></figure><p>Every request should be tagged with metadata such as:</p><ul><li>tenant</li><li>application</li><li>model</li><li>prompt tokens</li><li>completion tokens</li><li>latency</li></ul><p>That telemetry needs to join with your billing data (yes, its a must)<br>Without it, cost attribution is guesswork.</p><h3>5. Did we just leak PII?</h3><p>Prompts often contain customer data, responses sometimes repeat it.<br>Platforms therefore need controls like:</p><ul><li>PII redaction or hashing</li><li>content moderation</li><li>prompt‑injection detection</li><li>schema validation in sensitive workflows</li></ul><p>An AI gateway becomes the obvious point to enforce these checks.</p><h3>6. Why did this AI response go sideways?</h3><p>When debugging AI systems, teams need full context.<br>Usually this includes:</p><ul><li>the full prompt (or a redacted version)</li><li>model identity</li><li>response</li><li>token usage</li><li>latency</li><li>cache hit or miss (Accuracy caching)</li><li>tenant metadata</li></ul><p>Without centralized traces, diagnosing hallucinations or workflow failures becomes a guessing game.</p><h3>7. Why did we answer the same question 845 times today?!</h3><p>Many LLM queries are duplicates.</p><p>Two caching approaches help:</p><ul><li><strong>Exact‑match caching: </strong>same prompt, cached answer</li><li><strong>Semantic caching: </strong>detect similar prompts using embeddings</li></ul><p>A well‑implemented cache often reduces <strong>both cost and latency</strong> significantly.</p><h3>8. Did that data leave the network?</h3><p>In regulated environments, the platform <strong>must</strong> enforce:</p><ul><li>private connectivity to model providers</li><li>restricted outbound traffic</li><li>clear network boundaries</li></ul><p>Again, the gateway is where those controls live.</p><h3>9. How can new teams onboard without filing tickets?”</h3><p>If onboarding requires platform engineers to: Create credentials, configure quotas or update routing then <strong>the platform itself becomes the bottleneck.</strong></p><p>Modern AI platforms therefore expose a <strong>developer portal</strong> where teams:</p><ul><li>register applications</li><li>generate credentials</li><li>access documentation</li><li>track usage</li></ul><h3>If you ever came across any of those 9 presented problems then continue reading:</h3><p>All 9 problems have something in common.<br>They belong <strong>in a central chokepoint</strong>, not scattered across every application.</p><h4>That chokepoint is what we call: <strong>The AI Gateway</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v34bo7LQJFMTR-p961iB5g.jpeg" /><figcaption>AI Gateway (created with AI)</figcaption></figure><p>Most teams build it in one of two ways:</p><h3>Act 2- The Open‑Source Pattern: LiteLLM + Portkey</h3><p>The open‑source approach usually combines two specialized components:</p><ul><li><a href="https://docs.litellm.ai/docs/"><strong>LiteLLM</strong></a><strong>: </strong>the routing proxy</li><li><a href="https://github.com/Portkey-AI/gateway"><strong>Portkey</strong></a><strong>: </strong>the governance and policy layer</li></ul><p>This division lets each tool focus on what it does best.</p><p>For teams running Azure OpenAI or Azure AI Foundry deployments, another useful tool has emerged from Microsoft engineers themselves: <a href="https://github.com/msftse/ptu-advisor/"><strong>PTU Advisor</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gITQ6WVqUl0vQTxMKhveQ.png" /><figcaption>Taken <a href="https://github.com/msftse/ptu-advisor/">msftse/ptu-advisor: PTU Advisor analyzes Azure OpenAI deployment metrics and recommends PTU vs PAYG with cost curves, break-even analysis, and interactive dashboards.</a></figcaption></figure><p>It’s an open‑source project that analyzes real deployment metrics and helps platform teams decide whether a workload should run on <strong>Provisioned Throughput Units (PTU)</strong> or <strong>Pay‑As‑You‑Go (PAYG)</strong> pricing.</p><p>The tool combines Azure usage data with a scoring model (looking at workload stability, capacity pressure, latency sensitivity, and demand predictability) and produces recommendations, including <strong>break‑even token throughput, cost curves, and hybrid PTU+PAYG scenarios</strong>.</p><p>In practice, it’s a practical companion for platform teams trying to optimize AI infrastructure costs, especially once workloads move beyond experimentation and consistent traffic patterns begin to emerge.</p><h3>LiteLLM: One API interface for every model provider</h3><p><a href="https://docs.litellm.ai/docs/">LiteLLM</a> acts as a <strong>unified proxy</strong> for LLM providers.<br>Applications call a single endpoint that looks like the OpenAI API.<br>LiteLLM then routes calls to providers such as:</p><ul><li>Azure OpenAI</li><li>OpenAI</li><li>Anthropic</li><li>Amazon Bedrock</li><li>Google Vertex</li><li>Mistral</li><li>self‑hosted models</li></ul><p>For applications, this creates a powerful abstraction: <strong>provider independence</strong>.</p><p>Switching backend models requires changing configuration rather than rewriting application code.</p><p>LiteLLM also provides:</p><ul><li>routing and failover logic</li><li>token-based quotas and budgeting</li><li>per‑tenant keys</li><li>cost accounting</li><li>observability integrations</li></ul><p>In practice, it solves a surprising number of platform problems by itself.</p><h3>Where LiteLLM intentionally stays lightweight to my opinion</h3><p>LiteLLM focuses on routing and therefore leaves some concerns out:</p><ul><li>deep enterprise identity integration</li><li>sophisticated guardrails</li><li>developer self‑service onboarding</li><li>governance and policy management</li></ul><p>That’s where <strong>Portkey</strong> fits it as an opensource addition.</p><h3>Portkey Gateway: Governance and policy</h3><p>Portkey operates as the <strong>control plane</strong> of the architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GViGaVrlaUeaj3EwOa5qsg.gif" /><figcaption>taken from <a href="https://github.com/Portkey-AI/gateway">Portkey-AI/gateway: A blazing fast AI Gateway with integrated guardrails. Route to 200+ LLMs, 50+ AI Guardrails with 1 fast &amp; friendly API.</a></figcaption></figure><p><strong>It provides:</strong></p><ul><li>virtual tenants and keys</li><li>per‑tenant rate limits and budgets</li><li>prompt guardrails (PII protection, prompt injection checks, schema enforcement)</li><li>semantic caching</li><li>analytics dashboards</li></ul><p>Together, the two tools create an elegant pairing:<br>LiteLLM handles <strong>provider abstraction</strong>.<br>Portkey handles <strong>policy and governance</strong>.</p><h3>The open‑source layout</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cdjp5fYEePcueK4WU21V7g.png" /></figure><p>You are still responsible for:</p><ul><li>operating the services</li><li>managing infrastructure</li><li>handling key rotation and backups</li><li>scaling the gateway itself</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zRe-4JLSc_SgX_A2UyYQTA.png" /><figcaption>Devops Burdens (Created using AI)</figcaption></figure><p>For enterprises comfortable with platform infrastructure, that’s often acceptable.</p><p>For others, there’s a simpler path:</p><h3>Act 3 - Azure API Management as an AI Gateway</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ahd3dkatVeU2dVPHkvPzaA.gif" /><figcaption>Taken from <a href="https://github.com/Azure-Samples/AI-Gateway">Azure-Samples/AI-Gateway: Labs to explore AI Models, MCP servers, and Agents with the AI Gateway powered by Azure API Management and Microsoft Foundry 🚀</a></figcaption></figure><p><a href="https://learn.microsoft.com/en-us/azure/api-management/genai-gateway-capabilities">Azure API Management (APIM) </a>is an enterprise API gateway that many organizations already run. (<a href="https://github.com/Azure/API-Management/releases">releases link</a>)</p><p>It provides:</p><ul><li>API gateway capabilities</li><li>identity enforcement</li><li>developer onboarding portals</li><li>analytics and logging</li><li>policy orchestration</li></ul><p>Microsoft has recently introduced <a href="https://learn.microsoft.com/en-us/ai/playbook/solutions/genai-gateway/reference-architectures/apim-based"><strong>GenAI-specific policies</strong> for APIM</a>.<br>And something interesting happens when you map typical AI‑platform problems onto APIM primitives.</p><p>Almost all of them already have equivalents.</p><h3>The crucial insight: APIM subscriptions already function as virtual keys</h3><p>APIM includes a resource called a <a href="https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions"><strong>Subscription</strong></a>s.</p><p>A subscription is:</p><ul><li>a credential issued to a specific consumer</li><li>with primary and secondary keys</li><li>scoped to one or more APIs</li></ul><p>That effectively provides <strong>tenant identity</strong>.</p><p>It’s the same abstraction many platforms invent — except APIM has supported it for years.</p><h3>Mapping the 9 platform problems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTJ8MDbN2bMeH6xQOZ-oMw.png" /></figure><p>There’s another major advantage.</p><p><strong>Azure API Management authenticates to Azure OpenAI using Managed Identity.</strong><br>That means your platform <strong>doesn’t need to store provider API keys at all</strong> -authentication to the model backend happens through the platform’s identity rather than secrets embedded in application configuration.</p><h3>The Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suZoZAAWEyqlnRlnyTJbhw.png" /><figcaption>Created using AI</figcaption></figure><p>For organizations already invested in Azure, this solution often integrates naturally with existing governance and security models.</p><h3>When each approach makes sense</h3><h4><strong>LiteLLM + Portkey is ideal if:</strong></h4><ul><li>you run multiple model providers</li><li>you prefer open infrastructure and flexibility</li><li>fast experimentation outranks governance</li><li>you’re comfortable operating platform services</li></ul><h4><strong>Azure API Management is ideal if:</strong></h4><ul><li>your models primarily run in Azure</li><li>enterprise governance and security are top priorities</li><li>your organization already standardizes on APIM</li><li>you want a built‑in developer portal for onboarding</li><li>Enterprise grade SLA and support</li></ul><h3>The hybrid architecture</h3><p>Some enterprises combine the two approaches.</p><p><strong>APIM handles:</strong></p><ul><li>identity</li><li>quotas</li><li>onboarding</li><li>network boundaries</li></ul><p><strong>LiteLLM handles:</strong></p><ul><li>routing to multiple providers.</li></ul><p>Example architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FADDAF4jg3JKmTK3SX7ZRg.png" /><figcaption>Created with AI</figcaption></figure><p>This hybrid design offers Azure governance with provider flexibility with LiteLLM.</p><p>In the end, the goal isn’t choosing a specific tool- it’s designing the <strong>AI gateway your platform will inevitably need</strong>, and making that choice deliberately rather than discovering it piecemeal in production.</p><p>In other words: build the AI gateway intentionally- before your architecture builds it for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1721ac2c1bb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Automatic Failover for Azure Document Intelligence Using Azure API Management (APIM)]]></title>
            <link>https://medium.com/@zaki.rel/introducing-automatic-failover-for-azure-document-intelligence-using-azure-api-management-apim-fb84907033fe?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb84907033fe</guid>
            <category><![CDATA[api-management]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[document-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[resilience]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 15:33:10 GMT</pubDate>
            <atom:updated>2026-01-20T15:33:10.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Resilient Solution for Document Processing in the Cloud</h3><p>As businesses increasingly rely on AI-powered document processing, ensuring high availability and reliability becomes paramount.<br>Azure Document Intelligence (formerly Form Recognizer) is a powerful service for extracting insights from documents, but in mission-critical scenarios, downtime or latency can be costly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*okBSaZfZg_Ys_00xGcKJgg.jpeg" /><figcaption>API Management Azure switching between DI backends</figcaption></figure><p>That’s why I’ve developed a new open-source project: <a href="https://github.com/zakarel/docintel-apim-auto-failover">an automatic failover solution for Azure Document Intelligence using Azure API Management (APIM).</a> This setup provides seamless load balancing, circuit breaker protection, and dynamic failover across regions, all while adhering to Azure’s Well-Architected Framework.</p><p>In this article, I’ll walk you through the motivation behind the project, its key features, architecture, and how to get started. <br>The full details are in the <a href="https://github.com/zakarel/docintel-apim-auto-failover">GitHub repository</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jLUKwkd-QOOCJJWV" /><figcaption>What Is Azure Document Intelligence in Foundry Tools? <a href="https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/overview?view=doc-intel-4.0.0">learn.microsoft.com</a></figcaption></figure><h3>The Problem: Ensuring Reliability in Document Intelligence Workloads</h3><p>Azure Document Intelligence excels at analyzing forms, invoices, receipts, and more using prebuilt or custom models. However, like any cloud service, it can face regional outages, high latency, or rate limiting (e.g., HTTP 429 errors). <br>For enterprises processing thousands of documents daily, <strong>these issues can disrupt operations.</strong></p><p>Traditional approaches might involve manual switching or custom code in applications, but that’s error-prone and doesn’t scale. My solution leverages Azure APIM as a smart gateway to handle failover automatically, without changing client code. It’s designed for production use, with features like retry logic, monitoring, and Infrastructure as Code (IaC).</p><h3>Key Features of the Solution</h3><ul><li><strong>Automatic Failover</strong>: Switches backend pools if request latency exceeds a threshold (default: 5 seconds). This is triggered during polling for analysis results.</li><li><strong>Load Balancing Across Backends</strong>: Supports multiple Document Intelligence instances per region (e.g., West and North Europe), with priority-based routing.</li><li><strong>Circuit Breaker Protection</strong>: Prevents cascading failures by monitoring errors (429, 500, 503, etc.) and opening the circuit when thresholds are hit (e.g., 3 errors in 30 seconds).</li><li><strong>Retry with Exponential Backoff</strong>: Handles transient issues gracefully.</li><li><strong>Backend Stickiness</strong>: Ensures ongoing operations (like polling) stay on the same backend for consistency.</li><li><strong>Dynamic Configuration</strong>: Use APIM Named Values for runtime changes- no redeployment needed. This includes manual triggering for failover.</li><li><strong>Observability</strong>: Adds diagnostic headers (e.g., X-Backend-Used, X-Request-Duration) and integrates with APIM analytics.</li><li><strong>IaC with Terraform</strong>: Modular setup for dev/prod environments, including Managed Identities for secure access.</li></ul><p>These features make the solution suitable for high-stakes environments, such as financial services or healthcare, where document processing can’t afford interruptions.</p><h3>Architecture Overview</h3><p>At its core, the solution places APIM as the entry point for all Document Intelligence requests. Here’s how it works:</p><ul><li><strong>API Management Gateway</strong>: Routes requests to the active backend pool, authenticates using Managed Identity, and applies policies for error handling and routing.</li><li><strong>Backend Pools</strong>: Configurable groups of Document Intelligence endpoints (e.g., doc-west-pool with priorities: instance1=1, instance2=2). Failover switches pools dynamically via the APIM Management API.</li><li><strong>Request Flow</strong>:</li></ul><p><strong>a. Analysis Initiation (POST /analyze)</strong>: Client sends document; APIM selects active pool, rewrites Operation-Location URL for polling, adds backendId and requestTime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*q8CbdqqzmiYPGNfqB7hjXw.jpeg" /><figcaption>POST Call. e.g. Sending PDF for insights</figcaption></figure><p><strong>b. Polling (GET /analyzeResults)</strong>: Routes to the same backend; checks duration. If over threshold, triggers failover and updates Named Value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WfKAAnD-0fKsKUzRAAepCQ.jpeg" /><figcaption>GET Call, checking earlier file posted</figcaption></figure><ul><li><strong>Circuit Breaker</strong>: Monitors over time windows; states include Closed, Open, Half-Open.</li><li><strong>Monitoring</strong>: Every response includes headers for diagnostics; use Application Insights for deeper tracing.</li></ul><p>This architecture ensures minimal latency overhead while providing robust protection. For security, you can use Private Endpoints, VNet integration, and Key Vault for secrets. keep in mind that for that you won’t be able to use the basic tier of APIM and it will incur additional costs.</p><h3>Setup and Deployment</h3><p>Getting started is straightforward with Terraform and Python scripts:</p><h4>Prerequisites</h4><ul><li>Azure subscription with APIM (Standard v2 or higher) and 2–4 Document Intelligence instances across regions.</li><li>Terraform ≥1.5.0, Azure CLI, Python 3.7+.</li><li>Assign Managed Identity roles: Cognitive Services User on DI, API Management Service Contributor on APIM.</li></ul><h4>Steps</h4><ol><li><strong>Clone the repo:</strong></li></ol><pre>git clone https://github.com/zakarel/docintel-apim-auto-failover.git<br>cd docintel-apim-auto-failover</pre><p>2. <strong>Configure tfvars</strong> (e.g., dev.tfvars) with subscription details, backend endpoints, and priorities.</p><p>3.<strong> Validate:</strong></p><pre>python3 deployment/scripts/validate.py -e dev</pre><p>4.<strong> Deploy:</strong></p><pre>python3 deployment/scripts/deploy.py -e dev</pre><p>5. <strong>Test integration:</strong> Install requirements, set .env, run</p><pre>python3 tests/integration/test_automatic_backend_switching.py</pre><p>Configurations like thresholds are stored in Named Values for easy tweaks via the Azure Portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*55OEx5b_DGjt75pe1kNDwg.png" /><figcaption>table explaining named values in APIM solution</figcaption></figure><h3>Testing and Monitoring</h3><p>The repo includes integration tests for failover scenarios. For load testing, use Azure Load Testing. Monitor via APIM analytics for latency, errors, and backend health (not shown in this project).</p><h3>Conclusion</h3><p>This automatic failover solution bridges a gap in Azure’s ecosystem, making Document Intelligence ability to be more resilient.<br>By “open-sourcing” it, I hope to help others build resilient AI workflows. Check out the <a href="https://github.com/zakarel/docintel-apim-auto-failover">repo</a>, star it if useful, and feel free to contribute!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb84907033fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamline Azure Firewall Rule Updates with Draft + Deployment (Preview- Dec25)]]></title>
            <link>https://medium.com/@zaki.rel/streamline-azure-firewall-rule-updates-with-draft-deployment-preview-dec25-4d7b51259196?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d7b51259196</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[firewall]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 12:57:35 GMT</pubDate>
            <atom:updated>2025-12-25T12:57:35.139Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing Azure Firewall policies can be painful when adding multiple rules, each direct change triggers a separate deployment, eating up time and risking inconsistent states during updates.</p><p>Enter Azure Firewall Draft and Deployment a game-changing <strong>preview </strong>feature that lets you stage bulk changes safely and apply them all at once. It’s perfect for automating rule additions via Azure CLI, turning what used to be a series of slow deployments into a single atomic operation.</p><p><em>Quick note</em>: This is still in preview (as of December 2025) and covered under Microsoft’s <a href="https://azure.microsoft.com/support/legal/preview-supplemental-terms">preview supplemental terms</a>.</p><p><em>Plus, a cool UI with a git-like visuals:</em></p><figure><img alt="portal snap" src="https://cdn-images-1.medium.com/max/1024/1*kRyu-KjJyvdlpVHa-dRiJA.png" /></figure><h3>Why This Changes Everything for Bulk Rule Additions</h3><p>- Build a complete draft copy of your live policy.<br>- Script the addition of as many rules as you need , no impact on production.<br>- Deploy everything in one go: fast, consistent, and low-risk.</p><p>In practice, when no one touches the live policy while you’re working, deploying the draft effectively <strong>appends </strong>your new rules to the existing ones.</p><p><strong>Critical disclaimer</strong>: Deployment always overwrites the entire live policy with the draft. If any rules are added, removed, or modified directly on the live policy <strong>after </strong>you create the draft, those changes will be lost unless you manually add them to the draft. Always create the draft right before making your scripted changes.</p><h3>Hands-On: Adding Rules via Azure CLI</h3><p>Here’s a real-world example workflow to add new network rules safely:</p><pre># 1. Create a draft (exact clone of your current live policy)<br>az network firewall policy draft create \<br> — policy-name afw-policy-standard \<br> — resource-group rg-gp-test<br><br># 2. Create or ensure the Rule Collection Group exists in the draft<br>az network firewall policy rule-collection-group draft create \<br> - policy-name afw-policy-standard \<br> - resource-group rg-gp-test \<br> - rule-collection-group-name test \<br> - priority 550<br><br># 3. Add your new rule(s) to the draft<br>az network firewall policy rule-collection-group draft collection rule add \<br> - policy-name afw-policy-standard \<br> - resource-group rg-gp-test \<br> - rule-collection-group-name test \<br> - collection-name test1 \<br> - name Rule1 \<br> - rule-type NetworkRule \<br> - source-addresses 10.0.0.0/24 \<br> - destination-addresses 20.0.0.0/24 \<br> - destination-ports 443 \<br> - protocols &quot;{TCP:true}&quot;<br><br># Repeat the add command for as many rules as needed<br># 4. Deploy everything automatically<br>az network firewall policy deploy \<br> - name afw-policy-standard \<br> - resource-group rg-gp-test</pre><h4>That’s it - one deployment for dozens of rules instead of many.</h4><h3>Tips to Get the Most Out of It</h3><p>- Create the draft immediately before scripting to avoid drift.<br>- Review changes in the portal (or list them via CLI) before deploying.<br>- Great for CI/CD pipelines, onboarding new apps, or monthly rule batches.<br>- Only one draft per policy at a time, keep workflows tight.</p><h3>Bottom Line</h3><p>Azure Firewall Draft &amp; Deployment makes bulk rule management in Azure Firewall far less stressful. Whether you’re scripting routine updates or handling big changes, it gives you staging power without the old deployment headaches.</p><p>Dive deeper in the <a href="https://learn.microsoft.com/en-us/azure/firewall/draft-deploy?tabs=cli">official docs</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8JHFk3LI9-V2r0fQlU8Xkg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d7b51259196" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Searching Through Company Documents: Build Your Own AI Assistant Instead]]></title>
            <link>https://medium.com/@zaki.rel/stop-searching-through-company-documents-build-your-own-ai-assistant-instead-bddfbe51d292?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bddfbe51d292</guid>
            <category><![CDATA[ai-foundry]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 19:35:13 GMT</pubDate>
            <atom:updated>2025-07-13T19:35:13.588Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve all been there — frantically digging through endless SharePoint folders, Slack channels, and email threads trying to find that one piece of company information for a client call that starts in five minutes. You know the answer exists somewhere in your organization’s digital maze, but good luck finding it quickly.</p><p>Working at a large corporation, I see this pain point daily across teams, but I can’t exactly build solutions using our actual company data due to strict information security policies. So instead, I decided to create a proof-of-concept that others could adapt for their own organizations.</p><p>Before we dive in, all the code for this project is available on GitHub at <a href="https://github.com/zakarel/ai-foundry-byod-chatbot">https://github.com/zakarel/ai-foundry-byod-chatbot</a>. Feel free to clone it and follow along or skip ahead if you just want to see the implementation.</p><figure><img alt="https://github.com/zakarel/ai-foundry-byod-chatbot" src="https://cdn-images-1.medium.com/max/772/1*JxiorRPZpFYksDWVuoRD4w.png" /><figcaption><a href="https://github.com/zakarel/ai-foundry-byod-chatbot">https://github.com/zakarel/ai-foundry-byod-chatbot</a></figcaption></figure><p>What I built is a framework that any company could implement with their own data to create an AI assistant that knows their business inside and out. While I can’t deploy this with my employer’s actual documents (corporate compliance, you know how it is), I can share the technical approach that would let smaller companies or teams build their own intelligent document assistant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*qmGL7i4eHifet6SNQQLUYg.png" /><figcaption>Taken from <a href="https://streamlit.io/">streamlit.io</a> — fast and simple front-end</figcaption></figure><p>Using Azure AI Foundry and an opensource framework in Python called <a href="https://streamlit.io/">Streamlit</a>, I created a template that can instantly pull information from company data sources.</p><p>After cloning the code make sure to setup the resources on your Azure subscription:<br>- AI Foundry — AI Search (index the data), Project and a Hub.<br>- Storage Account with blob container to keep the data.<br>- Key Vault (optional) to keep connection strings secured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsb51hV7n5oUVeDuUIpDZA.png" /></figure><p>When building an AI chatbot for company data, you need to index your documents in Azure AI Search first. But manually creating search indexes is tedious — you have to define field types, specify what’s searchable, set key fields, etc.</p><p>The script <a href="https://github.com/zakarel/ai-foundry-byod-chatbot/blob/main/json_to_ai_search.py">json_to_ai_search.py</a> solves just that by automatically analyzing your JSON data and creating the right Azure Search index schema. It inspects your data structure, maps types correctly, and makes smart decisions about which fields should be searchable.</p><p>I tested it with a books collection, but it works with any structured company data. Instead of spending hours manually configuring indexes, you just point this script at your JSON file and it prepares everything for your AI assistant automatically.</p><h3>Wrapping Up: Your AI Assistant is Ready to Go</h3><p>Building an AI chatbot for your company data doesn’t have to be a months-long enterprise project. With Azure AI Foundry and Streamlit, you can go from scattered documents to intelligent assistant in a matter of hours, not weeks.</p><p>We’ve covered the complete pipeline: automatically indexing your JSON data with our schema generator, connecting to Azure’s powerful AI models, and creating a clean chat interface that your team will actually want to use. The best part? Everything is modular and customizable — swap out data sources, adjust the UI, or integrate with your existing systems as needed.</p><p>Your company’s knowledge is its competitive advantage. Instead of letting it sit buried in folders and databases, you now have the tools to make it instantly accessible through natural language queries. Whether it’s customer support teams finding policy information, sales teams accessing product details, or executives getting quick insights from company reports — your AI assistant becomes the bridge between human questions and organizational knowledge.</p><p>The complete implementation is available at <a href="https://github.com/zakarel/ai-foundry-byod-chatbot">https://github.com/zakarel/ai-foundry-byod-chatbot</a>. Star it if you found this helpful, fork it for your own projects, and let me know in the comments what kind of company data you’re planning to make AI-searchable.</p><p>The future of workplace productivity is conversational — and you just built your first piece of it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bddfbe51d292" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubecon & CloudNativeCon 2025 major announcements explained]]></title>
            <link>https://medium.com/@zaki.rel/kubecon-cloudnativecon-2025-major-announcements-explained-6492f8a282f9?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6492f8a282f9</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[kubecon]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Tue, 08 Apr 2025 18:13:05 GMT</pubDate>
            <atom:updated>2025-04-08T18:13:05.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Logo" src="https://cdn-images-1.medium.com/max/1024/1*nKokzN75qOISGrfbk5V0PQ.png" /><figcaption>Major announcements from KubeCon &amp; CloudNativeCon 2025 event</figcaption></figure><p>Kubecon &amp; CloudNativeCon is a flagship conference organized by the Cloud Native Computing Foundation (CNCF). It brings together adopters and technologists from leading open source and cloud native communities. The event features keynotes, breakout sessions, and showcases of solutions, focusing on Kubernetes and broader DevOps trends.</p><p>I will summarize the major announcements in this post and explain each one of them.</p><h3>1. Istio’s ambient mode (GA Istio 1.24)</h3><p><strong>No need for sidecar proxies anymore!</strong><br>provides a more efficient and flexible way to manage traffic and security in Kubernetes environments.</p><h4>Features:</h4><ol><li><strong>mTLS</strong> encryption between objects without a sidecar container</li><li><strong>Ztunnel</strong> -Layer 4 proxy reducing resource overhead and enhances security and authorization. can establish HTTP Based Overlay Network Encapsulation (HBON) tunnels with other Ztunnels or Waypoint proxies</li><li><a href="https://istio.io/latest/docs/ambient/overview/#waypoint-proxies"><strong>Waypoint Proxy</strong></a> — Optional layer 7 proxy provides authorization policies based on HTTP headers, load balancing &amp; rate limits. Can establish a tunnel to Ztunnels.</li></ol><p>In ambient, the control plane communicates with the Z<a href="https://istio.io/latest/docs/ambient/overview/#ztunnel">tunnel</a> proxy on each Kubernetes node. The <a href="https://istio.io/latest/docs/ambient/overview/#ztunnel">Ztunnel</a> (Zero Trust Tunnel) is responsible for securely connecting and authenticating workloads within the mesh, it ensures L3 and L4 traffic is efficiently and securely transported either directly to workloads, other ztunnel proxies, or to waypoint proxies — <a href="https://istio.io/latest/docs/ambient/overview/#ztunnel">Reference</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yl9GwE4kXaQBAzo1Pun-cg.png" /><figcaption>Image by <a href="https://istio.io/">istio.io</a></figcaption></figure><h3>2. DRA — Dynamic Resource Allocation (beta v1.32)</h3><p>A feature that optimizes the allocation of resources in Kubernetes environments based on real-time demands and workloads. This ensures efficient use of resources, improving performance and reducing costs.</p><p>The following manifest configures a template for dynamically allocating GPU resources to a Pod in AKS. The new DRA features like allocationMode, resourceSelector, and limits enhance control over how and which resources are allocated.</p><pre>apiVersion: resource.k8s.io/v1alpha2<br>kind: ResourceClaimTemplate<br>metadata:<br>  name: gpu-claim-template<br>spec:<br>  spec:<br>    resourceClassName: nvidia-gpu<br>    parametersRef:<br>      kind: ResourceParameters<br>      name: gpu-parameters<br>    allocationMode: immediate  # Specifies the mode of resource allocation (e.g., immediate or delayed)<br>    resourceSelector:<br>      matchLabels:<br>        gpu-type: &quot;A100&quot;       # Selects GPUs of type A100<br>        memory: &quot;40Gi&quot;         # Selects GPUs with 40Gi of memory<br>    limits:<br>      maxDevices: 2            # Limits the maximum number of devices that can be allocated<br>---<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: gpu-pod<br>spec:<br>  containers:<br>  - name: gpu-container<br>    image: nvidia/cuda:11.0-base<br>    command: [&quot;nvidia-smi&quot;]<br>    resources:<br>      claims:<br>      - name: gpu-claim<br>  resourceClaims:<br>  - name: gpu-claim<br>    source:<br>      resourceClaimTemplateName: gpu-claim-template</pre><h3>3. Ratify</h3><p>A tool for verifying the integrity and security of reference artifacts in Kubernetes environments. It ensures artifacts meet compliance standards by validating signatures, checksums, and checking for vulnerabilities.</p><h4>How does it work?</h4><ul><li>Sign your images with <a href="https://github.com/notaryproject/notation">Notation </a>or <a href="https://github.com/sigstore/cosign">Cosign</a>.</li><li>Use Azure Key Vault to store keys &amp; certs.</li><li>Store images in Azure Container Registry.</li><li>Ratify () will validate if the image is signed or not.</li><li>By using Gatekeeper &amp; OPA, Ratify will deny unsigned images to be used.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EPkl0dmXOlEvtwlJTo89aw.png" /><figcaption>Image by <a href="https://ratify.dev/docs/quickstarts/ratify-on-azure">ratify.dev</a></figcaption></figure><h3>4. Secret pulled images verification (Alpha 1.33)</h3><p>ensures that only authorized users can access and use images that have already been pulled to a node. It enhances security by enforcing access policies for these images. Now in Alpha</p><h4>How to use?</h4><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: secure-image-pod<br>spec:<br>  containers:<br>  - name: my-container<br>    image: myregistry/myimage:latest<br>    imagePullPolicy: IfNotPresent<br>  imagePullSecrets:<br>  - name: myregistrykey<br>  imagePullCredentialsVerificationPolicy: AlwaysVerify</pre><p><a href="https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2535-ensure-secret-pulled-images"><em>Reference &amp; parameters</em></a></p><h4>How does it work?</h4><p>Images already present at boot or loaded externally to the kubelet will not require authentication unless configured otherwise. Images successfully pulled through the kubelet with no ImagePullSecretsauthentication required will not require authentication.</p><p>The new behavior is designed in a way so that it replaces current behavior — it is going to be an on-by-default feature once graduated.</p><h3>5. Projected service account tokens for Kubelet image credential providers (Alpha 1.33)</h3><p>Image pulls authentication by allowing to exchange ServiceAccount tokens for credentials. In Alpha version<br>It can now <a href="https://github.com/Azure/azure-workload-identity/issues/1049#issuecomment-2756283843">support AKS workload identity</a></p><h4>How to use in kubernetes?</h4><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: image-pull-sa<br>  namespace: default</pre><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: my-registry-secret<br>  namespace: default<br>type: kubernetes.io/dockerconfigjson<br>data:<br>  .dockerconfigjson: &lt;base64-encoded-docker-config&gt;</pre><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: private-registry-pod<br>  namespace: default<br>spec:<br>  serviceAccountName: image-pull-sa<br>  containers:<br>  - name: my-container<br>    image: my-private-registry/my-image:latest<br>    imagePullSecrets:<br>    - name: my-registry-secret</pre><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: kubelet-credential-provider-config<br>  namespace: kube-system<br>data:<br>  config.json: |<br>    {<br>      &quot;apiVersion&quot;: &quot;credentialprovider.kubelet.k8s.io/v1alpha1&quot;,<br>      &quot;kind&quot;: &quot;CredentialProviderConfig&quot;,<br>      &quot;providers&quot;: [<br>        {<br>          &quot;name&quot;: &quot;my-registry-provider&quot;,<br>          &quot;matchImages&quot;: [&quot;my-private-registry/*&quot;],<br>          &quot;defaultCacheDuration&quot;: &quot;1m&quot;,<br>          &quot;tokenAttributes&quot;: {<br>            &quot;audience&quot;: &quot;my-private-registry&quot;,<br>            &quot;expirationSeconds&quot;: 600<br>          }<br>        }<br>      ]<br>    }</pre><h4>How does it work?</h4><p>Pod requests token and uses the service account. <br>The service account communicates with the API server to retrieve the token.<br>Service Account provides token to Kubelet.<br>Kubelet pulls image using credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hc4gRHx92iPbv3gpqCp7Rg.png" /><figcaption>Image created using <a href="https://excalidraw.com/">excalidraw</a>.com</figcaption></figure><h3>6. <strong>Network isolated Azure Kubernetes clusters (to be GA)</strong></h3><p>By creating a new AKS cluster, you have the option to block all outbound connections from the cluster out of the box</p><h4>How to use?</h4><p>On creation add the following flags to the az aks create command:</p><p>--bootstrap-artifact-sourcecan be set to either Direct or Cache corresponding to using direct MCR (NOT network isolated) and private ACR (network isolated) for image pulls respectively.</p><p>The --outbound-type parameter can be set to either none or block. If the outbound type is set to none, then AKS doesn&#39;t set up any outbound connections for the cluster, allowing the user to configure them on their own. If the outbound type is set to block, then all outbound connections are blocked. — <a href="https://learn.microsoft.com/en-us/azure/aks/network-isolated?pivots=aks-managed-acr#create-a-network-isolated-cluster">Reference</a></p><h4>How does it work?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJD1nuqdg61DfwLBlUsQqA.png" /><figcaption>Image from<a href="https://learn.microsoft.com/en-us/azure/aks/concepts-network-isolated"> Learn.microsoft.com</a></figcaption></figure><p>AKS clusters typically pull images from the Microsoft Artifact Registry (MAR) to update components and address security vulnerabilities. Network isolated clusters, however, pull these images from a private Azure Container Registry (ACR) connected to the cluster. If the images are not available in the private ACR, it fetches them from MAR and serves them via its private endpoint, eliminating the need for outbound internet access from the cluster.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6492f8a282f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub Copilot Gems]]></title>
            <link>https://medium.com/@zaki.rel/github-copilot-gems-dacf36a3f7be?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/dacf36a3f7be</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[developer-productivity]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 12:57:10 GMT</pubDate>
            <atom:updated>2025-03-23T12:57:10.198Z</atom:updated>
            <content:encoded><![CDATA[<h3>Discover the Hidden Gems of GitHub Copilot: Boost Your Coding Efficiency</h3><p>GitHub Copilot is changing the way we write code by offering intelligent suggestions and automating repetitive tasks. In this blog, we’ll explore some of the lesser-known features of Copilot that can help you code more efficiently. Whether you’re new to coding or have years of experience, these tips will help you get the most out of this innovative tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcHlZzF0q86gLPvOXRD45Q.png" /></figure><h3><strong>Basic capabilities</strong></h3><p>Convert, add something, delete something, how to change, what will happen if…</p><h3>What can it do?</h3><h4>Built-in common commands</h4><blockquote>/explain — explain the selected code</blockquote><blockquote>/fix — fix the selected code</blockquote><blockquote>/tests — add tests to the selected code</blockquote><h3>What is the target for the question?</h3><h4>Adding Context</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-kpj-eM8Pi7bdaJ8YTDHQ.png" /><figcaption>© Tzahi Ariel — GH copilot Context Architecture</figcaption></figure><pre>@workspace - Specific Context that is open on the IDE.<br><br>@vscode - Ask questions regarding VSCODE like searching for extensions,<br>show commands, show release notes.<br><br>@terminal - Terminal related questions like managing processes, directories,<br>files, specific terminal commands etc..<br><br>@github - Refer question to the code/repo/folders at Github.com. Ask about<br>PRs, last commits etc...<br><br>@azure ** - using Azure&#39;s extension (Github copilot for Azure -<br>Preview for March 2025). Information about Azure&#39;s resources, Azure&#39;s<br>recommendations, cost management, latest SDKs.<br><br>@remote-ssh - set up connection, troubleshoot remote ssh connections<br>handle ssh keys questions, remote connection settings</pre><p>** <a href="https://learn.microsoft.com/en-us/azure/developer/github-copilot-azure/get-started"><em>Github Copilot for Azure extension</em></a></p><h3>How Does it work?</h3><ol><li>Entered the context — <em>@workspace</em> and the built-in command <em>/explain </em>as shown in red below.</li><li>Selected the script lines I want to get the command to work on and press send &amp; dispatch (Enter)</li><li>I got an output that explained the script part I selected.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DoSDsnK22P-ULnerLcFqbw.png" /><figcaption>VSCode — Github Copilot extension</figcaption></figure><h3>GitHub Copilot Edits — Editing multiple files altogether</h3><p>Github copilot introduces a new ability — edit multiple files using github copilot.<br>Common use-case: adding a button/feature, handling its design in a different design file and adding button functionality in the same GitHub copilot query.</p><h4>Take for instance, the below example:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8e7WI9xAMpSfqyO6lsygoQ.png" /></figure><p>I added 3 files to the GitHub copilot edits query: html file (front end), CSS file (design) and a python file to add functionality. <br>I asked Copilot to add a button, correct the error I had with randomizing the number the button will provide and change the type of text and a text box design.<br>For #GitHub copilot to succeed the task it needs to change all 3 of the files to and to understand the integration between them. As you can see it deleted some parts of the code (red) added some new code (green) on 3 of those files and asked me if I wish to keep, change or discard.<br>This is the power of <strong>#GitHub Copilot Edits</strong></p><h3>Mix contexts in queries for best efficiency</h3><p><strong>Scenario</strong>: As a lead tech DevOps engineer, one of my responsibilities is to handle the team’s GitHub’s repos hygiene.<br>The repos need to be tidy, commits with comments, code with explanations and feature branching.</p><p>Start by asking GH Copilot what the last commit was by using the <strong><em>@github context</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*WpgVAgKRXJxYBbt4QsgesA.png" /><figcaption>GH Copilot using @github context</figcaption></figure><p>Check if the commit had a meaningful comment by again asking Copilot using the same context. (As a bonus you can ask copilot to right an automation and to inform you when there isn’t a comment or a meaningless one)</p><p>Entering the code itself you notice there isn’t documentation or any comments in it. You highlight important definitions inside the code, clicking CTRL+I will open the inline GitHub Copilot box then you enter &gt;/doc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKhotR3ag8Xe5et1WTx-DQ.png" /><figcaption>/doc built-in command</figcaption></figure><p>Then for a final review you enter the command pallet using CTRL+SHIFT+P and you choose &gt;Github Copilot: Comment &amp; Review<br> it will provide you with a code review by Copilot’s AI Module</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7maT5GhDIfxowDWswMtTQQ.png" /></figure><p>It had 6 comments about making the code more efficient and tidier.<br>changed the code according to the comments and tried to run the code from my terminal. It had an error which I couldn’t understand. So, I used the @terminal /explain to get GH copilot to explain me the error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAgSG9TfVm5p53SK80TgAQ.png" /></figure><p>It explained where I had a syntax error and by mistake, I missed an indentation. I changed the code, PR it and approved with a colleague. <br>The repo is reviewed, tidy and according to out company’s code compliance.</p><h4>Feel free to leave comments, share and provide feedback anyway you would like 🙂</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dacf36a3f7be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ready-To-Code Cloud Workstations — Microsoft Dev Box]]></title>
            <link>https://medium.com/@zaki.rel/ready-to-code-cloud-workstations-microsoft-dev-box-971dedfbfb0c?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/971dedfbfb0c</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[integrated-development]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Thu, 23 May 2024 07:04:40 GMT</pubDate>
            <atom:updated>2024-05-23T07:04:40.946Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ready-To-Code Cloud Workstations — Microsoft Dev Box</h3><p>Microsoft Azure Dev Box — efficient method for Developers to code in the cloud</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfcIfiACsjmVu9zF6SeUDA.png" /></figure><h4>What is Microsoft Dev Box?</h4><p>Microsoft Dev Box is a cloud service provided by Azure that offers developers self-service access to customizable, project-specific development environments, known as dev boxes. These dev boxes are preconfigured with the necessary tools, source code, and binaries, allowing developers to start coding immediately without the need for lengthy setup processes. The service is designed to support various roles within an organization, from platform engineers to development team leads and developers, facilitating a more efficient and secure development workflow.</p><h4>How to Start?</h4><p>The creation of a Microsoft Dev Box involves a streamlined process that begins with the configuration of the Dev Box service by platform engineers. Once configured, developers can create a cloud-hosted workstation through the developer portal, selecting the appropriate project and dev box pool to suit their needs. The process is designed to be self-service, allowing for the creation of multiple dev boxes for different tasks within a single project, which can significantly enhance workflow efficiency. Customizations can also be added to the dev boxes, enabling teams to preconfigure the necessary software for their development work.</p><h4>Azure Portal Flow</h4><ol><li><strong>Create a Dev Center<br></strong>A Dev Center in Microsoft Dev Box is a centralized management hub that allows you to group similar sets of projects together and apply consistent settings across them. It’s designed to cater to the varying needs of development teams, providing a structured environment where resources like dev box definitions and network connections are shared. With the ability to create multiple Dev Centers, organizations can tailor their development infrastructure to support specific business requirements or regional centers, enhancing efficiency and collaboration within their development operations.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*BMbjQgoW86mimfdjj5yNDA.png" /><figcaption>Azure portal Dev Center</figcaption></figure><p>2. <strong>Create a Dev Box Definition</strong></p><p>A dev box definition outlines the VM image and the VM SKU (which includes compute size and storage) that are utilized when creating the dev boxes. You can establish various dev box definitions based on the nature of the development project or the profiles of the developers. For instance, certain developers may require a specific set of developer tools, while others may need a cloud workstation with greater computing resources.</p><p>Any dev box definitions that you establish within a dev center are accessible for all projects linked to that dev center. It’s necessary to include at least one dev box definition in your dev center.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*uPRwMuJDYViNOw7wx-IaYA.png" /><figcaption>Azure portal dev box definition</figcaption></figure><p>3. <strong>Create a Dev Box Project</strong></p><p>Dev Box Project define limitations for a developer to utilize and boundaries. <br>Each project is assigned a Dev Box Center</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*gpMr8o4hhWjo7PG_l2DhZA.png" /><figcaption>Azure portal dev box project</figcaption></figure><p>4. <strong>Create a Dev Box Pool</strong><br>“<em>A dev box pool is the collection of dev boxes that have the same settings, such as the dev box definition and network connection. Developers that have access to the project in the dev center, can then choose to create a dev box from a dev box pool.</em></p><p><em>Dev box pools define the location of the dev boxes through the specified network connection. You can choose to deploy dev boxes to a Microsoft-hosted network or to a network that you manage.”</em> — <a href="https://learn.microsoft.com/en-us/azure/dev-box/quickstart-configure-dev-box-service#create-a-dev-box-pool">learn.microsoft.com</a><br>Each Dev Box Pool is assigned a definition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*kZjyJoyJ9nufms577h6ZXg.png" /><figcaption>Azure portal — Dev box Pool</figcaption></figure><p>5. <strong>Assign the DevCenter Dev Box User role to Developers<br></strong>To allow developer’s access to the new project we should add them to the IAM of that specific project. There is a unique role assignment for developers called — <strong>Dev Box User.<br></strong>There is also a specific role for Dev Box Administrator called — <strong>Dev Box Admin.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*st7h7b6zKiXLqtI9FJ2edQ.png" /><figcaption>Azure Portal Role Assignments</figcaption></figure><p><strong>6. Configure Optional &amp; Additional Features</strong></p><ul><li>Auto-Stop — Automatically stop the dev box on a specified time.</li><li>Hibernation (Preview for the time being) — Pause a Dev Box which isn’t being used. <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/hibernate-resume">Learn More</a></li><li>Auto Hibernation on Disconnect (MS Build 2024) — New feature that will auto hibernate on users&#39; disconnection.</li><li>Connection Telemetry (MS Build 2024)</li><li>Limitations — Configure Dev Box limit per developer.</li><li>Project Based Catalog (MS Build 2024) — new feature to specify specific image catalog and attach it to a specific project.</li><li>Team customizations and images</li></ul><h3>Ready to Start Coding?</h3><pre>az devcenter dev dev-box create --dev-box-name &quot;test-devbox1&quot; --pool &quot;devbox-pool1&quot; --project &quot;devbox-project1&quot; --dev-center &quot;devbox-center-demo1&quot;</pre><p><em>This will create a new Dev Box named test-devbox1 using AzureCLI</em></p><pre>az devcenter dev dev-box start --dev-box-name &quot;test-devbox1&quot; --dev-center &quot;devbox-center-demo1&quot; --project &quot;devbox-project1&quot; --pool &quot;devbox-pool1&quot;</pre><p><em>Start the Dev Box</em></p><pre>az devcenter dev dev-box show-remote-connection --dev-box-name &quot;test-devbox1&quot; --dev-center &quot;devbox-center-demo1&quot; --project &quot;devbox-project1&quot; --pool &quot;devbox-pool1&quot;</pre><p><em>Show remote connection</em></p><p>Afterwards feel free to use any RDP client to connect to your new Dev Box with the remote connection info. <br>Have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=971dedfbfb0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AKS, Container Apps, and What’s In Between]]></title>
            <link>https://medium.com/@zaki.rel/aks-container-apps-and-whats-in-between-43eef27c0688?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/43eef27c0688</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[platform-as-a-service]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Wed, 22 May 2024 08:42:05 GMT</pubDate>
            <atom:updated>2024-05-23T08:31:59.888Z</atom:updated>
            <content:encoded><![CDATA[<p>Choosing the Right Azure Service for Your Containers: A Guide to AKS, Container Apps, and Beyond</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiuDdJMwtx7-hCBM2NBbWw.png" /><figcaption>a compute type to host an application is a weighty choice to make</figcaption></figure><h3><strong>What are containerized applications?</strong></h3><p>Containerized applications are a modern approach to software development where an application and its dependencies are packaged together into a container. <br>This method ensures that the application runs consistently across different computing environments.<br>Containers are lightweight, require less overhead than traditional virtual machines, and provide an isolated environment for the application to run, which enhances security and portability. <br>The concept has gained popularity with the advent of platforms like Docker and Kubernetes, revolutionizing how developers build, ship, and run applications.</p><h3>Why do I need them?</h3><p>Containerized applications are essential for modern software development due to their portability, efficiency, and isolation capabilities.<br>They allow developers to package an application with all its dependencies, ensuring consistent behavior across different computing environments. This eliminates the “it works on my machine” problem and facilitates continuous integration and deployment.<br>Containers are also lightweight compared to virtual machines, requiring less overhead and enabling more efficient use of system resources. Moreover, containerization supports microservices architecture, allowing for scalable and resilient applications.</p><h3>Azure Container Apps (ACA)</h3><p>Azure Container Apps is a serverless platform provided by Microsoft, designed to simplify the process of deploying and managing containerized applications.<br>It allows developers to focus on building their applications without the need to manage the underlying infrastructure.<br>The service supports dynamic scaling based on HTTP traffic, event-driven processing, and CPU or memory load, making it a cost-effective solution for modern app development. <br>With Azure Container Apps, you can deploy microservices, run background jobs, and handle event-driven processing with ease. ACA requires less managing and administrative efforts than AKS does, therefore provide less control and capabilities to the user.</p><p>Documentations:<br><a href="https://learn.microsoft.com/en-us/azure/container-apps/overview"><em>Microsoft</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*p9z5k7yvrP6H_SgusvCvow.png" /><figcaption>Azure Container Apps Architecture</figcaption></figure><h4>Deploy a Template with Container App using Terraform</h4><p><em>Code from </em><a href="http://registry.terraform.io/"><em>official terrafrom.io</em></a></p><pre>resource &quot;azurerm_resource_group&quot; &quot;example&quot; {<br>  name     = &quot;example-resources&quot;<br>  location = &quot;West Europe&quot;<br>}<br><br>resource &quot;azurerm_log_analytics_workspace&quot; &quot;example&quot; {<br>  name                = &quot;acctest-01&quot;<br>  location            = azurerm_resource_group.example.location<br>  resource_group_name = azurerm_resource_group.example.name<br>  sku                 = &quot;PerGB2018&quot;<br>  retention_in_days   = 30<br>}<br><br>resource &quot;azurerm_container_app_environment&quot; &quot;example&quot; {<br>  name                       = &quot;Example-Environment&quot;<br>  location                   = azurerm_resource_group.example.location<br>  resource_group_name        = azurerm_resource_group.example.name<br>  log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id<br>}<br>resource &quot;azurerm_container_app&quot; &quot;example&quot; {<br>  name                         = &quot;example-app&quot;<br>  container_app_environment_id = azurerm_container_app_environment.example.id<br>  resource_group_name          = azurerm_resource_group.example.name<br>  revision_mode                = &quot;Single&quot;<br><br>  template {<br>    container {<br>      name   = &quot;examplecontainerapp&quot;<br>      image  = &quot;mcr.microsoft.com/azuredocs/containerapps-helloworld:latest&quot;<br>      cpu    = 0.25<br>      memory = &quot;0.5Gi&quot;<br>    }<br>  }<br>}</pre><h3>Azure Kubernetes service (AKS)</h3><p>Azure Kubernetes Service (AKS) is a managed container orchestration service provided by Microsoft Azure.<br>It simplifies the deployment, management, and scaling of containerized applications using Kubernetes, an open-source platform.<br>With AKS, you can quickly provision clusters, automate upgrades, and integrate with a range of Azure services for improved developer productivity, security, and governance.<br>AKS supports multiple workloads and is ideal for applications requiring high availability and scalability. AKS requires more managing and administrative efforts than ACA does, therefore provide more control and capabilities to the user.</p><p>Documentation:<br><a href="https://learn.microsoft.com/en-us/azure/aks/concepts-clusters-workloads"><em>Microsoft</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*uZUfXjQdD3ibwV9YAA0uuA.png" /><figcaption>Azure Kubernetes Service Architecture</figcaption></figure><h3>Azure Container Instance (ACI)</h3><p>Azure Container Instances (ACI) is a service provided by Microsoft Azure that allows users to run containers in the cloud without having to manage servers or clusters.<br>It offers a serverless environment to deploy and manage Docker containers, with the ability to scale and pay per second for container execution time. <br>ACI is suitable for various scenarios, including event-driven applications, batch jobs, or any workload that can operate in isolated containers.<br>It simplifies the process of running containers and is a powerful tool for developers looking to deploy applications quickly and efficiently.</p><p>Documentation:<br><a href="https://learn.microsoft.com/en-us/azure/container-instances/container-instances-overview"><em>Microsoft</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*ECcHdukvRrxGm2uounVAgA.png" /><figcaption>example for container groups of ACI. <a href="http://learn.microsoft.com/">learn.microsoft.com</a></figcaption></figure><h3>Azure Red Hat OpenShift (ARO)</h3><p>Azure Red Hat OpenShift is a Kubernetes Platform as a Service (PaaS) offering that combines the innovation of open-source technology with the reliability and security of a managed service. <br>It is a collaboration between Microsoft Azure and Red Hat, providing a fully managed OpenShift service that allows you to deploy and scale containers with ease. <br>With Azure Red Hat OpenShift, you get the benefits of a joint engineering, operation, and support from both companies, ensuring a seamless and integrated experience. <br>This service simplifies operations for IT teams and provides developers with the tools they need to build container-based applications.</p><p>Documentations:<br><a href="https://learn.microsoft.com/en-us/azure/openshift/intro-openshift"><em>Microsoft</em></a><em>, </em><a href="https://www.redhat.com/en/technologies/cloud-computing/openshift/azure"><em>Red Hat</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Qc48Dy4OLDZNh1zFAdDyrQ.png" /><figcaption>Azure Red Hat Openshift Architecture</figcaption></figure><h3>How Do I Choose between Those Services?</h3><p>This is the tricky part. Let me assist you in making an informed decision.</p><p>In some cases, you might have a constrain to use a specific service, due to regulatory, compliance etc.<br>As a ground rule if you are looking for more control over the orchestration and configuration then you should go with <strong>AKS or ARO</strong>. If you are looking to implement a fully orchestrated microservice but don’t want/have the time to handle the administration for it, then go with <strong>Azure Container Apps.</strong> And last, if you are not looking for orchestration at all but a containerized environment then I suggest you go with <strong>ACI.</strong></p><p>In other cases, I suggest going through the following flowchart from <a href="https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/compute-decision-tree#choose-a-candidate-service">Microsoft official documentation</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*fch-53JcHd8m5GDtl57clw.png" /><figcaption>Flowchart compute choices. from <a href="https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/compute-decision-tree#choose-a-candidate-service">learn.microsoft.com</a></figcaption></figure><p>I covered Azure’s managed services for containerized apps in this short post. Each vary in the level of user control and administration capabilities, limitations and pricing.<br>Have Fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43eef27c0688" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cutting Azure Costs: A Practical Guide for Cost-Conscious Businesses]]></title>
            <link>https://medium.com/@zaki.rel/cutting-azure-costs-a-practical-guide-for-cost-conscious-businesses-31272fcf12aa?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/31272fcf12aa</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[cost-management]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[finops]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Mon, 15 May 2023 16:09:40 GMT</pubDate>
            <atom:updated>2024-05-23T07:20:15.659Z</atom:updated>
            <content:encoded><![CDATA[<p>Being cost effective in the cloud has become the main focus of most small-medium businesses. This guide’s aim is to help you follow best practices and guidelines to become a cost-conscious Business in Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WGu5guP1y8A1GVyKbEL7A.png" /></figure><p>I will walk you through the <strong>6 aspects of cost efficiency</strong> <strong>methodologies in Azure</strong>. <em>Please note that the aspects are organized in a </em><strong><em>specific order</em></strong><em> to help you implement them</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*eE8c3kiSM8ATSlaOj0nYvg.png" /><figcaption>6 aspects of cost efficiency</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*I3nQSLySpa0ruAXwD--2qA.png" /><figcaption>Azure governance control</figcaption></figure><p>To become a fully cost-aware business, a successful <strong>governance </strong>plan needs to be included. <strong>Governance </strong>in the cloud is an important aspect for businesses especially for medium to large size enterprises.</p><p><strong>So, what is governance in the cloud? </strong>Governance help you maintain control over your applications and resources in the cloud. <br>Each cloud provider has its tools and features to help users better govern their cloud resources. Governance in Azure is primarily implemented with two services:</p><ol><li><a href="https://learn.microsoft.com/en-us/azure/governance/policy/overview">Azure Policy</a> which allows you to create, assign, and manage policy definitions to enforce rules for your resources.</li><li><a href="https://learn.microsoft.com/en-us/azure/cost-management-billing/cost-management-billing-overview">Azure Cost Management</a> which allows you to track cloud usage and expenditures for your Azure resources and other cloud providers.</li></ol><p>For now, I will focus on the <strong>Azure Policy service</strong>.<br>In my role as a cloud architect, I often encounter questions related to cost management and optimization in Azure. A common query that arises is “<em>how do I prevent users from creating specific resources in a particular cloud environment? “—</em> The solution to this problem lies in the Azure Policy service. You can implement the “<strong>Not allowed resource types</strong>” policy definition to restrict users from creating specific resource types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qa1ei-EY-7JPGOhwLbZs8A.png" /><figcaption>policy definition taken from Microsoft</figcaption></figure><p>Don&#39;t worry! you don’t need to write this Json from scratch. This policy (as of many others) is a built-in policy definition in Azure which you can find when you search for it in the Azure portal under Azure policy definitions or you can just access the <a href="https://learn.microsoft.com/en-us/azure/governance/policy/samples/built-in-policies">List of built-in policy definitions</a> in MS docs.</p><p><strong>Wait!</strong> to apply a policy in Azure you need to choose a scope. <br>My company has several departments, each has its own environments split into different products.<br><strong>How can I arrange the resources and apply different policies to each? what is the best way of doing so?<br></strong>Azure splits into 4 management levels (or scope levels)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*fSRb-h5b9KLXudAcMFysfQ.png" /><figcaption>Azure Scopes Levels — taken from learn.microsoft.com</figcaption></figure><p>Start using <a href="https://learn.microsoft.com/en-us/azure/governance/management-groups/create-management-group-portal">Management groups</a>, sooner the better.<br>Azure management group offer a logical container to help you manage access, policy, and compliance across multiple subscriptions.<br>You can assign Azure policies to it, create management groups under management groups to provide more governance depth, split and arrange your subscriptions to categories:<br><strong>1.</strong> <strong>Environments </strong>— Production, Dev, QA<br><strong>2.</strong> <strong>Department </strong>— IT, R&amp;D, HR<br><strong>3.</strong> <strong>Product</strong> — FrontendWeb, BackendDB, Shared resources<br>It’s completely up to your preferences and there <strong>isn’t </strong>a “best” way for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHj1n8xO_DXKcjMANW1Hjg.png" /><figcaption>Management groups hierarchy example</figcaption></figure><p>Final topic on this governance checklist are <strong>tags</strong>.</p><blockquote>Tags are metadata elements that you apply to your Azure resources. They’re key-value pairs that help you identify resources based on settings that are relevant to your organization (taken from <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources">Microsoft Learn</a>)</blockquote><p>Tags play an important role in managing your resources by providing a better view to different aspects in Azure. For example, tags can be used to filter reports by environment or department, filter all resources of a specific workload to help you monitor it better and, of course, in cost analysis graphs and tables.</p><p>Before going and creating a key-value tag pair to each of your resource, it is best-practice to have a tagging strategy for your organization. Most common strategies in tagging are:<br>1. <strong>Workload </strong>— workload: backend-skynet, product: bee-skynet1.<br>2. <strong>Department </strong>— dept: IT, department: HR.<br>3. <strong>Environment </strong>— env: Production, environment: staging.<br>mixing those different strategies together is welcome and encouraged, but keep in mind that “over-tagging” might be the opposite of what we are trying to achieve.</p><p>After tagging strategies had been chosen, it’s time to start tagging the resources!<br>One way of doing so is from the Azure portal. Search for “All resources” and from there you will have an option to check specific resources and tag them all together by clicking the “Assign tags” button and inserting key-value pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZ8wnskPgjHALxYxGBdNEw.png" /></figure><p>Tags can also be applied from the <a href="https://learn.microsoft.com/en-us/cli/azure/tag?view=azure-cli-latest">Azure CLI</a> or <a href="https://learn.microsoft.com/en-us/powershell/module/az.resources/new-aztag?view=azps-9.6.0&amp;viewFallbackFrom=azps-9.1.0">Azure Powershell</a><br>When creating your Azure infrastructure using Terraform it is recommended that a “created-by: Terraform” tag will be added to the Terraform code. for example — creating a resource group name “example” with this tag:</p><pre>resource &quot;azurerm_resource_group&quot; &quot;example&quot; {<br>  name     = &quot;example&quot;<br>  location = &quot;East US&quot;<br>  tags = {<br>    created-by = &quot;terraform&quot;<br>  }<br>}</pre><p>Way to go! you are on the track of being a cost-conscious business with an organized cloud governance. all that is left for us to finish the governance in the cloud section is to automate the creation of Azure tags by utilizing the Azure policy as we did in the previous part.<br><a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-policies">Here </a>is a list of built-in policy definition to help you get started. Make sure you apply the “require a tag on resources” and the “require a tag on resource groups” policy definition on all your resources. These definitions will force the users to create tags on the newly created resources or else they will get denied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*ENEMQPYsZODDiYU2nOj_Jg.png" /><figcaption>Networking and high availability</figcaption></figure><p>Next step when designing a cost-effective cloud infrastructure is to consider the network design topology. If you are <strong>not </strong>looking for recommendations regarding a new cloud environment or you just can’t/not interested in changing your current network architecture, feel free to skip to the next topic.</p><p>A poorly planned cloud architecture can have its signs on the cloud costs. <em>For example </em>— In a fully-connected or in a mesh cloud architecture topology, most virtual networks are connected to each other and traffic transfers between them regularly, shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*CAti6LfEqf2__Ij9Nd0xYQ.png" /><figcaption>mesh network topology</figcaption></figure><p>In Azure, Vnet peering between Vnets costs (at the time of publishing this story) $0.01/GB for inbound data transfer and the same for outbound data transfer when the Vnets are within the same region. <em>Ingress and egress traffic is charged at both ends of the peered networks (</em><a href="https://azure.microsoft.com/en-us/pricing/details/virtual-network/"><em>reference</em></a><em>). </em>In this example, case you have a VM with some sort of DB located in one of the Vnets and queried by other VMs on peered Vnets you will be billed for</p><p><strong>Hub &amp; Spoke</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*EaZi9I64rwLxweoc595NpQ.png" /><figcaption>Hub and Spoke network topology</figcaption></figure><p>When designing a network topology in Azure you should consider the Hub and spoke. This topology uses a main hub Vnet which is the only Vnet with a connection to the public and spokes which are only connected to the main hub and are isolated from each other.<br>This topology presents many benefits:<br>1. <strong>Security — </strong>most of the security components will be based on the hub Vnet and no traffic will move between spokes without a security/monitoring components inspecting it.<br>2. <strong>Management — </strong>each spoke may represent different microservice. You may consider giving appropriate permissions to a specific dev team for a specific spoke.<br>3. <strong>Cost efficient</strong> — for a cost-efficient network topology, the Hub and Spoke is a good choice. Main security resources are all based in one place and no need to create more on each Vnet, also, Vnet peering costs is reduced due to each spoke isolated from each other and only connected to one Vnet.</p><p>When it comes of designing a reliable solution in Azure you should expect your overall costs to climb. Some Azure’s managed services has a built-in high availability by design and some needs to be specified. An example is Azure firewall, it has a <a href="https://learn.microsoft.com/en-us/azure/firewall/features#built-in-high-availability">built-in high availability</a> which may save you money if a different high available option costs more.</p><p>When designing for a redundant IaaS solution the common rule is that the more redundant the option the more it costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*QfPSG4aJuUd2BpbwyM328w.png" /><figcaption>top to bottom — cheap to expensive, Azure redundancy options</figcaption></figure><p>Upon creating a new VM in Azure,<strong> be sure to select a zone</strong> even if your solution doesn’t need to be redundant — Microsoft is planning to charge for cross-zone traffic and when they do, VM in the same zone will avoid this additional cost (<a href="https://azure.microsoft.com/en-us/pricing/details/bandwidth/">Microsoft official doc</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*m2xRfKqZdBfnUqI--j66hA.png" /><figcaption>right sizing the “right” way</figcaption></figure><p>Here we are at the <strong>main go-to action</strong> when it comes to being cost optimized business in Azure.<br>Right sizing a workload is an aspect of cost optimization that is defined by making a resource “tailored” to your cloud needs in terms of cost efficiency.</p><p>An example would be deciding which Azure VM would fit my Computer-aided design (CAD) application:<br>CAD application mostly need a high processing unit to memory ratio and its main workload is vector processing. If, in this case, I would choose the default general purpose machine for this workload I would probably go with the D4sv4 General purpose machine which answers my CPU needs for the moment. But, after doing a little research, <strong>right sizing</strong> the machine to F4sv2 machine will be more beneficial.</p><blockquote>Fsv2-series features a sustained all core Turbo clock speed of 3.4 GHz and a maximum single-core turbo frequency of 3.7 GHz. Intel® AVX-512 instructions are new on Intel Scalable Processors. These instructions provide up to a 2X performance boost to <strong>vector processing workloads</strong> on both single and double precision floating point operations. In other words, they’re really fast for any computational workload. Fsv2-series VMs feature Intel® Hyper-Threading Technology. (<a href="https://learn.microsoft.com/en-us/azure/virtual-machines/fsv2-series">reference</a>)</blockquote><p>When comparing the Pay-as-you-go price for both VMs the Fsv2 series costs less than the Dsv4 series by <strong>17$/month</strong>, so, by right sizing this workload I made its cost-performance efficient whilst saving costs on the short term and the long term.</p><p>The following table shows common guidelines for choosing an Azure’s resource for a workload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*boPwdskhQZd_bY6XYsMcng.png" /><figcaption>Note — consider this table as a common guideline and not the absolute best option for your workload</figcaption></figure><p>Things change rapidly in the cloud so take note that this table shows the guidelines according to the time this story is published, and things change.</p><p><strong>Additional things to consider:</strong></p><ul><li><strong>Using the burstable B series for non production workloads and tests </strong>— <br>Azure’s B-series features a credit based VM which uses less resources on a regular use of the VM (depends on your workload) whilst earning “credits” and when the VM is going to overclock use those credits are being used until you are out or return to regular use.</li><li><strong>Using AMD powered processor for ~10% discount on VM </strong>-<br>when choosing the right VM for your workload consider choosing the AMD option if your workload doesn’t have specific processor type requests. (AMDs are marked by the letter “a” as part of Azure’s VM naming convention — example — Dav4 has the AMD processor unlike his counterpart Dv4).</li><li><strong>Using the low-cost </strong><a href="https://azure.microsoft.com/en-us/blog/azure-virtual-machines-with-ampere-altra-arm-based-processors-generally-available/"><strong>Ampere Altra processor</strong></a><strong> types — <br></strong>for certain workload you may want to consider using the Ampere Altra low-cost processor units marked by the letter “p” in the VM naming convention. In the future Microsoft is planning of implementing the option to choose these processor type for PaaS services too in GA.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*GWfdMKPV_1aIIn-uV0q7uQ.png" /><figcaption>Reserved instances (RI) and Savings plan (SP)</figcaption></figure><p>After our subscription hierarchy is done, our network topology is optimized for our needs and we have “right sized” our Azure resources, it is time to apply the discounts!</p><p>Azure presents 2 types of discounts:</p><ul><li><strong>Azure Reserved Instance:</strong> committing to 1 year/3 years plan for consumption and get up to 72% discount from PAYG prices.<br>reserved instance discount <strong>applies to a specific product SKU, region and scope. </strong>For example: when you purchase <strong>D2 v5 instance</strong> in <strong>EastUS region</strong> on a pay-as -you-go price it will cost ~70$/month with a 1-year RI discount it will be ~41$/month. keep in mind that the discount only applies to this SKU and region. You can learn about more services that get VM reservation discounts <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/prepay-reserved-vm-instances#services-that-get-vm-reservation-discounts">here</a>.</li><li><strong>Azure Savings plan for compute: </strong>the flexible counterpart of the reserved instance discount, the Azure savings plan for compute present you the option to commit on an <strong>hourly</strong>/$ consumption for a 1-year or 3-years term of <strong>ANY </strong>Azure’s compute resource in <strong>ANY</strong> region.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2AJMJCgpvxzviafKN7Zzw.png" /><figcaption><a href="https://learn.microsoft.com/en-us/azure/cost-management-billing/reservations/exchange-and-refund-azure-reservations">learn.microsoft.com</a></figcaption></figure><p>Things to consider:</p><ol><li><strong>The discounts doesn’t add up — </strong>If a specific workload in Azure has RI discount it cannot benefit from the Azure’s savings plan for compute discount also and vice versa. Azure will automatically choose the best discount for the workload and utilize it (from RI to SP to PAYG).</li><li><strong>Split RI — </strong>you can split RI for a VM type you committed to. For example if you purchased a reservation for a D8s_v4 VM (8 CPU) you can split it into two D4s_v4 VM (4 CPU) covered in the same reservation.</li><li><strong>Exchange RI</strong>— Azure provides you with a way to exchange your existing Reserved instances discount with a similar resource. For example, you can exchange SQL managed instance with Elastic pool. <a href="https://learn.microsoft.com/en-us/azure/cost-management-billing/reservations/exchange-and-refund-azure-reservations">Reference</a>.<br><em>Keep in mind that Exchanges will be unavailable for all compute reservations — Azure Reserved Virtual Machine Instances, Azure Dedicated Host reservations, and Azure App Services reservations — purchased on or after January 1, 2024.<br></em>Moreover, you can exchange RI for SP even after Jan 1st 2024.</li><li><strong>Refund — </strong>you can refund <a href="https://learn.microsoft.com/en-us/azure/cost-management-billing/reservations/exchange-and-refund-azure-reservations">most </a>of your reservations <strong>for a total of $50k/year without exceeding that amount.</strong></li><li><strong>Azure commitment discount and other discounts — </strong>it’s important to notice that as for the time I am writing this story Azure Savings plan hourly commitment doesn’t sync with your special discounts (if you got any from a contract with Microsoft or its partners) and you shouldn’t commit to a savings plan if its discount percent is less than your specific discount.</li><li>Regarding software savings, <strong>AHB — Azure hybrid benefit</strong> is the option to “assign” an <strong>owned</strong> OS/SQL license to a VM and avoid paying double for the licensing. This includes Windows server license, SQL license and newly RHEL/SUSE licensing. <a href="https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/managing-and-optimizing-your-azure-hybrid-benefit-usage-with/ba-p/3783541">A great article explaining AHB</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*DQjGY0XcDc0r2CSLF9RO-g.png" /><figcaption>Policy enforcement</figcaption></figure><p>Now that we have our discounts up and running it’s time to get back to the governance section to do a quick checkup. I assembled a list of built-in policies to get you started gaining control of your resources costs.</p><ul><li><a href="https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Fcccc23c7-8427-4f53-ad12-b6a63eb452b3"><strong>Allowed virtual machine size SKUs</strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*C7ykxD1jHhgoNTt3PXle4g.png" /><figcaption>assigning the Allowed virtual machine size SKUs policy</figcaption></figure><p>In this policy you can select the specific type of allowed VM SKU to a scope. Let’s say you created a subscription for the DB department, you can allow only the E and the L series on that subscription to deny the creation of a more expensive SKUs like the M-series or GPU SKUs.</p><ul><li><a href="https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2F6c112d4e-5bc7-47ae-a041-ea2d9dccd749"><strong>Not allowed resource types</strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*MNzC99jsdwtSL5s55FKXqw.png" /><figcaption>assigning the Not allowed resource types policy</figcaption></figure><p>This policy features a more specific action denial than of the “Allowed virtual machine size SKUs<strong>” </strong>definition shown before. In this policy definition you can deny a specific Azure API on a specific scope. for example, case you created a management group named IT that represents your company&#39;s IT cloud infrastructure, you don’t want any public access to this management group so you can utilize this definition and deny the creation of public networking components such as public IP, application gateway etc. This will help you govern your cloud infra and stop the creation of unplanned resources (more public IPs more security components needed).</p><ul><li><a href="https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Fe56962a6-4747-49cd-b67b-bf8b01975c4c"><strong>Allowed locations</strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*DcxDivuH3GnoZXPfQaLyxw.png" /><figcaption>assigning the Allowed location policy</figcaption></figure><p>This policy definition will only allow a specific location for resources to be created in Azure. The policy won’t allow any resources to be created on a different region thus increasing your bandwidth costs (not mentioning a decrease in performance — it is a guide for the cost-Conscious Business after all :)</p><ul><li><a href="https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2F1e30110a-5ceb-460c-a204-c1c3969c6d62"><strong>Require a tag and it’s value on resource</strong></a><strong> and </strong><a href="https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2F8ce3da23-7156-49e4-b145-24f95f9dcb46"><strong>resource groups</strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGq5n7zfIfr7CeLEVFdAQQ.png" /><figcaption>assigning the Require a tag and its value on resources policy</figcaption></figure><p>This policy definition will help you better govern your resources by appending a tag and a value for resources and resource groups.<br>On the next topic, I will show you where can we manage the tagging we appended to resources. In this example I added the Department:R&amp;D tag and value for all resources under the R&amp;D resource group in my Development subscription under the IT management group. Mastering the tagging of resources will be crucial for managing the costs of different departments or product and assigning this policy should be the first act.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*r9ljfSKEhPt87SZsrSIquw.png" /></figure><p>You have made it to the last aspect of our guide for cost-conscious business in Azure. In this aspect I will cover the basics on how to visualize your Azure’s costs using Azure’s portal cost analysis and Azure’s workbooks and how to keep costs under control using budgets with alerts.</p><p>Using Azure’s Cost Analysis tool (portal -&gt; cost management + billing -&gt; cost analysis) will help you monitor your costs by arranging the billing data in tables and graphs for visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_fYdiOzY2Lw8ionSdebMqA.png" /></figure><p>Azure cost analysis frame is made from a set of rules and filters.<br>The first filter you will notice is the “<strong>Scope” marked above in the blue color</strong>. Azure subscription, unlike resource groups and management group is a billing entity and not just a logical container. With that said, you can view costs for the management groups, subscriptions and resource group but subscription is the only resource which you can get invoice for.</p><p>The second set of filters is the <strong>“View” marked above in the red color. </strong>It&#39;s a drop-down list of pre-set views, some are built-in, and some custom made.</p><p>The third filter marks the <strong>time frame, and it is shown in the yellow color.</strong></p><p>The fourth options, <strong>marked in the orange color, will assist you in refining your results </strong>into different graphs, grouping and granularity.</p><p>Here are some cost analysis common views and use-cases:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQj2HLFQwDfdnOtDht-PNg.png" /><figcaption>Last month’s costs grouped by categories</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNoR5TpoTZjvenLoEt5GNA.png" /><figcaption>Category trend over last 3 months</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZAdTIjE1gFkM7O1NKwz1w.png" /><figcaption>Last month’s daily bandwidth costs grouped by service level. (legend — route preference — Microsoft Global Network, inter region traffic)</figcaption></figure><p>Cost analysis tool provides us with the visualization of Azure’s costs, but, to gain control of the costs we will need to set budgets.<br>When setting up a budget you connect it to a subscription with an option to attach it to a filter, I will explain —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*GH9fSQG9C3rVr31_eGJxXA.png" /><figcaption>setting a budget #1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*1iWl6w4CqZWpPXcQ3MGk1w.png" /><figcaption>setting a budget #2</figcaption></figure><p>In the above example I’m setting up an overall budget for my subscription. I have a limit of 5k/month for this subscription, and I wish to get an email once it reaches 90% of that amount (4500$).<br>You can have a filter for each budget to gain more control for each of the categories in your billing profile.</p><p><strong>Best practices</strong></p><ul><li>Setting an overall budget for the entire subscription and a <strong>3 other budgets</strong> for the <strong>main meter categories</strong> you discovered on the cost analysis as filter for the budget. For example, if, on my last month my 3 main meter categories were PostgreSQL, Storage and Virtual Machines each will be set up in a different budget.</li><li><strong>Set up alert condition on 50%, 70%, 95% actual cost consumption each with different alerts.</strong> For the first 50% an email, for the 70% an email and a notification on Slack/SMS/whatsapp bot, for the 95% an email, notification and an automation runbook which can stop non-production VMs and services like Firewall/AKS/Application gateway. The following can be done by creating a new action group on the create budget wizard. The following options are available for an action type on an action group:<br><strong>1. Automation runbook<br>2. Azure Function<br>3. Event Hub<br>4. ITSM<br>5. Logic App<br>6. Webhook</strong></li><li><strong>Try to</strong> <strong>avoid</strong> setting up a logic app to deny the creation of resources as an action type for an action group. This can lead to outages as auto-scale won’t work, that means that any elastic workload will be overwhelmed.</li></ul><p>When it comes to visualization in Azure you can use <strong>Azure workbooks</strong> to display specific data in a holistic dashboard by writing queries in KQL (or just copying ones from the gallery or public GitHub repositories)</p><blockquote>Workbooks provide a flexible canvas for data analysis and the creation of rich visual reports within the Azure portal. They allow you to tap into multiple data sources from across Azure and combine them into unified interactive experiences. Workbooks let you combine multiple kinds of visualizations and analyses, making them great for freeform exploration. (<a href="https://learn.microsoft.com/en-us/azure/azure-monitor/visualize/workbooks-overview">learn.microsoft.com</a>)</blockquote><p><a href="https://github.com/dolevshor/azure-orphan-resources">Azure Orphaned Resources</a> by dolevshor— An Azure workbook that helps summarize all unattached resources (orphaned) and present it in a holistic dashboard. not all unattached resources presented cost money but it’s a great way to govern your subscriptions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XUJO-17RCV_70s9_4IKRew.png" /><figcaption>Github.com — dolevshor</figcaption></figure><p><a href="https://github.com/scautomation/Workbook-CostManagement-Example">Workbook-CostManagement-Example</a> by scautomation (<a href="https://techcommunity.microsoft.com/t5/itops-talk-blog/customize-cost-data-visualizations-with-azure-workbooks-and/ba-p/2387779">Microsoft tech community</a>)</p><p>The above guide will help you create and customize cost data visualization by using cost management API calls. You can learn more about creating workbooks to fit your needs in <a href="https://github.com/microsoft/Application-Insights-Workbooks">this GitHub repository.</a></p><p><strong>L</strong>ast, but not least, on our visualization and control aspect — The Azure advisor.</p><p>Azure Advisor is a personalized cloud consultant that helps you follow best practices to optimize your Azure deployments. Which include<strong> 5 Pillars</strong>:</p><ol><li>Cost</li><li>Security</li><li>Reliability</li><li>Operational excellence</li><li>Performance</li></ol><p>Azure Advisor will provide you with an overall score in all those pillars and in each one individually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jbg0AeoSPIg82p0wOcH53w.png" /><figcaption>example Azure Advisor cost recommendation</figcaption></figure><p>In the Cost pillar, Azure Advisor can provide you with SKU recommendations, commitment tiers if applicable, and right sizing and RIs recommendations based on your consumption and Azure usage.</p><p>Regarding more detailed than the advisor visual recommendations on purchasing reserved instances you can use <a href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connect-azure-cost-management">Microsoft Cost Management Power BI App</a>. <em>note — doesn’t support pay-as-you-go Microsoft Customer Agreements or indirect Microsoft Customer Agreements. Microsoft Partner Agreements are also not supported. If you have an unsupported agreement, you can use Exports to save the cost data to a share and then connect to it using Power BI</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-EtahJ2MnJ06rLSK12_Ng.png" /><figcaption><a href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connect-azure-cost-management">learn.microsoft.com</a></figcaption></figure><p>That’s it for now. Please let me know if that guide helped your business become cost-conscious in Azure and share your feedback, it will be much appriciated.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31272fcf12aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Red Hat OpenShift (ARO) Persistent Volume on Azure Files]]></title>
            <link>https://medium.com/@zaki.rel/azure-red-hat-openshift-aro-persistent-volume-on-azure-files-7c100b545c3d?source=rss-b814a28aabf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c100b545c3d</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[azure-redhat-openshift]]></category>
            <category><![CDATA[azure-files]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[red-hat-openshift]]></category>
            <dc:creator><![CDATA[Tzahi Ariel]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 15:31:19 GMT</pubDate>
            <atom:updated>2024-05-23T07:40:42.679Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Red Hat OpenShift? What are Persistent Volumes? Why should I choose to provision in Azure files?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OWXu7iLhodWWs0RCm6o1Mw.png" /><figcaption>Openshift — Switching to a robust storage</figcaption></figure><p>To anyone that isn’t familiar with Red Hat OpenShift —</p><blockquote>It is a unified platform to build, modernize, and deploy applications at scale. <a href="https://www.redhat.com/en/technologies/cloud-computing/openshift">ref</a></blockquote><blockquote>Azure Red Hat OpenShift extends <a href="https://kubernetes.io/">Kubernetes</a>. Running containers in production with Kubernetes requires additional tools and resources. This often includes needing to juggle image registries, storage management, networking solutions, and logging and monitoring tools — all of which must be versioned and tested together. Building container-based applications requires even more integration work with middleware, frameworks, databases, and CI/CD tools. Azure Red Hat OpenShift combines all this into a single platform, bringing ease of operations to IT teams while giving application teams what they need to execute. <a href="https://learn.microsoft.com/en-us/azure/openshift/intro-openshift">ref</a></blockquote><p><strong>TL;DR</strong><br>Red Hat OpenShift features an advanced developer experience including automated image builds, built-in image registry, options for Enterprise users including support, patching and more on top of a Kubernetes-like based container orchestration platform.</p><p>Azure Red Hat OpenShift offers a fully functional OpenShift cluster running and managed on the Azure cloud.</p><p><strong>What are Persistent Volumes?<br></strong>Persistent volumes are storage pieces represented resources based on the cluster to be used by a workload (pod/deployment/dc). They are provisioned either manually by an admin or by a storageClass.</p><p><strong>Then, what is a storageClass?<br></strong>storageClass resources defines the storage type which allows the user to request a type of storage for the above explained workloads. By default, Azure Red Hat OpenShift provisions Azure Disks as the default provisioner. That means that when a PV is created it will automatically provision an Azure disk on the cloud platform.</p><p><strong>Then, why should i choose to provision on Azure Files?</strong><br>1. Support the following access modes — ReadWriteOnce, ReadOnlyMany, ReadWriteMany.<br>2. Can be shared /across multiple compute resources (NFS, SMB, Rest API).<br>3. Easy to handle content through Azure portal/CLI/API, support Shared Access Signatures tokens and Azure identity features.</p><p>In the following tutorial i will explain how to create a connection between Azure Red Hat Openshift to Azure Files in an Azure Storage Account shown by this architecture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*1bE1HQ1ddfgNfC3jAPy5bg.jpeg" /></figure><p><strong>Prerequisites</strong><br>- Azure Subscription<br>- Azure Storage Account<br>- Azure Red Hat Openshift Cluster</p><p><strong>Setting up a test web app</strong></p><pre>## Create a new project named poc1<br>oc new-project poc1<br>## Create a new s2i deploymentConfig based on nodejs.<br>oc new-app https://github.com/nodeshift-starters/devfile-sample.git --as-deployment-config=true<br>## If the pull from github fails make sure the 80/443 to and from github is open on the NSG.<br>## Track the build process, wait for the build to finish: <br>oc logs -f buildconfig/devfile-sample<br>## Exposing the service<br>oc expose service/devfile-sample</pre><p><strong>Setting up the variables</strong></p><pre>AZURE_FILES_RESOURCE_GROUP=&lt;storage_account_rg&gt;<br>LOCATION=&lt;region&gt;<br>SUB_ID=&lt;your_sub_id&gt;<br>AZURE_STORAGE_ACCOUNT_NAME=&lt;storage_account_name&gt;<br>ARO_RESOURCE_GROUP=&lt;aro_rg_here&gt;<br>CLUSTER_NAME=&lt;aro_cluster_name&gt;<br>ARO_SERVICE_PRINCIPAL_ID=$(az aro show -g $ARO_RESOURCE_GROUP -n $CLUSTER_NAME --query servicePrincipalProfile.clientId -o tsv)<br>ARO_API_SERVER=$(az aro list --query &quot;[?contains(name,&#39;$CLUSTER_NAME&#39;)].[apiserverProfile.url]&quot; -o tsv)<br>SECRET_NAME=secret-$AZURE_STORAGE_ACCOUNT_NAME<br>FILESHARE_NAME=&lt;fileshare_name&gt;</pre><p><strong>Setting up permissions</strong></p><pre># Assign contributor role to the ARO SP on SA resource group<br>az role assignment create --role Contributor --scope /subscriptions/$SUB_ID/resourceGroups/$AZURE_FILES_RESOURCE_GROUP --assignee $ARO_SERVICE_PRINCIPAL_ID</pre><pre>## login to the ARO Cluster<br>oc login -u kubeadmin -p $(az aro list-credentials -g $ARO_RESOURCE_GROUP -n $CLUSTER_NAME --query=kubeadminPassword -o tsv) $ARO_API_SERVER<br>## Create a cluster role for the secret reader<br>oc create clusterrole azure-secret-reader --verb=create,get --resource=secrets<br>oc adm policy add-cluster-role-to-user azure-secret-reader system:serviceaccount:kube-system:persistent-volume-binder</pre><p><strong>Creating the storageClass for Azure Files provisioning</strong></p><pre>cat &lt;&lt; EOF &gt;&gt; azure-storageclass-azure-file.yaml<br>kind: StorageClass<br>apiVersion: storage.k8s.io/v1<br>metadata:<br>  name: azure-file-storageclass<br>provisioner: kubernetes.io/azure-file<br>parameters:<br>  location: $LOCATION<br>  secretNamespace: kube-system<br>  skuName: Standard_LRS<br>  storageAccount: $AZURE_STORAGE_ACCOUNT_NAME<br>  resourceGroup: $AZURE_FILES_RESOURCE_GROUP<br>reclaimPolicy: Retain<br>volumeBindingMode: Immediate<br>EOF</pre><pre>oc create -f azure-storageclass-azure-file.yaml</pre><p><strong>Changing the default storageClass used</strong></p><pre>oc patch storageclass managed-premium -p &#39;{&quot;metadata&quot;: {&quot;annotations&quot;:{&quot;storageclass.kubernetes.io/is-default-class&quot;:&quot;false&quot;}}}&#39;<br>oc patch storageclass azure-file-storageclass -p &#39;{&quot;metadata&quot;: {&quot;annotations&quot;:{&quot;storageclass.kubernetes.io/is-default-class&quot;:&quot;true&quot;}}}&#39;<br># Check the storageClass with<br>oc describe sc/$azure-file-storageclass</pre><p>In case the ARO is private, and the storage account isn’t public and is integrated to a VNET then you will need to authorize connection from the ARO Vnet to the Storage Account’s allowed VNET list as shown on the image below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*_CxGJjxMOGZtybvDhEaclw.png" /></figure><p><strong>Create a Secret for the storage account key</strong></p><pre>oc create secret generic $SECRET_NAME --from-literal=azurestorageaccountname=$AZURE_STORAGE_ACCOUNT_NAME --from-literal=azurestorageaccountkey=’&lt;storage-account-key&gt;’<br>## must have ‘ before and after<br>## on the above command please copy the storage account key from the portal.</pre><p><strong>Create a new file share in the Azure portal</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*CRW8dKT6_PwE6hQls5Eymw.png" /></figure><p><strong>Create a new persistent volume</strong></p><pre>cat &lt;&lt; EOF &gt;&gt; pv-fileshare.yaml<br>apiVersion: &quot;v1&quot;<br>kind: &quot;PersistentVolume&quot;<br>metadata:<br>  name: &quot;pv-fileshare&quot; <br>spec:<br>  capacity:<br>    storage: &quot;3Gi&quot; <br>  accessModes:<br>    - &quot;ReadWriteMany&quot;<br>  storageClassName: azure-file-storageclass<br>  azureFile:<br>    secretName: $SECRET_NAME<br>    shareName: $FILESHARE_NAME<br>    readOnly: false<br>EOF</pre><pre>oc create -f pv-fileshare.yaml</pre><p><strong>Create a new persistent volume claim</strong></p><pre>cat &lt;&lt; EOF &gt;&gt; pvc-fileshare.yaml<br>apiVersion: v1<br>kind: PersistentVolumeClaim<br>metadata:<br>  name: &quot;pvc-fileshare&quot;<br>spec:<br>  accessModes:<br>  - ReadWriteMany<br>  storageClassName: azure-file-storageclass<br>  resources:<br>     requests:<br>       storage: 3Gi<br>  storageClassName: azure-file-storageclass<br>  volumeName: &quot;pv-fileshare&quot;<br>EOF</pre><pre>oc create -f pvc-fileshare.yaml</pre><pre>#Check that the claim is bound successfully to the pv<br>oc get pvc</pre><p><strong>Setting the mountpoint on the DeploymentConfig</strong></p><pre>oc set volume dc/devfile-sample --add --name=pv-fileshare1 -t pvc-fileshare1 --claim-size=3G -m /data --claim-class=&#39;azure-file-storageclass&#39;</pre><p><strong>Testing the mount</strong></p><pre>export POD=$(oc get pods --field-selector=status.phase==Running -o jsonpath={.items[].metadata.name})<br>oc exec $POD -- bash -c &quot;echo &#39;azure file storage&#39; &gt;&gt; /data/test.txt&quot;</pre><p><strong>Next step is to check on the portal that the file exists</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*w4lhgp19BBkJXDx2sIAsFg.png" /></figure><p><strong>Troubleshooting common connection issues:<br></strong>Check connection from the pod to the file share</p><pre>nc -zvw3 xxxx.file.core.windows.net 445</pre><p>Check NSGs on both subnets in each Vnet/Interface.<br>If placed on different Vnets make sure Vnet peering is connected.</p><p><strong>T</strong>hat is All. If you liked this story, please show your support by using the 👏 button below this story. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c100b545c3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>