<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rizwan Ahmed</title>
    <description>The latest articles on DEV Community by Rizwan Ahmed (@rrizwann).</description>
    <link>https://dev.to/rrizwann</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252323%2F28e26752-acce-40c7-82f9-be865c9cb0b0.jpg</url>
      <title>DEV Community: Rizwan Ahmed</title>
      <link>https://dev.to/rrizwann</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rrizwann"/>
    <language>en</language>
    <item>
      <title>Cost-Safe Guardrails for Microsoft Foundry with the Azure AI Gateway</title>
      <dc:creator>Rizwan Ahmed</dc:creator>
      <pubDate>Thu, 19 Nov 2026 21:43:57 +0000</pubDate>
      <link>https://dev.to/rrizwann/cost-safe-guardrails-for-microsoft-foundry-with-the-azure-ai-gateway-36mc</link>
      <guid>https://dev.to/rrizwann/cost-safe-guardrails-for-microsoft-foundry-with-the-azure-ai-gateway-36mc</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://rizdynamics.com" rel="noopener noreferrer"&gt;Riz Dynamics AI&lt;/a&gt;. Azure AI Gateway is in public preview and may change before general availability.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most teams piloting Microsoft Foundry hit the same wall eventually: a model deployment with no spending ceiling, and no clean way to add one without touching application code. Azure AI Gateway -- a separate product from Azure API Management, currently in public preview -- sits in front of your Foundry deployments and gives you that ceiling, plus routing and failover across models.&lt;/p&gt;

&lt;p&gt;Here's how to set it up, step by step.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Add a Model and Create an Alias
&lt;/h2&gt;

&lt;p&gt;Add your Foundry model backend to the gateway, then create an alias on top of it. An alias is the stable endpoint your application code calls -- you can swap, add, or retire backend models behind it without changing a single line of client code.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Configure Rate Limits and Cost Limits
&lt;/h2&gt;

&lt;p&gt;This is where the actual cost control lives. Set a token rate limit (for example, 1,000 tokens/minute) and a hard cost limit (for example, $2/day) per alias. Exceed either, and requests get throttled at the gateway -- before they hit your bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Configure Authentication and API Keys
&lt;/h2&gt;

&lt;p&gt;Set up Entra role assignment, generate API keys, and configure the system-assigned managed identity. One gotcha: you may hit an Entra directory-permission error during this step that only a tenant admin can resolve -- don't assume it's something you can self-serve past.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Monitor Token Consumption and View API Logs
&lt;/h2&gt;

&lt;p&gt;The gateway's Monitoring tabs -- Overview, Models, Tools, Policies, Traces -- give you visibility into what's actually consuming tokens and cost. Note: these stay empty until you connect Application Insights.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Configure Model Routing and Failover
&lt;/h2&gt;

&lt;p&gt;Add a second backend model, set priority/weight, configure retries and an exclusion window for failed backends. This is the multi-model resilience piece, separate from the cost controls above.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gap worth knowing about
&lt;/h2&gt;

&lt;p&gt;Azure AI Gateway handles cost and traffic control well, but it isn't a content-safety layer. There's no native prompt filtering or PII redaction built in. If that's part of your risk surface, pair it with Azure AI Content Safety.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Read the full walkthrough with screenshots of every configuration screen on &lt;a href="https://rizdynamics.com/insights/cost-safe-guardrails-for-microsoft-foundry-with-the-azure-ai-gateway/" rel="noopener noreferrer"&gt;rizdynamics.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>azure</category>
      <category>cloud</category>
      <category>ai</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
