<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[DotNetCircuit]]></title><description><![CDATA[Weekly deep-dives on AI engineering for senior .NET developers. MCP, agents, production LLM patterns, and the architecture of shipping AI in regulated enterprises — without leaving the .NET stack. ]]></description><link>https://newsletter.dotnetcircuit.com</link><image><url>https://substackcdn.com/image/fetch/$s_!9vyI!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2faf3749-a3b6-45d1-9990-28c2323f0e57_512x512.png</url><title>DotNetCircuit</title><link>https://newsletter.dotnetcircuit.com</link></image><generator>Substack</generator><lastBuildDate>Sun, 03 May 2026 06:50:18 GMT</lastBuildDate><atom:link href="https://newsletter.dotnetcircuit.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[DotnetCircuit]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[dileepsreepathi@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[dileepsreepathi@substack.com]]></itunes:email><itunes:name><![CDATA[Dileep]]></itunes:name></itunes:owner><itunes:author><![CDATA[Dileep]]></itunes:author><googleplay:owner><![CDATA[dileepsreepathi@substack.com]]></googleplay:owner><googleplay:email><![CDATA[dileepsreepathi@substack.com]]></googleplay:email><googleplay:author><![CDATA[Dileep]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Building and Deploying an MCP Server]]></title><description><![CDATA[using .Net Aspire and Azure Container Apps]]></description><link>https://newsletter.dotnetcircuit.com/p/building-and-deploying-an-mcp-server</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/building-and-deploying-an-mcp-server</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Sat, 25 Apr 2026 11:51:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Ek64!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ek64!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ek64!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 424w, https://substackcdn.com/image/fetch/$s_!Ek64!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 848w, https://substackcdn.com/image/fetch/$s_!Ek64!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 1272w, https://substackcdn.com/image/fetch/$s_!Ek64!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ek64!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png" width="1456" height="626" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:626,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:186816,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ek64!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 424w, https://substackcdn.com/image/fetch/$s_!Ek64!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 848w, https://substackcdn.com/image/fetch/$s_!Ek64!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 1272w, https://substackcdn.com/image/fetch/$s_!Ek64!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb482294a-5e2b-431c-a092-adcf25f92f1b_2222x956.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The Model Context Protocol (MCP) is quickly becoming the standard way to give AI models access to your tools and data. Think of it as a USB-C port for AI &#8212; a universal interface that lets any compatible LLM (Claude, GPT-4, Gemini) call your backend functions in a structured, safe, and consistent way.</p><p>But most tutorials stop at &#8220;run it locally.&#8221; This article shows you the full picture: build an MCP server in .NET, orchestrate it with .NET Aspire, and deploy it to Azure Container Apps &#8212; production-ready from the start.</p><div><hr></div><h2>End-to-end horizontal flow</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gdeO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gdeO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 424w, https://substackcdn.com/image/fetch/$s_!gdeO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 848w, https://substackcdn.com/image/fetch/$s_!gdeO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!gdeO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gdeO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png" width="1456" height="839" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:839,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:234583,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gdeO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 424w, https://substackcdn.com/image/fetch/$s_!gdeO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 848w, https://substackcdn.com/image/fetch/$s_!gdeO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!gdeO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F004ffa4c-f94f-4a0a-9fbc-19960e7dcaa1_1884x1086.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p></p><div><hr></div><p></p><h2>The Stack at a Glance</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wc9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wc9w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 424w, https://substackcdn.com/image/fetch/$s_!Wc9w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 848w, https://substackcdn.com/image/fetch/$s_!Wc9w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 1272w, https://substackcdn.com/image/fetch/$s_!Wc9w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wc9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png" width="1014" height="426" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:426,&quot;width&quot;:1014,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74828,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Wc9w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 424w, https://substackcdn.com/image/fetch/$s_!Wc9w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 848w, https://substackcdn.com/image/fetch/$s_!Wc9w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 1272w, https://substackcdn.com/image/fetch/$s_!Wc9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31b07703-7690-4a25-a8c8-d898af83fb41_1014x426.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>GITHUB repo for this :</p><p> https://github.com/DileepSreepathi/learn-mcp/tree/master/sample-mcp</p><h2>Project Structure</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mfKT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mfKT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 424w, https://substackcdn.com/image/fetch/$s_!mfKT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 848w, https://substackcdn.com/image/fetch/$s_!mfKT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 1272w, https://substackcdn.com/image/fetch/$s_!mfKT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mfKT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png" width="1456" height="343" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:343,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60409,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mfKT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 424w, https://substackcdn.com/image/fetch/$s_!mfKT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 848w, https://substackcdn.com/image/fetch/$s_!mfKT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 1272w, https://substackcdn.com/image/fetch/$s_!mfKT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43ba05e-fd6e-45fe-9770-d2c03e92e641_1632x384.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><p>Three projects, clean separation of concerns. The <code>AppHost</code> never ships to production &#8212; it is the development and build-time orchestrator.</p><h2>What Is MCP?</h2><p>MCP is a JSON-RPC 2.0 protocol. When an AI model needs to call your tool, it sends a POST request like this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;f09438a9-8756-4b88-9452-ba330beebf62&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "Add",
    "arguments": { "numberA": 5, "numberB": 3 }
  }
}</code></pre></div><p>Your server executes the function and replies:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;0b1182e1-6cb2-47ce-a1b1-74aaf06a80e1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [{ "type": "text", "text": "8" }]
  }
}
</code></pre></div><p>Before calling tools, the model issues <code>tools/list</code> to discover what your server exposes and their input schemas. The <code>ModelContextProtocol.AspNetCore</code> library handles all of this wire-level plumbing for you.</p><div><hr></div><h2>Step 1 &#8212; Define Your Tools</h2><p>This is where your business logic lives. The pattern is attribute-driven &#8212; decorate a class, decorate each method, done.</p><p>check this file path :  <code>//Calculator/Tools/CalculatorTool.cs</code></p><ul><li><p><code>[McpServerToolType]</code> &#8212; tells the framework this class contains tools.</p></li><li><p><code>[McpServerTool]</code> &#8212; marks a method as an MCP-callable tool.</p></li><li><p><code>[Description("...")]</code> &#8212; this text is sent to the LLM as the tool&#8217;s description. Write it as you would document a public API.</p></li><li><p>The framework uses reflection to automatically generate the JSON Schema for each tool&#8217;s parameters. Your C# types (<code>double</code>, <code>long</code>, <code>List&lt;long&gt;</code>) become the schema.</p></li><li><p>Throwing an exception from a tool is safe &#8212; the framework catches it and returns a structured error to the client.</p><p></p><p></p><div><hr></div><h2>Step 2 &#8212; Wire Up the MCP Server</h2><p><code>check this file : //Calculator/Program.cs<br></code></p><p>Four things to notice:</p><p><code>AddMcpServer()</code> &#8212; registers the MCP protocol handler in the DI container.</p><p><code>.WithHttpTransport(o =&gt; o.Stateless = true)</code> &#8212; each HTTP request is fully independent. No session state. This is the right choice for containers and serverless platforms where any replica can serve any request.</p><p><code>.WithTools&lt;CalculatorTool&gt;()</code> &#8212; registers your tool class. The framework discovers all <code>[McpServerTool]</code> methods automatically.</p><p><code>app.MapMcp("/mcp")</code> &#8212; exposes the MCP endpoint. This single line is where LLMs connect to your server.</p><p></p><div><hr></div><h2>Step 3 &#8212; Shared Infrastructure (ServiceDefaults)</h2><p>Rather than re-configure OpenTelemetry, health checks, and resilience in every service, Aspire projects use a <code>ServiceDefaults</code> shared library. One call, <code>builder.AddServiceDefaults()</code>, applies everything.<code><br></code></p><p>check this path for the code : </p><p><code>//ServiceDefaults/Extensions.cs </code></p><p></p><ul><li><p><strong>Structured logs</strong> with scopes and formatted messages &#8212; great for querying in Azure Log Analytics.</p></li><li><p><strong>Distributed tracing</strong> &#8212; every HTTP call (including MCP tool calls) produces a trace span.</p></li><li><p><strong>Runtime metrics</strong> &#8212; GC pressure, thread pool, memory.</p></li><li><p><strong>HTTP resilience by default</strong> &#8212; any <code>HttpClient</code> automatically gets retry logic and a circuit breaker.</p><p></p><p>And the health check endpoints</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;e094e0c6-a6eb-4084-80cd-9e505440c8bc&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">public static WebApplication MapDefaultEndpoints(this WebApplication app)
{
    if (app.Environment.IsDevelopment())
    {
        app.MapHealthChecks("/health");           // readiness
        app.MapHealthChecks("/alive", new HealthCheckOptions
        {
            Predicate = r =&gt; r.Tags.Contains("live")
        });                                        // liveness
    }
    return app;
}

</code></pre></div></li></ul></li></ul><p></p><div><hr></div><h2>Step 4 &#8212; Aspire AppHost (Local Orchestration)</h2><p>The AppHost is how you run everything locally without <code>docker-compose</code> or manual port juggling.</p><p>check here :  <code>//AppHost/Program.cs</code></p><p></p><p>When you <code>dotnet run</code> the AppHost:</p><ol><li><p>It starts the <code>Calculator</code> service as a child process.</p></li><li><p>It assigns ports and injects connection strings/endpoints as environment variables.</p></li><li><p>It launches the <strong>Aspire Dashboard</strong> &#8212; a local UI showing logs, traces, and metrics for all services in real time.</p></li></ol><p><code>WithExternalHttpEndpoints()</code> tells Aspire (and Azure) that the service should be reachable from outside the container environment &#8212; not just from other services in the same mesh.</p><p>you can see the mcp server is running in the Aspire dashboard. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BNub!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BNub!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 424w, https://substackcdn.com/image/fetch/$s_!BNub!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 848w, https://substackcdn.com/image/fetch/$s_!BNub!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 1272w, https://substackcdn.com/image/fetch/$s_!BNub!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BNub!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png" width="1456" height="684" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:684,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:200612,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BNub!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 424w, https://substackcdn.com/image/fetch/$s_!BNub!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 848w, https://substackcdn.com/image/fetch/$s_!BNub!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 1272w, https://substackcdn.com/image/fetch/$s_!BNub!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5878187c-f1b2-4bd4-9723-6af67883871e_3398x1596.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Run this  npx @modelcontextprotocol/inspector  at the /Calculator path , we connected to the mcp server and tools are listed where we can execute them. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!29AR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!29AR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 424w, https://substackcdn.com/image/fetch/$s_!29AR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 848w, https://substackcdn.com/image/fetch/$s_!29AR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 1272w, https://substackcdn.com/image/fetch/$s_!29AR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!29AR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png" width="1456" height="739" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:739,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:369933,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!29AR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 424w, https://substackcdn.com/image/fetch/$s_!29AR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 848w, https://substackcdn.com/image/fetch/$s_!29AR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 1272w, https://substackcdn.com/image/fetch/$s_!29AR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695d386e-d6c0-49bf-a7fb-1dcd33a92df9_3372x1712.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div><hr></div><h2>Step 5 &#8212; Azure Deployment</h2><p>The entire Azure deployment is configured in a single file:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;yaml&quot;,&quot;nodeId&quot;:&quot;d8596bf6-f56b-4998-8492-92950f359540&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-yaml">
# azure.yml
name: mcp-calculator
services:
  app:
    language: dotnet
    project: ./AppHost/AppHost.csproj
    host: containerapp
</code></pre></div><p>Run <code>azd up</code> and the Azure Developer CLI:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Bl1f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Bl1f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 424w, https://substackcdn.com/image/fetch/$s_!Bl1f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 848w, https://substackcdn.com/image/fetch/$s_!Bl1f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 1272w, https://substackcdn.com/image/fetch/$s_!Bl1f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Bl1f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png" width="969" height="583" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:583,&quot;width&quot;:969,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:136376,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Bl1f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 424w, https://substackcdn.com/image/fetch/$s_!Bl1f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 848w, https://substackcdn.com/image/fetch/$s_!Bl1f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 1272w, https://substackcdn.com/image/fetch/$s_!Bl1f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d201c6d-a426-4486-a3fe-80d4f971538f_969x583.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><ol><li><p>Reads <code>azure.yml</code> and uses the AppHost as the deployment manifest.</p></li><li><p>Builds a container image from the Calculator project.</p></li><li><p>Pushes the image to <strong>Azure Container Registry (ACR)</strong>.</p></li><li><p>Creates a <strong>Container Apps Environment</strong> with managed HTTPS ingress.</p></li><li><p>Provisions a <strong>Log Analytics Workspace</strong> &#8212; OpenTelemetry telemetry flows here automatically.</p></li><li><p>Assigns a <strong>Managed Identity</strong> &#8212; no credentials, no secrets to rotate.</p></li></ol><p></p><p>Once all the resources are deployed , you will get the url like : </p><p>Your MCP server is live at:</p><p>https://calc-mcp.proudsand-248b073a.eastus2.azurecontainerapps.io/mcp </p><p>connect the same on the npx inspector to access the tools. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lDW6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lDW6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 424w, https://substackcdn.com/image/fetch/$s_!lDW6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 848w, https://substackcdn.com/image/fetch/$s_!lDW6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 1272w, https://substackcdn.com/image/fetch/$s_!lDW6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lDW6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png" width="1256" height="1088" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1088,&quot;width&quot;:1256,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:175981,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lDW6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 424w, https://substackcdn.com/image/fetch/$s_!lDW6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 848w, https://substackcdn.com/image/fetch/$s_!lDW6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 1272w, https://substackcdn.com/image/fetch/$s_!lDW6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c321b0e-2f5d-468b-9aef-8b99c2a1bdef_1256x1088.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>What Makes This Production-Ready</h2><p><strong>Stateless HTTP transport</strong> &#8212; any container replica can handle any request. Scale out without sticky sessions.</p><p><strong>OpenTelemetry from day one</strong> &#8212; traces, metrics, and logs flow to Log Analytics without any post-deployment wiring.</p><p><strong>Managed Identity</strong> &#8212; the container accesses ACR and Azure resources using RBAC, not stored secrets.</p><p><strong>Health probes</strong> &#8212; <code>/alive</code> (liveness) and <code>/health</code> (readiness) let the container platform restart unhealthy instances and remove them from rotation during startup.</p><p><strong>Zero infrastructure code</strong> &#8212; Aspire generates the Container Apps configuration from the AppHost. No Bicep files to maintain manually.</p><div><hr></div><p>The most important insight from this project is how little code you write to expose a meaningful MCP server:</p><ul><li><p><strong>Tool implementation</strong>: ~60 lines of pure business logic</p></li><li><p><strong>MCP wiring</strong>: 5 lines in <code>Program.cs</code></p></li><li><p><strong>Azure deployment</strong>: 6 lines of YAML</p></li></ul><p>Everything else &#8212; the JSON-RPC protocol handling, JSON Schema generation, container packaging, HTTPS termination, health checks, and distributed tracing &#8212; is handled by the framework stack.</p><p>This is what the combination of <code>ModelContextProtocol.AspNetCore</code>, <code>.NET Aspire</code>, and <code>azd</code> is designed to do: let you focus on the capabilities you want to expose to AI, and handle the infrastructure plumbing as a solved problem.</p><div><hr></div><p><strong>Complete  Request Life-cycle :</strong></p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AXm-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AXm-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 424w, https://substackcdn.com/image/fetch/$s_!AXm-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 848w, https://substackcdn.com/image/fetch/$s_!AXm-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 1272w, https://substackcdn.com/image/fetch/$s_!AXm-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AXm-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png" width="1456" height="903" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:903,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:417330,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195431994?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AXm-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 424w, https://substackcdn.com/image/fetch/$s_!AXm-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 848w, https://substackcdn.com/image/fetch/$s_!AXm-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 1272w, https://substackcdn.com/image/fetch/$s_!AXm-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50b73fe1-6abe-4ef8-9747-529382c21e7a_2222x1378.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><br></p>]]></content:encoded></item><item><title><![CDATA[Join my new subscriber chat]]></title><description><![CDATA[A private space for us to converse and connect]]></description><link>https://newsletter.dotnetcircuit.com/p/join-my-new-subscriber-chat</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/join-my-new-subscriber-chat</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Sat, 25 Apr 2026 06:05:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!KYZT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today I&#8217;m announcing a brand new addition to my Substack publication: DotNetCircuit subscriber chat.</p><p>This is a conversation space exclusively for subscribers&#8212;kind of like a group chat or live hangout. I&#8217;ll post questions and updates that come my way, and you can jump into the discussion.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://open.substack.com/pub/dileepsreepathi/chat&quot;,&quot;text&quot;:&quot;Join chat&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://open.substack.com/pub/dileepsreepathi/chat"><span>Join chat</span></a></p><div><hr></div><h2>How to get started</h2><ol><li><p><strong>Get the Substack app by clicking <a href="https://substack.com/app/app-store-redirect">this link</a> or the button below.</strong> New chat threads won&#8217;t be sent sent via email, so turn on push notifications so you don&#8217;t miss conversation as it happens. You can also access chat <a href="https://open.substack.com/pub/dileepsreepathi/chat">on the web</a>.</p></li></ol><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://substack.com/app/app-store-redirect&quot;,&quot;text&quot;:&quot;Get app&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://substack.com/app/app-store-redirect"><span>Get app</span></a></p><ol start="2"><li><p><strong>Open the app and tap the Chat icon.</strong> It looks like two bubbles in the bottom bar, and you&#8217;ll see a row for my chat inside.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KYZT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KYZT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KYZT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KYZT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KYZT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KYZT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:241528,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://kylewarrentest.substack.com/i/114198534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KYZT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KYZT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KYZT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KYZT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f63c9a-2296-4c96-a2f9-52648999bb00_2000x1000.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol start="3"><li><p><strong>That&#8217;s it!</strong> Jump into my thread to say hi, and if you have any issues, check out <a href="https://support.substack.com/hc/en-us/sections/360007461791-Frequently-Asked-Questions">Substack&#8217;s FAQ</a>.</p></li></ol>]]></content:encoded></item><item><title><![CDATA[Wiring an LLM to MCP: Natural Language Tool Calling in C#]]></title><description><![CDATA[Part 3 of the MCP series &#8212; we add a real LLM that decides when and how to call our calculator tool.]]></description><link>https://newsletter.dotnetcircuit.com/p/wiring-an-llm-to-mcp-natural-language</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/wiring-an-llm-to-mcp-natural-language</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Fri, 24 Apr 2026 18:23:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!YUe7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YUe7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YUe7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 424w, https://substackcdn.com/image/fetch/$s_!YUe7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 848w, https://substackcdn.com/image/fetch/$s_!YUe7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!YUe7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YUe7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png" width="1456" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1541935,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195364510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YUe7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 424w, https://substackcdn.com/image/fetch/$s_!YUe7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 848w, https://substackcdn.com/image/fetch/$s_!YUe7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!YUe7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fc37eaf-fd0b-47b1-a7f4-67f21a81358a_2378x1324.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Where We Left Off</strong></p><p>In <a href="https://newsletter.dotnetcircuit.com/p/setting-up-your-mcp-environment">Part 1</a> we built a tiny MCP server that exposes a CalculatorTool.Add method.</p><p>In <a href="https://newsletter.dotnetcircuit.com/p/mcp-client">Part 2</a> we built an MCP client that connects to that server, discovers its tools, and calls them manually &#8212; you wrote CallToolAsync(&#8221;add&#8221;, {a:5, b:8}) explicitly in code.</p><p>That works, but it&#8217;s you doing the thinking. The whole point of MCP is to let an LLM do the thinking. This article wires them together: a user types natural language, the LLM decides which tool to call and with what arguments, and the result flows back into the model&#8217;s final answer.</p><p></p><p>Three things happen that didn&#8217;t happen in Part 2:</p><p>1. The LLM reads the tool descriptions and decides it needs to call add.</p><p>2. The UseFunctionInvocation() middleware intercepts the LLM&#8217;s tool-call request, executes the MCP tool, and feeds the result back to the LLM &#8212; all without you writing any loop.</p><p>3. The LLM composes the final answer from the tool result.</p><p></p><p><strong>Prerequisites</strong></p><p>Same as Part 2, plus one addition:</p><p>- .NET 10 SDK &#8212; [Download here](https://dotnet.microsoft.com/download)</p><p>- McpCalServer from Part 1 (already built)</p><p>- Ollama installed and running locally &#8212; [ollama.com](https://ollama.com)</p><p>- Pull the model: ollama pull llama3.2:latest</p><p>- Confirm it&#8217;s running: ollama serve (default port 11434)</p><p>&gt; Why Ollama? It exposes an OpenAI-compatible REST API at http://localhost:11434/v1, so you can use the standard OpenAI client &#8212; no API key, no cloud, no cost. Swap it for Azure OpenAI or OpenAI proper by changing one URL.</p><p></p><p><strong>Step 1: Create the Project</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c6c724a1-220d-4db4-a71f-78240a717d73&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">
dotnet new console -n llm-client
cd llm-client
</code></pre></div><p>Install the packages:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;f6aa7d8f-60ea-48d8-ba6e-81bad44b820a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">dotnet add package Microsoft.Extensions.AI --prerelease
dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease
dotnet add package ModelContextProtocol --prerelease
dotnet add package Microsoft.Extensions.Hosting
</code></pre></div><p></p><p>Your .csproj will look like this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;tsx&quot;,&quot;nodeId&quot;:&quot;042c8391-e2df-44de-a8fd-0ba45291010b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-tsx">&lt;Project Sdk="Microsoft.NET.Sdk"&gt;

  &lt;PropertyGroup&gt;
    &lt;OutputType&gt;Exe&lt;/OutputType&gt;
    &lt;TargetFramework&gt;net10.0&lt;/TargetFramework&gt;
    &lt;RootNamespace&gt;llm_client&lt;/RootNamespace&gt;
    &lt;ImplicitUsings&gt;enable&lt;/ImplicitUsings&gt;
    &lt;Nullable&gt;enable&lt;/Nullable&gt;
  &lt;/PropertyGroup&gt;


 &lt;ItemGroup&gt;
    &lt;PackageReference Include="Microsoft.Extensions.AI" Version="10.*-*" /&gt;
    &lt;PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="10.*-*" /&gt;
    &lt;PackageReference Include="Microsoft.Extensions.Hosting" Version="9.*-*" /&gt;
    &lt;PackageReference Include="ModelContextProtocol" Version="0.*-*" /&gt;
  &lt;/ItemGroup&gt;
&lt;/Project&gt;
</code></pre></div><p></p><p>Two package families are in play here:</p><p>ModelContextProtocol : Speaks MCP &#8212; connects to the server, lists tools, calls them </p><p>Microsoft.Extensions.AI : .OpenAI  Speaks to LLMs &#8212; abstracts chat clients, handles function-calling loops</p><p></p><p><strong>Step 2: Write the LLM Client</strong></p><p>Replace Program.cs with:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;eae4c532-85d0-45d5-8944-f152c64f3470&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">using Microsoft.Extensions.AI;
using ModelContextProtocol.Client;
using ModelContextProtocol.Protocol;
using OpenAI;
using System.ClientModel;
using System.Text.Json;

// Connect to Ollama via its OpenAI-compatible API
var openAiClient = new OpenAIClient(new ApiKeyCredential("ollama"), new OpenAIClientOptions
{
    Endpoint = new Uri("http://localhost:11434/v1")
});

IChatClient client = new ChatClientBuilder(openAiClient.GetChatClient("llama3.2:latest").AsIChatClient())
    .UseFunctionInvocation()
    .Build();

var clientTransport = new StdioClientTransport(new()
{
         Name = "Calculator Server",
        Command = "dotnet",
        Arguments = ["run", "--project", "../McpCalServer.csproj"]
});

Console.WriteLine("Setting up stdio transport");

await using var mcpClient = await McpClient.CreateAsync(clientTransport);

Console.WriteLine("Listing tools");
var mcpTools = await mcpClient.ListToolsAsync();
foreach (var tool in mcpTools)
{
    Console.WriteLine($"Connected to server with tools: {tool.Name}");
    Console.WriteLine($"Tool description: {tool.Description}");
}

// Use MCP tools directly &#8212; McpClientTool implements AITool
var chatOptions = new ChatOptions
{
    Tools = [.. mcpTools]
};

var userMessage = "add 2 and 4";
Console.WriteLine($"User: {userMessage}");

var response = await client.GetResponseAsync(userMessage, chatOptions);

// Check if any tool calls were made
foreach (var message in response.Messages)
{
    foreach (var content in message.Contents)
    {
        if (content is FunctionCallContent functionCall)
        {
            Console.WriteLine($"[TOOL CALLED] {functionCall.Name}({string.Join(", ", functionCall.Arguments?.Select(a =&gt; $"{a.Key}={a.Value}") ?? [])})");
        }
        else if (content is FunctionResultContent functionResult)
        {
            Console.WriteLine($"[TOOL RESULT] {functionResult.Result}");
        }
    }
}

Console.WriteLine($"Assistant: {response.Text}");</code></pre></div><p></p><p></p><p><strong>Step 3: Run It</strong></p><p><strong>dotnet run</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-YFk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-YFk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 424w, https://substackcdn.com/image/fetch/$s_!-YFk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 848w, https://substackcdn.com/image/fetch/$s_!-YFk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 1272w, https://substackcdn.com/image/fetch/$s_!-YFk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-YFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png" width="1456" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102013,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195364510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-YFk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 424w, https://substackcdn.com/image/fetch/$s_!-YFk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 848w, https://substackcdn.com/image/fetch/$s_!-YFk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 1272w, https://substackcdn.com/image/fetch/$s_!-YFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c4a9f75-7ef0-4a05-b51a-d96b402afc1a_1890x594.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Deep Dive: What&#8217;s Actually Happening</strong></p><p><strong>The Key Insight: McpClientTool Is an AITool</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;deed88fe-aef0-40d9-8c07-9b0bf3f14b6a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">var chatOptions = new ChatOptions
{
    Tools = [.. mcpTools]
};
</code></pre></div><p>mcpTools is IList&lt;McpClientTool&gt;. The McpClientTool type (from the MCP SDK) implements AITool (from Microsoft.Extensions.AI). That&#8217;s not an accident &#8212; it&#8217;s the bridge the two ecosystems share.</p><p>When you spread mcpTools into ChatOptions.Tools, the LLM receives the tool&#8217;s name, description, and JSON input schema &#8212; exactly what it needs to reason about when and how to call it. No manual translation, no custom adapters.</p><p><strong>The Agentic Loop: UseFunctionInvocation()</strong></p><p>This single line is doing more work than it looks like:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;9cd05de0-24ca-45ba-bcf2-c549f24ef3ad&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">IChatClient client = new ChatClientBuilder(...)
    .UseFunctionInvocation()  // &#8592; this
    .Build();</code></pre></div><p>Without it, when the LLM decides to call a tool, GetResponseAsync returns immediately and you get a raw FunctionCallContent in the response &#8212; you&#8217;d have to execute the tool yourself and call the LLM again. That&#8217;s the manual loop from Part 2, applied to the LLM side.</p><p>UseFunctionInvocation() installs a middleware that handles that loop automatically:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HU3B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HU3B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 424w, https://substackcdn.com/image/fetch/$s_!HU3B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 848w, https://substackcdn.com/image/fetch/$s_!HU3B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 1272w, https://substackcdn.com/image/fetch/$s_!HU3B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HU3B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png" width="1456" height="1362" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1362,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1822126,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195364510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HU3B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 424w, https://substackcdn.com/image/fetch/$s_!HU3B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 848w, https://substackcdn.com/image/fetch/$s_!HU3B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 1272w, https://substackcdn.com/image/fetch/$s_!HU3B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd75947-656d-4756-b426-e65fce1b7b1f_1798x1682.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Reading the Message History</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;60de2e6c-d4d2-40ca-9124-98e741decdf1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">foreach (var message in response.Messages)
{
    foreach (var content in message.Contents)
    {
        if (content is FunctionCallContent functionCall) { ... }
        else if (content is FunctionResultContent functionResult) { ... }
    }
}</code></pre></div><p>response.Messages is the full turn history added during this call &#8212; including intermediate tool calls and results. This is useful for:</p><p>- Debugging: see exactly which tool the LLM chose and with what arguments.</p><p>- Audit trails: log every tool invocation without modifying the tool itself.</p><p>- Multi-step reasoning: detect if the LLM called multiple tools in sequence.</p><p>response.Text is the convenience shortcut for the final assistant text.</p><p></p><p><strong>Key Takeaways:</strong></p><p>What Why it matters</p><p>McpClientTool implements AITool, Zero-glue bridge between MCP and Microsoft.Extensions.AI &#8212; spread MCP tools directly into ChatOptions</p><p>UseFunctionInvocation() middleware Handles the LLM &#8594; tool &#8594; LLM loop automatically; you await once</p><p>IChatClient abstraction Swap Ollama for Azure OpenAI or Claude </p><p>response.Messages Full audit trail of every tool call and result the LLM made</p><p>response.Text Final natural-language answer, ready to display</p><p>Stdio transport unchanged The LLM layer sits above MCP &#8212; the server doesn&#8217;t know or care there&#8217;s an LLM involved</p><p></p>]]></content:encoded></item><item><title><![CDATA[MCP Client]]></title><description><![CDATA[Part 2: A high-level walkthrough of how a Model Context Protocol (MCP) client connects to a server, discovers tools, and invokes them &#8212; using a small .NET 10 console app]]></description><link>https://newsletter.dotnetcircuit.com/p/mcp-client</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/mcp-client</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Thu, 23 Apr 2026 21:53:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UEEC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UEEC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UEEC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!UEEC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!UEEC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!UEEC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UEEC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5651105,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/195285480?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UEEC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!UEEC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!UEEC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!UEEC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b6744c1-3325-43b5-8aeb-8408c084b96a_2816x1536.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>What is an MCP Client?</strong></p><p>An <strong>MCP client</strong> is the piece of code that connects to an <a href="https://newsletter.dotnetcircuit.com/p/setting-up-your-mcp-environment">MCP server</a> , asks &#8220;what can you do?&#8221;, and then calls those capabilities on behalf of your application (or an LLM).</p><p>The entire client flow in our demo is four steps:</p><p>1. Transport &#8594; how to reach the server</p><p>2. Connect &#8594; handshake and negotiate</p><p>3. Discover &#8594; list tools (and resources)</p><p>4. Invoke &#8594; call a tool, get a result</p><p></p><p><strong>Step 1 &#8212; Transport: how to reach the server</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;acc5e2d2-245d-46cf-b037-e2ad9ed83d46&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">var clientTransport = new StdioClientTransport(new()
{
    Name = "Calculator Server",
    Command = "dotnet",
    Arguments = ["run", "--project", ".../McpCalServer.csproj"]
});
</code></pre></div><p></p><p>The transport answers one question: <strong>how do client and server talk?</strong></p><p>&#8220;StdioClientTransport&#8221; means the client <strong>spawns the server as a child process</strong> and communicates via stdin/stdout. No ports, no network &#8212; just two processes piping JSON back and forth.</p><p>This is the standard pattern for local MCP servers. For remote servers you&#8217;d swap in an HTTP/SSE transport; everything else stays the same.</p><p></p><p><strong>Step 2 &#8212; Connect: handshake and negotiate</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;8077c6ef-cfd0-4ec2-ae20-d6e009e94001&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">await using var mcpClient = await McpClient.CreateAsync(clientTransport);
</code></pre></div><p></p><p>This single line does three things under the hood:</p><p>1. <strong>Starts the server process</strong> (via the transport)</p><p>2. <strong>Sends &#8220;initialize&#8221;</strong> &#8212; client tells the server its protocol version and capabilities</p><p>3. <strong>Receives server capabilities</strong> &#8212; does it support tools? resources? prompts?</p><p>After &#8220;CreateAsync&#8221; returns, both sides know what&#8217;s on the table. The <strong>await using</strong> ensures the connection (and child process) is cleaned up when done.</p><p><strong>Step 3 &#8212; Discover: list tools and resources</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;97315d53-2dec-482f-9b1c-0fecc9b15ca9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">var tools = await mcpClient.ListToolsAsync();
foreach (var tool in tools)
    Console.WriteLine($"  - {tool.Name}: {tool.Description}");
</code></pre></div><p></p><p>&#8220;ListToolsAsync&#8221; fires a `tools/list` request. The server responds with each tool&#8217;s <strong>name</strong>, <strong>description</strong>, and <strong>input schema</strong> (a JSON Schema object). Nothing is hard-coded &#8212; the client learns what exists at runtime.</p><p>This is the same data you&#8217;d pass to an LLM&#8217;s function-calling API. MCP tool schemas are natively compatible with OpenAI, Anthropic, and Gemini tool-use formats.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;bbf1e688-9cf7-43bb-bdf4-9f3aaa17efde&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">// Resources are optional &#8212; not all servers expose them
try
{
    var resources = await mcpClient.ListResourcesAsync();
}
catch (Exception ex)
{
    Console.WriteLine("No resources available: " + ex.Message);
}
</code></pre></div><p></p><p>Resources are data sources (files, DB rows, API responses) the server can expose. The `try/catch` isn&#8217;t sloppy code &#8212; it&#8217;s correct MCP behavior. If the server didn&#8217;t advertise resources during the handshake, calling `ListResourcesAsync` will throw. The client probes; the server declares <code>he truth.</code></p><p></p><p><strong>Step 4 &#8212; Invoke: call a tool, get a result</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;d0d3d7e1-add8-4613-b9b4-69ee6362538f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">var addResult = await mcpClient.CallToolAsync(
    "add",
    new Dictionary&lt;string, object?&gt; { ["a"] = 5, ["b"] = 8 },
    cancellationToken: CancellationToken.None
);</code></pre></div><p></p><p>&#8220;CallToolAsync&#8221; sends a `tools/call` request with the tool name and its arguments. The server runs the method and returns a <strong>content array</strong> &#8212; a structured result that can contain text, images, or embedded resources.</p><p>The `ExtractTextResult` helper in the demo pulls the first text item out of that array. In a real LLM agent you&#8217;d pass the whole content array back to the model a<code>e tool result.it is shown in the below complete program.cs code. </code></p><p></p><p><strong>Where to take it next:</strong></p><p>1. <strong>Plug it into an LLM.</strong> Pass `tools` straight into `Microsoft.Extensions.AI`&#8217;s function-calling pipeline so a model can decide <em>when</em> to call `add` vs `help`.</p><p>2. <strong>Connect to multiple servers.</strong> Create one &#8220;McpClient&#8221; per server and merge their tool lists &#8212; the host doesn&#8217;t care where a tool lives.</p><p>3. <strong>Switch transports.</strong> Replace &#8220;StdioClientTransport&#8221; with an HTTP/SSE transport to talk to a remote MCP server (e.g. one hosted on Azure Container Apps).</p><p>4. <strong>Add resources and prompts.</strong> Extend the server with [McpServerResource] and [McpServerPrompt] to feel the full surface area.</p><p>5. <strong>Add auth + cancellation.</strong> Real clients pass `CancellationToken`s through (we already <code>o) and layer auth</code> <code>on the transport.</code></p><p></p><p><code>complete program.cs code</code></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;8b01391d-9ed7-4b8c-bca0-7aa837f6ebfd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">using Microsoft.Extensions.AI;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using ModelContextProtocol.Client;
using System.Text.Json;



Console.WriteLine("&#128640; Starting MCP C# Client...");

try
{
    var builder = Host.CreateApplicationBuilder(args);

        builder.Configuration
        .AddEnvironmentVariables()
        .AddUserSecrets&lt;Program&gt;();

    var clientTransport = new StdioClientTransport(new()
    {
        Name = "Calculator Server",
        Command = "dotnet",
        Arguments = ["run", "--project", "../McpCalServer.csproj"]
    });

     Console.WriteLine("&#128225; Connecting to MCP server...");

    // Create and connect the MCP client
    await using var mcpClient = await McpClient.CreateAsync(clientTransport);

    Console.WriteLine("&#9989; Connected to MCP server successfully!");

     // List available tools
    Console.WriteLine("\n&#128203; Listing available tools:");
    var tools = await mcpClient.ListToolsAsync();
    foreach (var tool in tools)
    {
        Console.WriteLine($"  - {tool.Name}: {tool.Description}");
    }
    // Test calculator operations
    Console.WriteLine("\n&#129518; Testing Calculator Operations:");

     // Addition
    var addResult = await mcpClient.CallToolAsync(
        "add",
        new Dictionary&lt;string, object?&gt;() { ["a"] = 5, ["b"] = 8 },
        cancellationToken: CancellationToken.None
    );
    Console.WriteLine($"Add 5 + 8 = {ExtractTextResult(addResult)}");

     // Help
    var helpResult = await mcpClient.CallToolAsync(
        "help",
        new Dictionary&lt;string, object?&gt;(),
        cancellationToken: CancellationToken.None
    );
    Console.WriteLine($"\n&#128214; Help Information:");
    Console.WriteLine(ExtractTextResult(helpResult));

     // List resources if available
    try
    {
        Console.WriteLine("\n&#128196; Listing available resources:");
        var resources = await mcpClient.ListResourcesAsync();
        foreach (var resource in resources)
        {
            Console.WriteLine($"  - {resource.Name}: {resource.Description}");
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine("  No resources available or error listing resources: " + ex.Message);
    }

    Console.WriteLine("\n&#10024; Client operations completed successfully!");
}
catch(Exception ex)
{
     Console.WriteLine($"&#10060; Error running MCP client: {ex.Message}");
    Console.WriteLine($"Stack trace: {ex.StackTrace}");
}

static string ExtractTextResult(object result)
{
    try
    {
        if (result is IEnumerable&lt;object&gt; contentList)
        {
            foreach (var content in contentList)
            {
                if (content is IDictionary&lt;string, object&gt; contentDict &amp;&amp;
                    contentDict.TryGetValue("text", out var text))
                {
                    return text?.ToString() ?? "No text content";
                }
            }
        }
        
        // Fallback: try to serialize the entire result
        return JsonSerializer.Serialize(result, new JsonSerializerOptions { WriteIndented = true });
    }
    catch
    {
        return result?.ToString() ?? "No result";
    }
}
</code></pre></div><p></p>]]></content:encoded></item><item><title><![CDATA[Structs, Classes, and the new Keyword

]]></title><description><![CDATA[The C# Misconception Every Developer Gets Wrong]]></description><link>https://newsletter.dotnetcircuit.com/p/structs-classes-and-the-new-keyword</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/structs-classes-and-the-new-keyword</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Mon, 20 Apr 2026 18:12:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6miY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6miY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6miY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 424w, https://substackcdn.com/image/fetch/$s_!6miY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 848w, https://substackcdn.com/image/fetch/$s_!6miY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 1272w, https://substackcdn.com/image/fetch/$s_!6miY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6miY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png" width="680" height="620" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:620,&quot;width&quot;:680,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6miY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 424w, https://substackcdn.com/image/fetch/$s_!6miY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 848w, https://substackcdn.com/image/fetch/$s_!6miY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 1272w, https://substackcdn.com/image/fetch/$s_!6miY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e1c442c-1b89-4125-996c-af8eafa7d67c_680x620.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It&#8217;s one of the most misunderstood aspects of C# &#8212; and the answer might surprise you.</p><p>Every C# developer encounters this moment of confusion:</p><p>&#8220;Wait&#8230; if structs are value types that live on the stack, why am I using new to create them? Isn&#8217;t new for heap allocation?&#8221;</p><p>Let&#8217;s clear it up once and for all.</p><p>The Misconception</p><p>Many developers carry this mental model from languages like C or C++:</p><p>new = heap allocation = reference types only</p><p>In C#, this is incorrect. The new keyword doesn&#8217;t mean &#8220;allocate on the heap.&#8221; It means &#8220;call the constructor to initialize this object.&#8221; Where the memory lives is a completely separate concern.</p><p>Classes vs Structs: A Quick Refresher</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;cf2a4763-95be-49d7-aa91-fd99a36c866e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">// Reference type - lives on the heap
public class EmployeeClass
{
public string Name;
public int Id;
}</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;860b17ab-7cae-48cc-86ac-24b9fd09ca3c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">// Value type - lives on the stack
public struct EmployeeStruct
{
public string Name;
public int Id;
}</code></pre></div><p></p><p>Here&#8217;s how they compare:</p><p><strong>Class:</strong></p><p>- Type category: Reference type</p><p>- Memory: Heap</p><p>- Default value: null</p><p>- Assignment: Copies the reference</p><p><strong>Struct</strong>:</p><p>- Type category: Value type</p><p>- Memory: Stack (or inline within the containing object)</p><p>- Default value: All fields zeroed</p><p>- Assignment: Copies the entire value</p><p>What new Actually Does</p><p>Here&#8217;s the key insight &#8212; new behaves differently depending on the type:</p><p><strong>For a Class &#8594; Allocates memory on the heap + calls constructor</strong></p><p><strong>For a Struct &#8594; Calls constructor only &#8212; no heap allocation</strong></p><p>For structs, the memory already exists on the stack the moment you declare the variable. new simply initializes it.</p><p>You Don&#8217;t Need new for Structs</p><p>This is the part that surprises most people. Consider this struct:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4fba3b3a-555f-4ea4-a0ca-292ec7fab6d8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">public struct Point
{
public int X;
public int Y;
}</code></pre></div><p>You can absolutely use it without new:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;7010cada-debf-45b6-8d3a-f230484e14d3&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Point p; // memory is allocated on the stack right here
p.X = 10; // assign each field manually
p.Y = 20;
Console.WriteLine($"({p.X}, {p.Y})"); // (10, 20)</code></pre></div><p></p><p>No new. No heap. It just works.</p><p>So Why Do People Use new With Structs?</p><p>Convenience. Without new, the compiler enforces a strict rule: you must assign every field before you read the struct.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;03333390-feb8-421a-bddc-67919e6af9fa&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">Point p;
Console.WriteLine(p.X); // Compile error: Use of unassigned variable &#8216;p&#8217;
Even assigning some fields isn&#8217;t enough:
Point p;
p.X = 10;
Console.WriteLine(p.X); // Compile error: &#8216;p&#8217; is not fully assigned</code></pre></div><p></p><p>You must assign all fields:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;75c2d5b0-8735-4526-960e-4e2f979605a2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Point p;
p.X = 10;
p.Y = 20;
Console.WriteLine(p.X); // Now it compiles</code></pre></div><p></p><p>Using new zero-initializes everything in one shot:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;71be63f4-c947-4d4a-ae0d-9d1c8a588c7e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Point p = new Point(); // X = 0, Y = 0 - fully assigned, ready to use
Console.WriteLine(p.X); // Works immediately</code></pre></div><p></p><p>That&#8217;s it. That&#8217;s the reason. new on a struct is a shortcut for &#8220;set all fields to their default values.&#8221;</p><p>With Custom Constructors</p><p>Structs can have parameterized constructors just like classes:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;bd08ba4a-d783-4e76-b04b-446c47f76414&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">public struct Point
{
public int X;
public int Y;
public Point(int x, int y)
{
X = x;
Y = y;
}
}
Point p = new Point(10, 20); // calls constructor - still NO heap allocation</code></pre></div><p>The new here calls your constructor, but the Point still lives on the stack.</p><p>Proof: Visualizing Memory</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;1a11e9ba-16d5-4511-bca5-2de5bace4b51&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">void Demo()
{
Point s = new Point(5, 10); // struct - value type
EmployeeClass c = new EmployeeClass(); // class - reference type
}</code></pre></div><p>Here&#8217;s what memory actually looks like:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OcRy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OcRy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 424w, https://substackcdn.com/image/fetch/$s_!OcRy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 848w, https://substackcdn.com/image/fetch/$s_!OcRy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 1272w, https://substackcdn.com/image/fetch/$s_!OcRy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OcRy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png" width="1400" height="303" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:303,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!OcRy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 424w, https://substackcdn.com/image/fetch/$s_!OcRy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 848w, https://substackcdn.com/image/fetch/$s_!OcRy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 1272w, https://substackcdn.com/image/fetch/$s_!OcRy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4837b28a-76a7-49ed-ac0c-1f898b6142e3_1400x303.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The struct s lives entirely on the stack. The class c has a reference on the stack pointing to the object on the heap.</p><p>Classes MUST Use new</p><p>Unlike structs, you cannot use a class without new:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c9d78fad-af04-41a4-bdf0-0e643e1ba2aa&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">// Struct &#8212; valid without new
Point p;
p.X = 10;
p.Y = 20;  // &#10003;

// Class &#8212; NOT valid without new
EmployeeClass e;
e.Name = &#8220;Kumar&#8221;;  // &#10060; Compile error &#8212; no object exists yet</code></pre></div><p>A class variable without new is just a null reference. There&#8217;s no object in memory to write to. new is mandatory because it creates the object on the heap.</p><p>Assignment Behavior: The Real Difference</p><p>This is where the value-type vs reference-type distinction truly matters.</p><p>Struct (value type) &#8212; copies the data:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;cd60fb69-e8d9-4e4f-a405-f2b42cfdf987&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Point a = new Point(10, 20);
Point b = a; // copies all values into b
b.X = 99;
Console.WriteLine(a.X); // 10 - unchanged
Console.WriteLine(b.X); // 99 - independent copy
</code></pre></div><p>Class (reference type) &#8212; copies the reference:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;605dee74-f105-4385-a7d7-ab5e6865878d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">EmployeeClass a = new EmployeeClass { Name = &#8220;Alice&#8221; };
EmployeeClass b = a;   // copies the REFERENCE &#8212; both point to same object

b.Name = &#8220;Bob&#8221;;

Console.WriteLine(a.Name);  // Bob  &#8592; changed!
Console.WriteLine(b.Name);  // Bob  &#8592; same object</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iFVY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iFVY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 424w, https://substackcdn.com/image/fetch/$s_!iFVY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 848w, https://substackcdn.com/image/fetch/$s_!iFVY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 1272w, https://substackcdn.com/image/fetch/$s_!iFVY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iFVY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png" width="1400" height="278" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:278,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!iFVY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 424w, https://substackcdn.com/image/fetch/$s_!iFVY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 848w, https://substackcdn.com/image/fetch/$s_!iFVY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 1272w, https://substackcdn.com/image/fetch/$s_!iFVY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ac1c36-a8ca-4f65-85e5-3a1b9b0ea244_1400x278.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Common Interview Question</strong></p><p>&#8220;When should you use a struct instead of a class?&#8221;</p><p>Use a struct when:</p><p>- The type is small (Microsoft recommends under 16 bytes)</p><p>- It&#8217;s logically a single value (like Point, Color, DateTime)</p><p>- It&#8217;s immutable or short-lived</p><p>- You want to avoid heap allocations for performance</p><p>Use a class for everything else.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y0D_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y0D_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 424w, https://substackcdn.com/image/fetch/$s_!Y0D_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 848w, https://substackcdn.com/image/fetch/$s_!Y0D_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 1272w, https://substackcdn.com/image/fetch/$s_!Y0D_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y0D_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png" width="892" height="202" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:202,&quot;width&quot;:892,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Y0D_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 424w, https://substackcdn.com/image/fetch/$s_!Y0D_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 848w, https://substackcdn.com/image/fetch/$s_!Y0D_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 1272w, https://substackcdn.com/image/fetch/$s_!Y0D_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fc5d0af-b2e0-48fb-995e-5f1c6cdc3ae0_892x202.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The new keyword in C# is not about where memory is allocated. It&#8217;s about calling a constructor to initialize an object. Structs already have their memory on the stack &#8212; new just makes sure all fields start with known values.</p><p>Next time someone asks why structs use new, you&#8217;ll know: it&#8217;s not allocation, it&#8217;s initialization.</p><p>. . .</p><p>Found this helpful? Give it a clap and share it with a fellow .NET developer who&#8217;s been confused by this too.</p><p>Follow me for more C# and .NET deep dives.</p>]]></content:encoded></item><item><title><![CDATA[MCP Server]]></title><description><![CDATA[Part 1: Building Your First MCP Server: A Simple Calculator Tool in C#]]></description><link>https://newsletter.dotnetcircuit.com/p/setting-up-your-mcp-environment</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/setting-up-your-mcp-environment</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Wed, 15 Apr 2026 19:58:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lxq7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications - it provides a standardized way to connect AI models to different data sources and tools.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lxq7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lxq7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 424w, https://substackcdn.com/image/fetch/$s_!lxq7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 848w, https://substackcdn.com/image/fetch/$s_!lxq7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 1272w, https://substackcdn.com/image/fetch/$s_!lxq7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lxq7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79422,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/194333390?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lxq7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 424w, https://substackcdn.com/image/fetch/$s_!lxq7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 848w, https://substackcdn.com/image/fetch/$s_!lxq7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 1272w, https://substackcdn.com/image/fetch/$s_!lxq7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f5b73-a8ae-4a7b-b878-b95cc786212b_1472x736.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>In the previous articles, you learned about the core concepts of the Model Context Protocol (MCP) &#8212; what it is, how it works, and why it matters. If not, check here: </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;0e2a0ce4-1a72-41bd-a6fd-ebcb58e3063c&quot;,&quot;caption&quot;:&quot;What is MCP and why should you care?&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;MCP Core Concepts &quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:117196222,&quot;name&quot;:&quot;Dileep&quot;,&quot;bio&quot;:&quot;An enthusiastic and highly motivated with excellent leadership skills, eager to learn new technologies and methodologies in the field of Computer Science and Engineering. &quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2498c561-be37-47da-ad7a-263aa1e04470_110x142.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2026-04-14T21:04:41.966Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ZzcL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.dotnetcircuit.com/p/mcp-core-concepts&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:194225047,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:2018953,&quot;publication_name&quot;:&quot;DotNetCircuit&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!9vyI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2faf3749-a3b6-45d1-9990-28c2323f0e57_512x512.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p></p><p>In this article, I&#8217;m going to walk you through building a simple MCP server and setting up its environment from scratch. By the end, you&#8217;ll have a working MCP server that exposes a calculator tool that any MCP-compatible host (like Claude Desktop, VS Code Copilot, or your own client) can invoke.</p><p><strong>What Are We Building?</strong></p><p>A simple <strong>**MCP Server**</strong> that exposes a <strong>**Calculator Tool**</strong>. This tool will accept two numbers and return their sum. It&#8217;s minimal by design &#8212; the goal is to understand the structure and workflow, not to build something complex.</p><p>Prerequisites:</p><ul><li><p>- <strong>.NET 10 SDK</strong> (or later) installed</p></li><li><p><strong>IDE/Editor</strong>: Visual Studio Code.</p></li><li><p><strong>Package Managers</strong>: NuGet</p></li><li><p><strong>API Keys</strong>: For any AI services you plan to use in your host applications</p></li></ul><p></p><h2><strong>Basic MCP Server Structure</strong></h2><p>An MCP server typically includes:</p><ul><li><p><strong>Server Configuration</strong>: Setup port, authentication, and other settings</p></li><li><p><strong>Resources</strong>: Data and context made available to LLMs</p></li><li><p><strong>Tools</strong>: Functionality that models can invoke</p></li><li><p><strong>Prompts</strong>: Templates for generating or structuring text</p></li></ul><p></p><p>For this demo, we&#8217;ll focus on <strong>Server Configuration</strong> and <strong>Tools.</strong></p><p><strong> Step 1: Create a .NET Console Application</strong></p><p><code>dotnet new console -n MCPCalServer</code></p><p><code>cd MCPCalServer</code></p><p>This scaffolds a minimal .NET console application.</p><p></p><p><strong>Step 2: Install the NuGet Packages</strong></p><p><code>dotnet add package ModelContextProtocol --prerelease</code></p><p><code>dotnet add package Microsoft.Extensions.Hosting</code></p><p></p><p>Your `.csproj` file should now look something li<code>e this:</code></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;xml&quot;,&quot;nodeId&quot;:&quot;0da32c28-16f3-4113-92cd-18dc5ec115ba&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-xml">&lt;Project Sdk="Microsoft.NET.Sdk"&gt;

  &lt;PropertyGroup&gt;
    &lt;OutputType&gt;Exe&lt;/OutputType&gt;
    &lt;TargetFramework&gt;net10.0&lt;/TargetFramework&gt;
    &lt;ImplicitUsings&gt;enable&lt;/ImplicitUsings&gt;
    &lt;Nullable&gt;enable&lt;/Nullable&gt;
  &lt;/PropertyGroup&gt;

  &lt;ItemGroup&gt;
    &lt;PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.6" /&gt;
    &lt;PackageReference Include="ModelContextProtocol" Version="1.2.0" /&gt;
  &lt;/ItemGroup&gt;

&lt;/Project&gt;
</code></pre></div><p></p><p>Replace the contents of `Program.cs` with the following:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;bec3736e-00d8-453d-b76e-8478261ee1f9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">using System.ComponentModel;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using ModelContextProtocol.Server;


var builder = Host.CreateApplicationBuilder(args);
builder.Logging.AddConsole(
    consoleLogOptions =&gt;
    {
        consoleLogOptions.LogToStandardErrorThreshold = LogLevel.Trace;
    }
);

builder.Services
        .AddMcpServer()
        .WithStdioServerTransport()
        .WithToolsFromAssembly();
await builder.Build().RunAsync();


[McpServerToolType]
public static class CalculatorTool
{
    [McpServerTool, Description("Add two numbers")]
    public static string Add(int a , int b) =&gt; $"Sum {a +b}";
}</code></pre></div><p></p><p><strong>Let&#8217;s Break This Down</strong></p><p></p><p><strong>1. Host Setup</strong></p><p></p><p><code>var builder = Host.CreateApplicationBuilder(args);</code></p><p></p><p>We use the .NET Generic Host (`Microsoft.Extensions.Hosting`) to create a long-lived application. This gives us dependency injection, configuration, and graceful shutdown out of the box.</p><p><strong>2. Logging Configuration</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;8ea20b44-9b4a-476b-b9da-f90cc8d315ac&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">builder.Logging.AddConsole(

consoleLogOptions =&gt;

{

consoleLogOptions.LogToStandardErrorThreshold = LogLevel.Trace;

}

);</code></pre></div><p></p><p>We configure console logging to write to <strong>**stderr**</strong>. This is important because MCP uses <strong>**stdio**</strong> (stdin/stdout) as the transport layer. If logs went to stdout, they would corrupt the MCP protocol messages. By directing logs to stderr, we keep the communication channel clean.</p><p><strong>3. MCP Server Registration</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;3671c10f-02fa-4161-b0b5-c26acbe9f824&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">builder.Services

.AddMcpServer()

.WithStdioServerTransport()

.WithToolsFromAssembly();</code></pre></div><p></p><p></p><p>This is where the magic happens:</p><p><strong>AddMcpServer()</strong>&#8212; Registers the MCP server into the dependency injection container.</p><p><strong>WithStdioServerTransport()</strong>&#8212; Configures the server to communicate over standard input/output. This is the most common transport for local MCP servers.</p><p><strong>WithToolsFromAssembly()</strong>&#8212; Automatically discovers and registers all classes marked with `[McpServerToolType]` in the current assembly. No manual registration needed.</p><p><strong> 4. The Calculator Tool</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;07f06a88-1c45-4340-9491-267981be77af&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">[McpServerToolType]

public static class CalculatorTool

{

[McpServerTool, Description(&#8221;Add two numbers&#8221;)]

public static string Add(int a, int b) =&gt; $&#8221;Sum {a + b}&#8221;;

}</code></pre></div><p></p><p></p><p><strong>[McpServerToolType]</strong>&#8212; Marks the class as containing MCP tools.</p><p><strong>[McpServerTool]</strong>&#8212; Marks the method as an invocable tool.</p><p><strong>Description(&#8221;Add two numbers&#8221;)</strong>&#8212; This description is sent to the LLM, helping it understand when and how to use the tool. Think of it as the tool&#8217;s documentation for the AI.</p><p>- The method parameters (`int a`, `int b`) are automatically exposed as the tool&#8217;s input schema. The MCP SDK handles serialization and deserialization for you.</p><p></p><p><strong>Step 4: Test with MCP Inspector</strong></p><p>MCP provides an <strong>Inspector</strong> tool that lets you interact with your server directly &#8212; without needing a full AI host application. It&#8217;s invaluable for development and debugging.</p><p>Run the following command from your project directory:</p><p></p><p><code>npx @modelcontextprotocol/inspector dotnet run</code></p><p></p><p>This will:</p><p>1. Start your MCP server (`dotnet run`)</p><p>2. Launch the MCP Inspector web UI</p><p>3. Connect the inspector to your server over stdio</p><p><strong>Using the Inspector</strong></p><p>Once the inspector is running, you should see your server&#8217;s tools listed. Here&#8217;s what to expect:</p><p>1. <strong>**Connect**</strong> to the server by clicking the &#8220;Connect&#8221; button.</p><p>2. Navigate to the <strong>**Tools**</strong> tab &#8212; you&#8217;ll see `Add` listed with its description &#8220;Add two numbers&#8221;.</p><p>3. Click on the `Add` tool to expand it.</p><p>4. Provide input values for `a` and `b` (e.g., <code> a </code>=<code> 6</code> , b <code>= </code>8).</p><p>5. Click <strong>**Run Tool**</strong> &#8212; you&#8217;ll see the output: `S<code>m 14`.</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!77sq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!77sq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 424w, https://substackcdn.com/image/fetch/$s_!77sq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 848w, https://substackcdn.com/image/fetch/$s_!77sq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 1272w, https://substackcdn.com/image/fetch/$s_!77sq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!77sq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png" width="1456" height="647" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:647,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!77sq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 424w, https://substackcdn.com/image/fetch/$s_!77sq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 848w, https://substackcdn.com/image/fetch/$s_!77sq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 1272w, https://substackcdn.com/image/fetch/$s_!77sq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F867aa00a-0c1e-4a44-969d-c65cbdfa4bc1_1896x843.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>What&#8217;s Happening Under the Hood?</strong></p><p>When you run the inspector, here&#8217;s the flow:</p><p>1. The <strong>**MCP Inspector**</strong> (client) spawns your server process and connects via <strong>**stdio**</strong>.</p><p>2. The client sends an `initialize` request, and the server responds with its capabilities (tools, resources, prompts).</p><p>3. When you invoke a tool from the inspector, it sends a `tools/call` request with the tool name and arguments.</p><p>4. The server routes the request to the matching method (`CalculatorTool.Add`), executes it, and returns the result.</p><p>5. The inspector displays the result.</p><p>This is the exact same protocol flow that happens when an LLM host like Claude Desktop or VS Code Copilot calls your tool.</p><p><strong>What&#8217;s Next?</strong></p><p>Congratulations on building your first MCP server! In the upcoming articles, we&#8217;ll explore:</p><p>- Adding more complex tools with multiple operations</p><p>- Exposing <strong>**Resources**</strong> to provide context to LLMs</p><p>- Using <strong>**Prompts**</strong> for structured text generation</p><p>- Connecting this server to a real AI host application</p><p>Thanks for following along &#8212; happy building!</p><p></p>]]></content:encoded></item><item><title><![CDATA[MCP Core Concepts ]]></title><description><![CDATA[Everything you need to understand MCP from scratch &#8212; its architecture, message types, transports.]]></description><link>https://newsletter.dotnetcircuit.com/p/mcp-core-concepts</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/mcp-core-concepts</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Tue, 14 Apr 2026 21:04:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ZzcL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZzcL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZzcL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 424w, https://substackcdn.com/image/fetch/$s_!ZzcL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 848w, https://substackcdn.com/image/fetch/$s_!ZzcL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 1272w, https://substackcdn.com/image/fetch/$s_!ZzcL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZzcL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png" width="895" height="557" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:557,&quot;width&quot;:895,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:617645,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/194225047?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZzcL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 424w, https://substackcdn.com/image/fetch/$s_!ZzcL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 848w, https://substackcdn.com/image/fetch/$s_!ZzcL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 1272w, https://substackcdn.com/image/fetch/$s_!ZzcL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9848fb9-b7a5-4043-8109-50eb7316f224_895x557.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2><strong>What is MCP and why should you care?</strong></h2><p>If you&#8217;ve been building software for any meaningful amount of time, you&#8217;ve watched the industry cycle through integration standards &#8212; SOAP, REST, GraphQL, gRPC. Each one solved a real problem: how do two systems talk to each other in a structured, predictable way?</p><p>The <strong>Model Context Protocol (MCP)</strong> is the latest entry in that lineage, but it solves a fundamentally different problem. MCP isn&#8217;t about how your frontend talks to your backend. It&#8217;s about how <strong>AI models talk to tools, data sources, and external systems</strong>.</p><p>Think about it this way: when you use an AI assistant like Claude, it&#8217;s incredibly good at reasoning and generating text. But it&#8217;s trapped inside its own context window. It can&#8217;t check your calendar, query your database, search the web, or trigger a deployment pipeline &#8212; unless someone gives it a structured way to do those things. That structured way is MCP.</p><p>MCP is an <strong>open protocol</strong> &#8212; originally developed by Anthropic, but designed to be vendor-neutral and community-driven. It defines a standard way for AI models (the &#8220;client&#8221; side) to discover, negotiate with, and invoke capabilities exposed by external systems (the &#8220;server&#8221; side).</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5Uyo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5Uyo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 424w, https://substackcdn.com/image/fetch/$s_!5Uyo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 848w, https://substackcdn.com/image/fetch/$s_!5Uyo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 1272w, https://substackcdn.com/image/fetch/$s_!5Uyo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5Uyo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png" width="1456" height="835" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:835,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142592,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/194225047?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5Uyo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 424w, https://substackcdn.com/image/fetch/$s_!5Uyo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 848w, https://substackcdn.com/image/fetch/$s_!5Uyo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 1272w, https://substackcdn.com/image/fetch/$s_!5Uyo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdce9b50c-af26-4834-bebd-dd0a5c1f23d1_2144x1230.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2><strong>The problem MCP solves</strong></h2><p>Before MCP, every AI tool integration was bespoke. If you wanted Claude to interact with GitHub, you&#8217;d build a custom plugin. If you wanted it to query Postgres, you&#8217;d build another one. Each integration had its own message format, its own authentication story, its own error handling. It was like the pre-REST era &#8212; a mess of point-to-point integrations that didn&#8217;t compose.</p><p>The consequences were painful:</p><p><strong>For tool builders</strong>, you had to write separate integrations for every AI provider &#8212; one for OpenAI&#8217;s function calling format, another for Claude&#8217;s tool use format, another for Gemini. The same tool, reimplemented three times.</p><p><strong>For AI application developers</strong>, you couldn&#8217;t mix and match. Switching AI providers meant rewriting all your tool integrations. You were locked in &#8212; not by the model itself, but by the plumbing around it.</p><p><strong>For enterprises</strong>, the security story was a nightmare. Each custom integration had its own trust model. There was no standardized way to enforce consent, rate limiting, or data flow controls across all AI-tool interactions.</p><p>MCP solves all three of these by establishing a single, open protocol that any client and any server can implement. Build your tool once as an MCP server, and it works with every MCP-compatible AI client. Switch your AI provider, and all your tools keep working. Enforce your security policies in one place, and they apply to every integration.</p><h2><strong>The two-layer architecture</strong></h2><p><strong>MCP's architecture is elegantly simple. The entire protocol is split into exactly two layers, each with a clearly defined responsibility. If you've ever worked with the OSI model or even just the separation between ASP.NET's middleware pipeline (how requests are processed) and Kestrel (how bytes move over the wire), this pattern will feel immediately familiar.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yr8e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yr8e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 424w, https://substackcdn.com/image/fetch/$s_!yr8e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 848w, https://substackcdn.com/image/fetch/$s_!yr8e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 1272w, https://substackcdn.com/image/fetch/$s_!yr8e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yr8e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png" width="1264" height="744" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:744,&quot;width&quot;:1264,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72998,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/194225047?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yr8e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 424w, https://substackcdn.com/image/fetch/$s_!yr8e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 848w, https://substackcdn.com/image/fetch/$s_!yr8e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 1272w, https://substackcdn.com/image/fetch/$s_!yr8e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee263ee1-3a95-4394-9812-8b8b2795c7a0_1264x744.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>The Data Layer &#8212; what to say</strong></h3><p>The Data Layer is the brain of the protocol. It defines <strong>what</strong> clients and servers say to each other &#8212; the structure of messages, the semantics of each operation, and the rules governing the conversation lifecycle.</p><p>It&#8217;s built on top of <strong>JSON-RPC 2.0</strong>, which is a lightweight remote procedure call protocol that uses JSON as its data format. If you&#8217;ve never encountered JSON-RPC before, think of it as &#8220;HTTP endpoints, but instead of URLs and verbs, you have a <code>method</code> string and <code>params</code> object.&#8221; </p><p>The Data Layer handles three core responsibilities: defining the message structure (request, response, notification), managing the connection lifecycle (initialization, capability negotiation, shutdown), and exposing protocol primitives (tools, resources, and prompts &#8212; the things an MCP server can offer).</p><h3><strong>The Transport Layer &#8212; how to deliver it</strong></h3><p>The Transport Layer is the postal service. It doesn&#8217;t care about what&#8217;s inside the envelope &#8212; it just makes sure the envelope gets from point A to point B reliably.</p><p>MCP supports two transport mechanisms:</p><p><strong>Stdio (Standard I/O)</strong> is used for local communication. The MCP client spawns the MCP server as a child process and they talk through stdin/stdout pipes. This is fast, requires zero network configuration, and is the default for local development tools. I</p><p><strong>Streamable HTTP with Server-Sent Events (SSE)</strong> is used for remote communication. The client sends messages to the server via HTTP POST requests, and the server can push real-time updates back via SSE. This is the transport you&#8217;d use when your MCP server is running on a different machine &#8212; say, as a cloud service.</p><p></p><p>As a  engineer who&#8217;s spent years building APIs and distributed systems, MCP feels like a natural evolution. It takes patterns we already know &#8212; request/response messaging, service discovery, middleware pipelines &#8212; and adapts them for the AI agent era. The protocol is intentionally simple: JSON-RPC 2.0 messages flowing over either local stdio or remote HTTP, with a clean lifecycle of initialize &#8594; discover &#8594; execute.</p>]]></content:encoded></item><item><title><![CDATA[RAG: Utilizing Azure AI Search as a Data Source for your LLM ]]></title><description><![CDATA[Giving the LLM a "Search Engine"]]></description><link>https://newsletter.dotnetcircuit.com/p/rag-utilizing-azure-ai-search-as</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/rag-utilizing-azure-ai-search-as</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Thu, 26 Feb 2026 21:19:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!SNZW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SNZW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SNZW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SNZW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SNZW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SNZW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SNZW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1213622,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/189294240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SNZW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SNZW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SNZW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SNZW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0662f538-3b9b-4382-9c5f-31c6078bb382_2816x1536.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>In the world of Enterprise AI, a Large Language Model (LLM) is like a brilliant scholar who has read almost everything on the public internet but has never seen your company&#8217;s internal documents. If you ask it about your specific &#8220;Q3 Project Roadmap&#8221; or &#8220;Internal Remote Work Policy,&#8221; it might guess&#8212;or worse, hallucinate.</p><p>To bridge this gap, we use <strong>RAG (Retrieval-Augmented Generation): <a href="https://medium.com/dotnetcircuit/retrieval-augmented-generation-rag-in-generative-ai-6bf526bd71fe">check here</a> </strong>. Today, I&#8217;ll walk you through how to use <strong>Azure AI Search</strong> as the ultimate &#8220;librarian&#8221; for your LLM, specifically using <strong>C#</strong> and <strong>Azure AI Foundry</strong>.</p><p></p><p>Instead of trying to &#8220;teach&#8221; the LLM your data by retraining it (which is slow and expensive), we connect it to a data source.</p><p>By using a <strong>C# Console Application demo</strong>, we can orchestrate a flow where the LLM doesn&#8217;t just generate text; it first <strong>searches</strong> your private data (stored in <strong>Azure Blob Storage</strong>) via <strong>Azure AI Search</strong> and then uses that specific information to form an answer.</p><p><strong>The Tech Stack: Azure Resources</strong></p><p>To build this, we utilize three core pillars of the Azure ecosystem:</p><ol><li><p><strong>Azure Blob Storage:</strong> The &#8220;Warehouse&#8221; where your raw PDF files live.</p></li><li><p><strong>Azure AI Search:</strong> The &#8220;Search Engine&#8221; that indexes, chunks, and vectorizes those PDFs.</p></li></ol><p>&#8226; 3. <strong>Azure AI Foundry:</strong> The &#8220;Orchestrator&#8221; where we deploy the LLM and manage the connection between the model and the search index.</p><p></p><p><strong>How RAG Actually Works</strong></p><p>Attaching a data source isn&#8217;t just a simple &#8220;plugin.&#8221; Because LLMs have <strong>Token Limits</strong> (a maximum amount of text they can process at once), we can&#8217;t just send 100 PDFs into a single prompt. This is where the RAG pipeline shines:</p><p><strong>1. Ingestion &amp; Document Cracking</strong></p><p>The <strong>Azure AI Search Indexer</strong> reaches into your Blob Storage. It &#8220;cracks&#8221; open your PDFs and extracts the raw text.</p><p><strong>2. Chunking &amp; Vectorization</strong></p><p>This is the &#8220;Magic&#8221; step. To stay within token limits, the indexer breaks the text into <strong>Chunks</strong> (smaller pieces, like 500 words each).</p><ul><li><p>Each chunk is then sent to an <strong>Embedding Model</strong>.</p></li><li><p>The model converts the text into a <strong>Vector</strong> (a long list of numbers representing the <em>meaning</em> of the text).</p></li></ul><p><strong>3. The Retrieval (The &#8220;R&#8221; in RAG)</strong></p><p>When a user asks a question in your C# app, the app doesn&#8217;t send the question to the LLM yet. Instead:</p><ul><li><p>The question is turned into a vector.</p></li><li><p><strong>Azure AI Search</strong> finds the &#8220;top 3&#8221; chunks in your index that are mathematically closest to the question.</p></li></ul><p><strong>4. Generation (The &#8220;G&#8221; in RAG)</strong></p><p>Your app sends a &#8220;Super-Prompt&#8221; to the LLM:</p><p><em>&#8220;Here is the context from our PDFs: [Chunk 1, Chunk 2]. Now, based ONLY on this context, answer the user&#8217;s question: [User Query].&#8221;</em></p><p></p><p><strong>Why Use Vector Search?</strong></p><p>Traditional keyword search looks for exact words. If you search for &#8220;Salary,&#8221; you might miss a document that says &#8220;Compensation.&#8221;</p><p><strong>Vector Search</strong> understands intent. Because it operates on mathematical &#8220;meaning,&#8221; it knows that &#8220;Salary&#8221; and &#8220;Compensation&#8221; are the same thing. This makes your AI much more intuitive and &#8220;human-like&#8221; in how it finds information.</p><p></p><p>In the practical example below, Uploading a single PDF file to Azure Blob Storage and importing it to Azure AI Search with an indexes. The LLM model is deployed on Azure AI Foundry, accessed via API URL and KEY. We use the chat completion feature in Azure OpenAI SDK.</p><p><strong>Blob Storage:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GCwK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GCwK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 424w, https://substackcdn.com/image/fetch/$s_!GCwK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 848w, https://substackcdn.com/image/fetch/$s_!GCwK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 1272w, https://substackcdn.com/image/fetch/$s_!GCwK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GCwK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png" width="1456" height="742" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:742,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:297974,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/189294240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GCwK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 424w, https://substackcdn.com/image/fetch/$s_!GCwK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 848w, https://substackcdn.com/image/fetch/$s_!GCwK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 1272w, https://substackcdn.com/image/fetch/$s_!GCwK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b27c6eb-532a-4a6c-ab92-8bee7722c3b1_2930x1494.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Azure AI Search:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nzCx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nzCx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 424w, https://substackcdn.com/image/fetch/$s_!nzCx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 848w, https://substackcdn.com/image/fetch/$s_!nzCx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 1272w, https://substackcdn.com/image/fetch/$s_!nzCx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nzCx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png" width="1456" height="842" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:842,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:268251,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/189294240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nzCx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 424w, https://substackcdn.com/image/fetch/$s_!nzCx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 848w, https://substackcdn.com/image/fetch/$s_!nzCx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 1272w, https://substackcdn.com/image/fetch/$s_!nzCx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3b61806-f1da-4836-83e2-8ba1c0a44047_2922x1690.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o4MF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o4MF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 424w, https://substackcdn.com/image/fetch/$s_!o4MF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 848w, https://substackcdn.com/image/fetch/$s_!o4MF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 1272w, https://substackcdn.com/image/fetch/$s_!o4MF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o4MF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png" width="1456" height="792" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:792,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:246083,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/189294240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o4MF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 424w, https://substackcdn.com/image/fetch/$s_!o4MF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 848w, https://substackcdn.com/image/fetch/$s_!o4MF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 1272w, https://substackcdn.com/image/fetch/$s_!o4MF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6843a4bb-66a8-4c1b-9ef3-d90cb5777018_2918x1588.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Azure AI Foundry:</strong>  using gpt-4.1 LLM model</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!duTh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!duTh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 424w, https://substackcdn.com/image/fetch/$s_!duTh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 848w, https://substackcdn.com/image/fetch/$s_!duTh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 1272w, https://substackcdn.com/image/fetch/$s_!duTh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!duTh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png" width="1456" height="1154" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1154,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:708298,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/189294240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!duTh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 424w, https://substackcdn.com/image/fetch/$s_!duTh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 848w, https://substackcdn.com/image/fetch/$s_!duTh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 1272w, https://substackcdn.com/image/fetch/$s_!duTh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32a9504-7a05-4592-9a56-7b6a907d95cc_2394x1898.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p></p><p><strong>Practical Demo </strong>:</p><p></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;csharp&quot;,&quot;nodeId&quot;:&quot;edab1bc8-2559-4afd-86b7-0304c503f7c4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-csharp">using OpenAI.Chat;
using Azure;
using Azure.AI.OpenAI;
using Azure.AI.OpenAI.Chat;

#pragma warning disable AOAI001

// Azure OpenAI configuration
var endpoint = new Uri("https://ai-labs-project.cognitiveservices.azure.com/");
var deploymentName = "gpt-4.1";
var apiKey = "8Pio3V4acuKq6M1BbSbIJ50YQ3D8IIpacjLpPLs0TJJtqLamflYYJQQJ99CBACYeBjFXJ3w3AAAAACOGdij7";

// Azure AI Search configuration
var searchEndpoint = "https://ragpdf.search.windows.net";
var searchApiKey = "NJiH9F3ZQCwrCib3K7C5AMH2IJsF1ocJVoGcwcWjzWAzSeC6dTAR";
var searchIndexName = "ragskills";

AzureOpenAIClient azureClient = new(
    endpoint,
    new AzureKeyCredential(apiKey));

ChatClient chatClient = azureClient.GetChatClient(deploymentName);

var chatCompletionOptions = new ChatCompletionOptions();
chatCompletionOptions.AddDataSource(new AzureSearchChatDataSource()
{
    Endpoint = new Uri(searchEndpoint),
    IndexName = searchIndexName,
    Authentication = DataSourceAuthentication.FromApiKey(searchApiKey),
});

List&lt;ChatMessage&gt; messages = new List&lt;ChatMessage&gt;()
{
    new SystemChatMessage("You are a helpful assistant. Use the provided data source to answer questions."),
    new UserChatMessage("What skills are mentioned in the documents?"),
};

var response = chatClient.CompleteChat(messages, chatCompletionOptions);

// Print the main response
Console.WriteLine("Response:");
Console.WriteLine(response.Value.Content[0].Text);

</code></pre></div><p></p><p>Output: I have uploaded the PDF file containing the skills section, which is the same section we are querying.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1eUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1eUA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 424w, https://substackcdn.com/image/fetch/$s_!1eUA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 848w, https://substackcdn.com/image/fetch/$s_!1eUA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 1272w, https://substackcdn.com/image/fetch/$s_!1eUA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1eUA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png" width="1456" height="431" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:431,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:212757,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/189294240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1eUA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 424w, https://substackcdn.com/image/fetch/$s_!1eUA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 848w, https://substackcdn.com/image/fetch/$s_!1eUA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 1272w, https://substackcdn.com/image/fetch/$s_!1eUA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa927d0e5-6e37-4b88-87df-0bce2aadf1a4_2970x880.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>By combining <strong>Azure AI Search</strong> with the power of LLMs in <strong>Azure AI Foundry</strong>, we move beyond generic AI. We create a specialized system that knows your business, respects your data privacy, and provides grounded, accurate answers.</p><p><br></p><p></p>]]></content:encoded></item><item><title><![CDATA[Building a Custom AI Sales Agent with .NET, Ollama, and Azure AI Foundry]]></title><description><![CDATA[custom-sales agent accessing the database]]></description><link>https://newsletter.dotnetcircuit.com/p/building-a-custom-ai-sales-agent</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/building-a-custom-ai-sales-agent</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Mon, 23 Feb 2026 18:53:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Fs7A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Fs7A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Fs7A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!Fs7A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!Fs7A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!Fs7A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Fs7A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7775521,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Fs7A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!Fs7A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!Fs7A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!Fs7A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8458f47d-836a-4553-8c61-7b2dde72562d_2816x1536.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Hello ,</p><p>In my previous article - <a href="https://newsletter.dotnetcircuit.com/p/introduction-to-agents-using-azure">check here</a>, we discussed the creation of the agent and its interaction with the database and other tools. </p><p>In this article, I provide a comprehensive guide to constructing a <strong>**Custom Sales Agent**</strong>&#8212;an interactive .NET console application that enables users to pose natural-language inquiries regarding Contoso sales data. The agent&#8217;s functionalities include:</p><p>A practical guide to building an AI-powered sales assistant that runs locally with Ollama during development and scales to Azure AI Foundry in production &#8212; complete with LLM tool-calling, SQLite querying, and Terraform infrastructure-as-code.</p><p></p><p>Large Language Models (LLMs) possess remarkable capabilities in answering questions in natural language. However, they lack the ability to natively query private databases. <strong>**Tool calling**</strong> (also known as function calling) using the semantic kernel effectively addresses this limitation. The LLM determines the appropriate time to invoke your code and <em>the</em> SQL query to generate, while your application securely executes the query against the actual data.</p><p><strong>Local Development with Ollama: </strong> Utilizing llama3.2 for expedient and cost-effective development cycles.</p><p><strong>Production Deployment with Azure AI Foundry Agent Service: </strong>Transitioning to GPT-4.1 for production purposes.</p><p><strong>Dynamic SQL Query Generation and Execution: Employing LLM tool calling</strong> to dynamically generate and execute SQL queries against a SQLite database.</p><p><strong>Terraform-Based Azure Infrastructure Provisioning: </strong> <strong>Automating the provisioning of all Azure infrastructure.</strong></p><p>Architecture flow : </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!91UB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!91UB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 424w, https://substackcdn.com/image/fetch/$s_!91UB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 848w, https://substackcdn.com/image/fetch/$s_!91UB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 1272w, https://substackcdn.com/image/fetch/$s_!91UB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!91UB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png" width="1456" height="1050" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1050,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4799354,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!91UB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 424w, https://substackcdn.com/image/fetch/$s_!91UB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 848w, https://substackcdn.com/image/fetch/$s_!91UB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 1272w, https://substackcdn.com/image/fetch/$s_!91UB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32ac0d4f-cf91-4b2e-9061-885718b8ada7_2202x1588.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Project Structure :</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XCP1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XCP1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 424w, https://substackcdn.com/image/fetch/$s_!XCP1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 848w, https://substackcdn.com/image/fetch/$s_!XCP1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 1272w, https://substackcdn.com/image/fetch/$s_!XCP1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XCP1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png" width="1456" height="689" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:689,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:497387,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XCP1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 424w, https://substackcdn.com/image/fetch/$s_!XCP1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 848w, https://substackcdn.com/image/fetch/$s_!XCP1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 1272w, https://substackcdn.com/image/fetch/$s_!XCP1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa0b06f-f9d2-483b-bbf4-7f2c22e9c781_2958x1400.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>once the repo is cloned - connect with your Azure account and run the terraform init ,validate and then apply it - all its required resources are created on the Azure cloud. </p><p>use the below apply command:</p><p><code>terraform apply -var=&#8221;deploy_cloud_model=true&#8221; -auto-approve 2&gt;&amp;1 | tail -20</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AGLe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AGLe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 424w, https://substackcdn.com/image/fetch/$s_!AGLe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 848w, https://substackcdn.com/image/fetch/$s_!AGLe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 1272w, https://substackcdn.com/image/fetch/$s_!AGLe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AGLe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png" width="1456" height="614" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:614,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:283392,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AGLe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 424w, https://substackcdn.com/image/fetch/$s_!AGLe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 848w, https://substackcdn.com/image/fetch/$s_!AGLe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 1272w, https://substackcdn.com/image/fetch/$s_!AGLe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7d26aec-1612-4fd0-b298-980a139483b2_2406x1014.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Development Mode:</strong></p><p>install the Ollama model run the below commands and check the local Model running. </p><p><code>brew install ollama<br>ollama pull llama3.2</code></p><p><code>ollama serve</code></p><p></p><p>you can confirm by checking this weather the local model is running or not : </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xn9z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xn9z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 424w, https://substackcdn.com/image/fetch/$s_!Xn9z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 848w, https://substackcdn.com/image/fetch/$s_!Xn9z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 1272w, https://substackcdn.com/image/fetch/$s_!Xn9z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xn9z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png" width="1456" height="862" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:862,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:309629,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xn9z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 424w, https://substackcdn.com/image/fetch/$s_!Xn9z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 848w, https://substackcdn.com/image/fetch/$s_!Xn9z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 1272w, https://substackcdn.com/image/fetch/$s_!Xn9z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a7d6e8-51c2-47fa-ae1d-044ea3764eaa_2178x1290.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><br></p><p>and then run in development mode:  <code>DOTNET_ENVIRONMENT=development dotnet run </code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eFyN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eFyN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 424w, https://substackcdn.com/image/fetch/$s_!eFyN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 848w, https://substackcdn.com/image/fetch/$s_!eFyN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 1272w, https://substackcdn.com/image/fetch/$s_!eFyN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eFyN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png" width="1456" height="925" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:925,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:344993,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eFyN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 424w, https://substackcdn.com/image/fetch/$s_!eFyN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 848w, https://substackcdn.com/image/fetch/$s_!eFyN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 1272w, https://substackcdn.com/image/fetch/$s_!eFyN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3100eafe-f240-4db6-a401-d9c4c9d3e3c5_2148x1364.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can now engage in natural language conversations with the agent, and it will provide responses in the same natural language, ensuring clarity and comprehension.</p><p></p><p><strong>Production Mode:</strong></p><p>before running the prod mode , make sure all the resources on the azure are created and verify the LLM model is present on the Azure Foundry.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-cSj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-cSj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 424w, https://substackcdn.com/image/fetch/$s_!-cSj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 848w, https://substackcdn.com/image/fetch/$s_!-cSj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 1272w, https://substackcdn.com/image/fetch/$s_!-cSj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-cSj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png" width="1310" height="1029" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1029,&quot;width&quot;:1310,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:189972,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-cSj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 424w, https://substackcdn.com/image/fetch/$s_!-cSj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 848w, https://substackcdn.com/image/fetch/$s_!-cSj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 1272w, https://substackcdn.com/image/fetch/$s_!-cSj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5ac8b8e-8c6f-448c-ac7e-953cd042a117_1310x1029.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>and then run in prod mode: you can see the result below. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!P2a0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!P2a0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 424w, https://substackcdn.com/image/fetch/$s_!P2a0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 848w, https://substackcdn.com/image/fetch/$s_!P2a0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 1272w, https://substackcdn.com/image/fetch/$s_!P2a0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!P2a0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png" width="1456" height="779" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:779,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:263939,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/188055708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!P2a0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 424w, https://substackcdn.com/image/fetch/$s_!P2a0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 848w, https://substackcdn.com/image/fetch/$s_!P2a0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 1272w, https://substackcdn.com/image/fetch/$s_!P2a0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F781ab219-ba8c-4a26-9477-6de6d7531207_2232x1194.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p></p><p><strong>How Tool Calling Works</strong></p><p>The big idea here is <strong>**LLM tool calling**</strong>. Instead of the LLM just trying to answer based on what it&#8217;s learned, it does this:</p><p>1. <strong>It gets </strong> the user&#8217;s question in plain language, along with the database&#8217;s structure.</p><p>2. <strong>It figures out</strong> that it needs some data and makes a tool call with a SQL query.</p><p>3. <strong>Our code</strong> steps in and runs the SQL against SQLite, then sends back the results.</p><p>4. <strong>The LLM</strong> then turns the raw data into a helpful, easy-to-understand answer.</p><p></p><p></p><p>This pattern ensures data privacy by preventing the LLM from storing it. It also guarantees that answers are always based on real data.</p><p></p><h1><strong>Understanding Semantic Kernel:</strong></h1><p>Before understanding Semantic Kernel, we need to understand the problem with just using a Large Language Model (LLM) like GPT-4 directly.</p><p>Imagine an LLM is a brilliant, world-renowned <strong>scholar</strong> locked in an empty room.</p><ul><li><p>They know everything about the public internet up to their training cut-off.</p></li><li><p>They can write poems, solve complex math problems, and code in Python.</p></li></ul><p><strong>But this scholar has severe limitations:</strong></p><ol><li><p><strong>They don&#8217;t know </strong><em><strong>you</strong></em><strong>:</strong> They have no access to your company&#8217;s private documents, databases, or emails.</p></li><li><p><strong>They can&#8217;t </strong><em><strong>do</strong></em><strong> anything:</strong> They cannot send an email, book a meeting, query a SQL database, or push a button in Salesforce. They can only output text.</p></li><li><p><strong>They have amnesia:</strong> Every new conversation starts with a blank slate. They don&#8217;t remember what you asked them five minutes ago unless you re-send the entire conversation history.</p></li></ol><p>If you want to build a useful AI application (like a chatbot that can answer questions about your internal HR policies and then book time off for you), the &#8220;naked&#8221; LLM cannot do it alone.</p><p>You need a bridge. Semantic Kernel is the bridge here.</p><p>In technical terms, it is an open-source Software Development Kit (SDK) from Microsoft, available in C#, Python, and Java.</p><p>In simple terms, it is the &#8220;operating system&#8221; or the &#8220;orchestrator&#8221; for your AI application. It sits between your application code and the AI models.</p><p></p><p><strong>The Core Concept: Everything is a &#8220;Function&#8221;</strong></p><p>The most crucial aspect to comprehend about SK is its ability to blur the distinction between conventional code and AI prompts. It treats both as &#8220;functions&#8221; that can be interconnected.</p><ol><li><p><strong>Native Functions (Code):</strong> These are standard C# or Python functions that you write. They perform deterministic tasks, such as calculating taxes, querying databases, sending emails, and retrieving the current time.</p><p></p></li><li><p> <strong>Semantic Functions (Prompts):</strong> These are instructions written in natural language for the LLM. For instance, <em>&#8220;Please summarize the provided input text into three concise bullet points.&#8221;</em></p></li></ol><p></p><p>Building an AI agent that bridges natural language and structured data doesn&#8217;t require a massive framework. With .NET&#8217;s dependency injection, clean service abstraction, and tool-calling capabilities in both open-source (Ollama) and commercial (Azure AI) LLMs, you can create a powerful, production-ready agent in a few hundred lines of code.</p><p>The dual-provider pattern offers fast iteration cycles and enterprise-grade deployment: free local development with Ollama and scalable production with Azure AI Foundry.</p><p>The complete source code is available on [GitHub] https://github.com/DileepSreepathi/custom-sales-agent</p>]]></content:encoded></item><item><title><![CDATA[Architecture vs. Design: ]]></title><description><![CDATA[The Blurred Line Even Experts Miss]]></description><link>https://newsletter.dotnetcircuit.com/p/architecture-vs-design</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/architecture-vs-design</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Mon, 09 Feb 2026 19:50:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!VyzX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VyzX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VyzX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!VyzX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!VyzX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!VyzX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VyzX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:9141755,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/187433970?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VyzX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!VyzX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!VyzX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!VyzX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F743ba587-1d97-4dba-99da-69324d0bb81d_2816x1536.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p> </p><p>You&#8217;re a seasoned software engineer, a decade or more deep in the trenches, shipping code, solving complex problems, and navigating the ever-shifting sands of technology. You&#8217;ve built systems from the ground up, refactored monoliths, danced with micro-services, and probably have a graveyard of forgotten frameworks in your mental attic.</p><p>But despite the countless lines of code written and systems launched, there&#8217;s a subtle yet profound distinction that often gets blurred, even by the most experienced among us: the line between <strong>Architecture and Design.</strong></p><p>This isn&#8217;t just semantics. Understanding this divide &#8211; truly understanding it &#8211; isn&#8217;t about passing a certification. It&#8217;s about fundamentally altering how you approach problem-solving, how you build resilient systems, and ultimately, how you sculpt software that stands the test of time, scales under pressure, and evolves with grace. This article isn&#8217;t just going to define the terms; it&#8217;s going to explore why this distinction holds the key to your next decade of engineering excellence.</p><p></p><p><strong>The Elephant in the Room: Why Do We Confuse Them?</strong></p><p>Let&#8217;s be honest, the terms &#8220;architect&#8221; and &#8220;designer&#8221; are often used interchangeably in job titles and daily conversations. We talk about &#8220;designing an architecture&#8221; or &#8220;architecting a component.&#8221; This linguistic fuzziness reflects a deeper systemic issue: a lack of explicit differentiation in many organizations.</p><p>Part of the confusion stems from the historical evolution of our craft. In the early days, a single engineer often handled everything from the foundational structure to the minutiae of a class&#8217;s methods. As systems grew in complexity, specializations emerged. Yet, the mental model often lagged, leading to architects dabbling in low-level design and senior designers making architectural choices without a holistic view.</p><ul><li><p><strong>Architectures that are beautiful on paper but impossible to implement.</strong></p></li><li><p><strong>Designs that are elegant at a component level but create integration nightmares.</strong></p></li><li><p><strong>Systems that scale horizontally but are brittle internally.</strong></p></li><li><p><strong>Teams constantly refactoring the </strong><em><strong>wrong</strong></em><strong> things because the foundational principles were never clearly established.</strong></p><p></p></li></ul><p><strong>Architecture: The Blueprint of Existence</strong></p><p>Think of software architecture like the <strong>blueprint of a city or a large building</strong>. It defines the fundamental structure, the main components, their relationships, and the principles governing their interaction.</p><p><strong>Key Characteristics of Architecture:</strong></p><ol><li><p><strong>High-Level, Strategic Decisions:</strong> Architecture deals with the &#8220;what&#8221; and &#8220;why&#8221; at a macro level. It answers questions like:</p><ul><li><p>What are the primary systems involved (e.g., microservices, monolith, serverless)?</p></li><li><p>How will they communicate (e.g., REST, gRPC, Kafka, message queues)?</p></li><li><p>What are the core technologies and frameworks (e.g., Kubernetes, .NET Core, Node.js)?</p></li><li><p>How will data be stored and accessed across the system (e.g., SQL, NoSQL, data lakes)?</p></li><li><p>What are the non-functional requirements (NFRs) that <em>must</em> be met (scalability, security, performance, fault tolerance, maintainability)?</p></li><li><p>How will deployment, monitoring, and logging be handled across the entire ecosystem?</p></li></ul></li><li><p><strong>Concerned with Cross-Cutting Concerns:</strong> Architectural decisions inherently impact multiple parts of the system. Security protocols, logging standards, error handling mechanisms, transaction management &#8211; these are architectural concerns that must be consistent across the board.</p></li><li><p><strong>Shapes Constraints and Boundaries:</strong> Architecture defines the sandbox within which design can happen. It sets the rules, dictates the available tools, and outlines the integration points. For instance, if the architecture mandates an event-driven microservices approach, individual services <em>must</em> conform to that paradigm.</p></li><li><p><strong>Long-Term Vision and Stability:</strong> Architectural decisions are notoriously difficult and expensive to change once implemented. They represent a significant investment and commitment. A good architecture anticipates future needs and provides a robust, adaptable foundation, minimizing the need for complete overhauls.</p></li><li><p><strong>Focus on &#8220;ilities&#8221;:</strong> Scalability, reliability, maintainability, testability, security, usability, deployability &#8211; these &#8220;ilities&#8221; are the bread and butter of architecture. They are the quality attributes that ensure the system remains viable and effective over its lifespan.</p></li></ol><p><strong>Analogy:</strong> If your software is a house, the architecture defines whether it&#8217;s a skyscraper, a bungalow, or a tent. It determines the foundation, the number of floors, the main structural beams, the plumbing and electrical systems, and how these major systems interact. It ensures the building can withstand earthquakes (fault tolerance) and accommodate future expansions (scalability).</p><p></p><p><strong>Design: The Art of Implementation and Detail</strong></p><p>If architecture is the city plan, then design is the <strong>detailed blueprint of a specific building, a floor plan, or even an individual room</strong>. It&#8217;s about bringing the architectural vision to life, detailing <em>how</em> a specific component or system will fulfill its architectural mandate.</p><p><strong>Key Characteristics of Design:</strong></p><ol><li><p><strong>Detailed, Component-Level Decisions:</strong> Design deals with the &#8220;how&#8221; at a granular level. It answers questions like:</p><ul><li><p>How will this specific microservice be structured internally (e.g., layered architecture, hexagonal architecture)?</p></li><li><p>What classes, interfaces, and modules will it contain?</p></li><li><p>How will data flow within this component?</p></li><li><p>What specific algorithms will be used to implement a feature?</p></li><li><p>How will error handling be implemented within this service?</p></li><li><p>What design patterns (e.g., Factory, Singleton, Observer) will be applied at a class or module level?</p></li><li><p>What are the specific API contracts for a service or a module?</p></li></ul></li><li><p><strong>Focus on Specific Functionality:</strong> Design is concerned with the implementation of particular features, functionalities, or services as defined by the architecture.</p></li><li><p><strong>Within Architectural Constraints:</strong> Design decisions are made <em>within</em> the boundaries and guidelines established by the architecture. A designer cannot suddenly decide to use a different database for their microservice if the architecture dictates a specific data storage strategy.</p></li><li><p><strong>More Iterative and Adaptable:</strong> While good design is also crucial, its scope is more localized. Changes to specific design elements are generally less impactful and less costly than changing fundamental architectural decisions. Design evolves as features are built and refined.</p></li><li><p><strong>Concerned with Code Quality and Developer Experience:</strong> Good design leads to clean, maintainable, readable, and testable code. It directly impacts the day-to-day life of engineers working on the codebase. Principles like SOLID, DRY, YAGNI are paramount here.</p></li></ol><p><strong>Analogy:</strong> Continuing with the house analogy, design defines the layout of each room, where the walls go, the specific type of windows, the material of the floors, the placement of electrical outlets, and how the furniture will be arranged. It ensures each room is functional, aesthetically pleasing, and serves its purpose within the overall house structure.</p><p></p><p>Architecture and Design are not isolated silos. They are two sides of the same coin, deeply intertwined and mutually dependent.</p><ul><li><p><strong>Architecture Informs Design:</strong> Architecture provides the overarching framework, the guiding principles, and the constraints that inform all subsequent design decisions. A robust architecture makes design simpler and more consistent.</p></li><li><p><strong>Design Validates Architecture:</strong> Detailed design and implementation can expose flaws or impracticalities in the architectural vision. Sometimes, what looks good on an architectural diagram proves challenging or inefficient to implement in practice, necessitating a feedback loop to the architectural layer.</p></li><li><p><strong>Poor Design Can Undermine Architecture:</strong> Even the most brilliant architecture can crumble under the weight of poor design. Inefficient algorithms, tightly coupled components, or a lack of attention to detail at the design level can negate all the benefits of a well-thought-out architecture.</p></li><li><p><strong>Tactical vs. Strategic:</strong> Architecture is inherently strategic; it looks years ahead. Design is more tactical, focused on delivering features within the current sprint or release cycle, but always within that strategic architectural context.</p></li></ul><p>For us, the seasoned engineers, understanding this distinction is more than academic. It&#8217;s about elevating our craft and maximizing our impact:</p><ol><li><p><strong>Speak the Right Language:</strong> When discussing problems, be precise. Is it an architectural problem (e.g., &#8220;our system can&#8217;t handle the load at scale&#8221;), or a design problem (e.g., &#8220;this service&#8217;s internal module coupling is too high&#8221;)? This clarity streamlines communication and problem-solving.</p></li><li><p><strong>Contribute at the Right Level:</strong> As senior engineers, you&#8217;re expected to contribute to both. When engaged in architectural discussions, focus on the big picture, the NFRs, and the long-term viability. When diving into a component, focus on elegance, maintainability, and efficiency.</p></li><li><p><strong>Bridge the Gap:</strong> Often, architects create the vision, and individual teams execute the design. You, with your experience, are perfectly positioned to be the bridge. You can translate architectural mandates into actionable design principles for your team and provide valuable feedback from the trenches back to the architects.</p></li><li><p><strong>Mentor the Next Generation:</strong> Teach junior engineers this distinction early. It instills a holistic view of software development that prevents them from getting lost in the weeds or making premature architectural decisions at the wrong level.</p></li><li><p><strong>Architect for Evolvable Design:</strong> A truly great architecture doesn&#8217;t just work; it enables great design. It offers clear interfaces, defined boundaries, and a robust framework that allows designers to build flexible, high-quality components without constantly fighting the system.</p></li></ol><p><strong>Building for Tomorrow, Today</strong></p><p>In our rapidly evolving industry, the allure of the next shiny framework can often overshadow the fundamental principles of software construction. But for those of us committed to building lasting, impactful software, the distinction between architecture and design is paramount.</p><p>Architecture lays the resilient foundation, defines the grand vision, and safeguards the strategic future of your system. Design then meticulously crafts the internal mechanisms, ensuring efficiency, maintainability, and immediate functionality.</p><p>When you understand these small but important differences, you become a better leader and decision-maker. You stop just &#8220;writing code&#8221; and start building <strong>complete environments</strong>. Instead of making something that only works right now, you create systems that are ready to grow and handle whatever happens in the future.</p><p><strong>What are your experiences with this distinction? Have you seen its impact &#8211; positive or negative &#8211; in the systems you&#8217;ve built? Share your thoughts below!</strong></p>]]></content:encoded></item><item><title><![CDATA[🚗 Mastering the Strategy Pattern in C#:]]></title><description><![CDATA[Stop using inheritance for behavior.]]></description><link>https://newsletter.dotnetcircuit.com/p/mastering-the-strategy-pattern-in</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/mastering-the-strategy-pattern-in</guid><pubDate>Wed, 26 Nov 2025 18:08:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!HgCG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HgCG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HgCG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!HgCG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!HgCG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!HgCG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HgCG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5200564,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/179236889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HgCG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!HgCG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!HgCG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!HgCG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7b4a267-2063-4f44-8a12-30ed5d55933a_2816x1536.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>If there is one lesson that elevates a developer from &#8220;Junior&#8221; to &#8220;Senior,&#8221; it&#8217;s learning to prefer <strong>Composition over Inheritance</strong>. The Strategy Pattern is the ultimate manifestation of this principle.</p><p>In this deep dive, we are going to look at a common scenario&#8212;building a car manufacturing system. We will see how a naive approach traps us in a web of dependencies (The &#8220;God Class&#8221;), and how the Strategy Pattern acts as a &#8220;Plugin System&#8221; to restore sanity, testability, and flexibility.</p><p></p><h2>1. The Domain Scenario</h2><p>Imagine we are building the software backbone for a futuristic automotive group. We have three manufacturers:</p><ul><li><p><strong>Company A:</strong> Makes standard economy cars.</p></li><li><p><strong>Company B:</strong> Makes hybrids.</p></li><li><p><strong>Company C:</strong> An experimental division working on flying cars and AI.</p></li></ul><p><strong>The Challenge:</strong> We need to model these cars. Some fly, some don&#8217;t. Some use petrol, some use electric, some are hybrid. New features (like &#8220;Autonomous Mode&#8221;) are coming next year.</p><p></p><h2>2. The Naive Approach (The Trap)</h2><p>The instinctual approach is to use inheritance. We create a base <code>Car</code> class and shove every possible feature into it.</p><p></p><pre><code>public abstract class Car
{

    // Core features

    public void Drive() { /* ... */ }

    // The Problem: Anticipating every future feature in the base class

    public virtual void Fly() { /* Default implementation? Empty? Throw Exception? */ }

    public virtual void ActivateHybrid() { /* ... */ }

    public virtual void AutonomousPark() { /* ... */ }

}</code></pre><p></p><h3>Why this fails (The &#8220;God Class&#8221; Anti-Pattern)</h3><p>As soon as you create <code>EconomyCar</code> (which can&#8217;t fly) or <code>VintageCar</code> (which isn&#8217;t hybrid), you hit a wall.</p><ol><li><p><strong>Polluted Interface:</strong> <code>EconomyCar</code> technically has a <code>.Fly()</code> method. This is confusing for other developers using your code.</p></li><li><p><strong>Liskov Substitution Violation:</strong> You might override <code>Fly()</code> to throw a <code>NotImplementedException</code>. Now, any code iterating through a list of <code>Car</code> objects and calling <code>.Fly()</code> risks crashing the application.</p></li><li><p><strong>Fragile Base Class:</strong> If <code>Company C</code> needs a change to the <code>Fly</code> logic, you might edit the base class, accidentally breaking <code>Company A</code>&#8216;s code.</p></li></ol><p></p><h2>3. The Solution: The Strategy Pattern</h2><p>The Strategy Pattern suggests: <strong>Take what varies and encapsulate it.</strong></p><p>Instead of the <code>Car</code> <em>being</em> the behavior, the <code>Car</code> <em>has</em> a behavior. We break the monolithic <code>Car</code> class into a host and a set of pluggable components.</p><h3>Step 1: Define the Interfaces (The Sockets)</h3><p>We identify the behaviors that vary: <strong>Flying</strong> and <strong>Powertrain</strong>.</p><pre><code>// The contract for any flying behavior

public interface IFlyStrategy

{

    void Fly();

}

// The contract for any engine behavior

public interface IPowertrainStrategy

{

    void Drive();

}</code></pre><p></p><h3>Step 2: Implement the Strategies (The Plugs)</h3><p>We create concrete classes for every variation. These are small, easy to test, and isolated.</p><pre><code>// --- Flying Strategies ---

public class JetPropulsion : IFlyStrategy

{

    public void Fly() =&gt; Console.WriteLine(&#8221;&#128640; Thrusters engaged! We are flying.&#8221;);

}

public class NoFly : IFlyStrategy

{

    public void Fly() =&gt; Console.WriteLine(&#8221;&#128683; This car cannot fly.&#8221;);

}

// --- Powertrain Strategies ---

public class PetrolEngine : IPowertrainStrategy

{

    public void Drive() =&gt; Console.WriteLine(&#8221;&#9981; Vroom! Driving on petrol.&#8221;);

}

public class ElectricEngine : IPowertrainStrategy

{

    public void Drive() =&gt; Console.WriteLine(&#8221;&#9889; Silent but deadly. Driving on electric.&#8221;);

}</code></pre><p></p><h3>Step 3: The Context (The Car)</h3><p>The <code>Car</code> class no longer implements the logic. It simply holds references to the interfaces and <strong>delegates</strong> the work.</p><pre><code>public abstract class Car

{

    // Composition: The Car HAS strategies

    private IFlyStrategy _flyStrategy;

    private IPowertrainStrategy _powertrainStrategy;

    // We can inject strategies via constructor

    protected Car(IFlyStrategy flyStrategy, IPowertrainStrategy powertrainStrategy)

    {

        _flyStrategy = flyStrategy;

        _powertrainStrategy = powertrainStrategy;

    }

    // Dynamic Swapping: We can change behavior at runtime!

    public void SetFlyStrategy(IFlyStrategy newStrategy) =&gt; _flyStrategy = newStrategy;

    // Delegation: &#8220;I don&#8217;t know how to fly, I ask my strategy to do it.&#8221;

    public void PerformFly() =&gt; _flyStrategy.Fly();

    public void PerformDrive() =&gt; _powertrainStrategy.Drive();

}</code></pre><p></p><h2>4. Putting It Together</h2><p>Now, creating specific car models is just a matter of &#8220;configuring&#8221; them with the right LEGO blocks.</p><p></p><pre><code>// Company A: Standard Petrol Car

public class CityCommuter : Car

{

    public CityCommuter() : base(new NoFly(), new PetrolEngine()) { }

}

// Company C: Experimental Flying Car

public class SkyRacer : Car

{

    public SkyRacer() : base(new JetPropulsion(), new ElectricEngine()) { }

}</code></pre><p></p><h3>The &#8220;Aha!&#8221; Moment: Runtime Swapping</h3><p>Because we rely on interfaces, we can change a car&#8217;s behavior <em>while the program is running</em>. Imagine a video game where a car picks up a &#8220;Flight Power-up&#8221;:</p><pre><code>var myCar = new CityCommuter();

myCar.PerformFly(); // Output: &#8220;This car cannot fly.&#8221;

// PLAYER PICKS UP POWER-UP

Console.WriteLine(&#8221;--- UPGRADE APPLIED ---&#8221;);

myCar.SetFlyStrategy(new JetPropulsion());

myCar.PerformFly(); // Output: &#8220;Thrusters engaged! We are flying.&#8221;</code></pre><p></p><h2>5. Why This is &#8220;Clean Code&#8221; (SOLID Analysis)</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2uND!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2uND!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 424w, https://substackcdn.com/image/fetch/$s_!2uND!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 848w, https://substackcdn.com/image/fetch/$s_!2uND!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 1272w, https://substackcdn.com/image/fetch/$s_!2uND!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2uND!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png" width="1412" height="414" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:1412,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:128808,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/179236889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2uND!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 424w, https://substackcdn.com/image/fetch/$s_!2uND!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 848w, https://substackcdn.com/image/fetch/$s_!2uND!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 1272w, https://substackcdn.com/image/fetch/$s_!2uND!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc830a5dc-cf23-4bf5-ac13-be12edb28edc_1412x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>The Strategy Pattern is not just about organizing code; it is about organizing <strong>change</strong>.</p><ul><li><p><strong>Naive Code:</strong> Resists change. New features break old features.</p></li><li><p><strong>Strategy Code:</strong> Welcomes change. New features are just new classes waiting to be plugged in.</p></li></ul><p>By decoupling the <em>What</em> (The Car) from the <em>How</em> (The Engine/Wings), you build a system that can evolve as fast as your business requirements.</p><p>refer the GITHUB repo for this pattern - the above implementation may differ https://github.com/DileepSreepathi/StrategyDesignPattern</p><p></p>]]></content:encoded></item><item><title><![CDATA[Introduction to Agents using Azure AI Foundry]]></title><description><![CDATA[code-first app using Azure agent service]]></description><link>https://newsletter.dotnetcircuit.com/p/introduction-to-agents-using-azure</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/introduction-to-agents-using-azure</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Sat, 25 Oct 2025 20:56:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JrzN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JrzN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JrzN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 424w, https://substackcdn.com/image/fetch/$s_!JrzN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 848w, https://substackcdn.com/image/fetch/$s_!JrzN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 1272w, https://substackcdn.com/image/fetch/$s_!JrzN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JrzN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png" width="1456" height="656" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:656,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:514367,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JrzN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 424w, https://substackcdn.com/image/fetch/$s_!JrzN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 848w, https://substackcdn.com/image/fetch/$s_!JrzN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 1272w, https://substackcdn.com/image/fetch/$s_!JrzN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F078cfdab-ced1-4d90-a6ac-6826fcf5ce4e_1540x694.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Before learning and implementing agents in the <strong>.NET ecosystem</strong>, <strong>let&#8217;s</strong> understand some basics. I <strong>suggest</strong> <strong>reading</strong> <a href="https://newsletter.dotnetcircuit.com/p/machine-learning-in-net-mlnet">this</a> to get some understanding <strong>of</strong> <strong>ML.Net</strong>, just for an idea to understand some <strong>basics of</strong> LLMs as well</p><h2>The Foundation: What is a Large Language Model (LLM)?</h2><p>Before we get to the future, let&#8217;s ground ourselves in the present. At its core, an <strong>LLM is a sophisticated text-prediction engine</strong>.</p><p>Think of it as an incredibly well-read consultant. It has consumed a vast portion of the internet, books, and articles. You can ask it to:</p><ul><li><p><strong>Generate</strong> content (write a blog post, a marketing email, or a programming language script).</p></li><li><p><strong>Summarize</strong> a long document.</p></li><li><p><strong>Translate</strong> between languages.</p></li><li><p><strong>Answer</strong> a complex question.</p></li></ul><p>You give it a <strong>prompt</strong> (input), and it gives you a <strong>response</strong> (output).</p><p>But here&#8217;s the key limitation: <strong>An LLM is passive.</strong> It can&#8217;t <em>do</em> anything outside of its text box. It can <em>tell</em> you how to book a flight, but it can&#8217;t open a browser, go to the airline&#8217;s website, and <em>actually book it for you</em>. It&#8217;s all talk, no action.</p><p></p><h2>The Evolution: Meet the AI Agent</h2><p>An <strong>AI Agent</strong> is what you get when you take that brilliant LLM &#8220;brain&#8221; and build an autonomous system around it. An agent isn&#8217;t just a <em>responder</em>; it&#8217;s a <em>doer</em>.</p><p>If an LLM is a consultant who gives you a plan, an <strong>AI Agent is the project manager who takes your goal and executes the entire plan, end-to-end.</strong></p><p>An agent is typically composed of four key parts:</p><ol><li><p><strong>The LLM (The &#8220;Brain&#8221;):</strong> The agent uses the LLM for its core reasoning, planning, and decision-making. &#8220;The user wants to book a flight. What&#8217;s the first step?&#8221;</p></li><li><p><strong>Tools (The &#8220;Hands&#8221;):</strong> This is the game-changer. An agent has access to a set of tools (like APIs) that allow it to interact with the real world. These tools can include:</p><ul><li><p>Web or file search.</p></li><li><p>Code execution (to run a script).</p></li><li><p>Database access (to check your stored preferences).</p></li><li><p>APIs (to connect to your calendar, your email, or the airline&#8217;s booking system).</p></li></ul></li><li><p><strong>Planning &amp; Task Decomposition:</strong> When you give an agent a complex <strong>goal</strong> (e.g., &#8220;Plan my weekend trip to Cape Town&#8221;), it uses its LLM brain to break that goal down into a <em>series of steps</em>:</p><ul><li><p><em>Step 1:</em> Search for flights to Cape Town for this Friday.</p></li><li><p><em>Step 2:</em> Check my calendar for conflicts.</p></li><li><p><em>Step 3:</em> Find top-rated hotels near the waterfront.</p></li><li><p><em>Step 4:</em> Present the top 3 options to the user.</p></li><li><p><em>Step 5:</em> Await approval and then book the chosen option.</p></li></ul></li><li><p><strong>Memory (The &#8220;Scratchpad&#8221;):</strong> An agent can remember the results of its previous actions. It can learn from its mistakes and self-correct. If a search fails, it can try a different query. This &#8220;inner monologue&#8221; or &#8220;chain of thought&#8221; allows it to handle multi-step tasks without human intervention.</p></li></ol><p>In this post, we will explore and implement a code-first &#8216;Sales Agent&#8217; designed to analyze sales data. This is an LLM-powered agent, built using the Semantic <strong>Kernel</strong> framework, which <strong>means</strong> it uses an LLM to process requests. It connects to external tools like databases, hosted files, and a code interpreter to generate charts.</p><p></p><p>Here is the <strong>high-level</strong> workflow for the <strong>LLM-powered</strong> <strong>&#8216;Sales Agent&#8217;</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tr-g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tr-g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 424w, https://substackcdn.com/image/fetch/$s_!tr-g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 848w, https://substackcdn.com/image/fetch/$s_!tr-g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 1272w, https://substackcdn.com/image/fetch/$s_!tr-g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tr-g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png" width="394" height="441" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:441,&quot;width&quot;:394,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16332,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tr-g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 424w, https://substackcdn.com/image/fetch/$s_!tr-g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 848w, https://substackcdn.com/image/fetch/$s_!tr-g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 1272w, https://substackcdn.com/image/fetch/$s_!tr-g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5b368a2-ef88-437b-86c4-d438b7508bf9_394x441.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><blockquote><p>Now that we have a foundational understanding of what LLMs and agents are, the next logical step is orchestration. To effectively orchestrate and maintain these agents, a dedicated platform is required. This is precisely where <strong>Azure AI Foundry</strong> comes into the picture.</p><p>Azure AI Foundry is a managed service from Microsoft on the Azure cloud designed to handle the entire agent lifecycle. It provides essential capabilities, such as:</p><ul><li><p>Rapid deployments and automation</p></li><li><p>Secure data connections</p></li><li><p>Flexible model selection</p></li><li><p>Enterprise-grade security</p></li></ul></blockquote><h2>What is Semantic Kernel? Your AI Orchestra Conductor</h2><p>If you&#8217;re a developer looking to build sophisticated AI applications, you&#8217;ve probably hit a wall. Large Language Models (LLMs) like those from Azure OpenAI are incredibly powerful at understanding and generating language, but they live in their own world. They can&#8217;t browse your company&#8217;s database, send an email, or call your existing C# functions.</p><p>This is where <strong>Semantic Kernel framework (SK)</strong> comes in.</p><p>Think of Semantic Kernel as an <strong>AI orchestra conductor</strong>. Your LLM (like GPT-4) is the star musician&#8212;brilliant, but it only knows how to play its instrument (language). Your traditional code (like your .NET business logic, APIs, and databases) are the other musicians in the orchestra, each with a specific skill.</p><p>Semantic Kernel is the conductor that hands the right sheet music (the prompt) to the LLM and coordinates it with the other musicians (your code) to create a complex, harmonious piece of music (a useful application).</p><p>It is an <strong>open-source SDK</strong> from Microsoft that acts as a lightweight orchestration layer, allowing you to seamlessly blend AI with conventional programming languages like C#, Python, and Java.</p><p>In short:</p><ul><li><p><strong>Semantic Kernel</strong> is the open-source <strong>SDK (the &#8220;how-to&#8221;)</strong> for building AI agents.</p></li><li><p><strong>Azure AI Studio / Foundry</strong> is the <strong>managed platform (the &#8220;where-to&#8221;)</strong> to deploy, run, and scale those agents in the cloud.</p><p></p></li></ul><p>For example, the framework provides a specific <code>AzureAIAgent</code> class. This agent is designed to run within the Azure AI service, seamlessly connecting to your Azure AI Search for data, using your Azure OpenAI models, and automatically handling things like conversation history and tool (plugin) execution.</p><p></p><p>Traditional applications operate on predefined logic. When you pass instructions, the application follows a fixed path to produce a result that is already planned and structured. The output is predictable because the entire process is hard-coded.</p><p>In contrast, LLM-powered agents operate dynamically. When you provide instructions and context, the agent itself intelligently determines the best way to handle the task, rather than following a rigid script. This demonstrates their power and speed, as they can significantly reduce manual effort by adapting to the request. It&#8217;s a much more intelligent and flexible approach.</p><p></p><p><strong>Azure AI Foundry</strong> is designed to change that. It&#8217;s a platform that combines models, tools, frameworks, and governance into a unified system for building intelligent agents. At the center of this system is <strong>Azure AI Foundry Agent Service</strong>, enabling the operation of agents across development, deployment, and production.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2mBS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2mBS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 424w, https://substackcdn.com/image/fetch/$s_!2mBS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 848w, https://substackcdn.com/image/fetch/$s_!2mBS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 1272w, https://substackcdn.com/image/fetch/$s_!2mBS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2mBS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png" width="1264" height="902" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:902,&quot;width&quot;:1264,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:292054,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2mBS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 424w, https://substackcdn.com/image/fetch/$s_!2mBS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 848w, https://substackcdn.com/image/fetch/$s_!2mBS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 1272w, https://substackcdn.com/image/fetch/$s_!2mBS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9277d59c-7398-4d1d-8cb1-68077b136665_1264x902.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Let&#8217;s jump to coding part : </p><p>Github Link :  https://github.com/DileepSreepathi/sales-agent-workshop</p><p>Resources setup: once the project is cloned , try to set up the resources that are required in this project. The required resources are created in the Azure cloud by running the below command. </p><p><code>./deploy.sh</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ysgJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ysgJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 424w, https://substackcdn.com/image/fetch/$s_!ysgJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 848w, https://substackcdn.com/image/fetch/$s_!ysgJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 1272w, https://substackcdn.com/image/fetch/$s_!ysgJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ysgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png" width="1456" height="683" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:683,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:584022,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ysgJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 424w, https://substackcdn.com/image/fetch/$s_!ysgJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 848w, https://substackcdn.com/image/fetch/$s_!ysgJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 1272w, https://substackcdn.com/image/fetch/$s_!ysgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e56b53d-bb9a-48fe-afe1-a7e8074adb4c_2794x1310.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>After the Azure resources are deployed, open the project workspace in VS Code and run the application (e.g., by typing <code>dotnet run</code> in the terminal). This will execute the <code>Program.cs</code> entry point, which runs the <code>Lab1.cs</code> code to create the agent. The agent then uses an LLM to process the input prompt, generate a query, and connect to the database to fetch the results. each agent is created under each separate thread task.</p><p>Function calling enables Large Language Models to interact with external systems. The LLM determines when to invoke a function based on instructions, function definitions, and user prompts. The LLM then returns structured data that can be used by the agent app to invoke a function.</p><h3><strong>Dynamic SQL Generation</strong></h3><p>When the app starts, it incorporates the database schema and key data into the instructions for the Foundry Agent Service. Using this input, the LLM generates SQLite-compatible SQL queries to respond to user requests expressed in natural language.</p><p>From a security perspective, we must address the risk of <strong>SQL injection</strong>. Because the LLM generates queries dynamically, a malicious prompt could attempt to create a query that modifies or destroys data. Therefore, a critical best practice is to grant the database connection <strong>read-only permissions</strong>. This mitigates the risk by ensuring that even a successful injection attack cannot alter or delete data.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_9sf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_9sf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 424w, https://substackcdn.com/image/fetch/$s_!_9sf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 848w, https://substackcdn.com/image/fetch/$s_!_9sf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!_9sf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_9sf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png" width="1456" height="765" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:765,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:442608,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_9sf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 424w, https://substackcdn.com/image/fetch/$s_!_9sf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 848w, https://substackcdn.com/image/fetch/$s_!_9sf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!_9sf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b643915-49e5-478e-905e-df9a48e1a308_2772x1456.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xFGA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xFGA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 424w, https://substackcdn.com/image/fetch/$s_!xFGA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 848w, https://substackcdn.com/image/fetch/$s_!xFGA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 1272w, https://substackcdn.com/image/fetch/$s_!xFGA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xFGA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png" width="1456" height="846" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:846,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:459893,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xFGA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 424w, https://substackcdn.com/image/fetch/$s_!xFGA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 848w, https://substackcdn.com/image/fetch/$s_!xFGA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 1272w, https://substackcdn.com/image/fetch/$s_!xFGA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7284cfb-b249-4555-aa21-4f6258014f44_2512x1460.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p></p><p><strong>Lab 2</strong> demonstrates how to query data using an LLM model and the file search tool. The file used for the search is uploaded at runtime</p><p>Grounding a conversation with documents is highly effective, especially for retrieving product details that may not be available in an operational database. The Foundry Agent Service includes a <a href="https://learn.microsoft.com/en-us/azure/ai-services/agents/how-to/tools/file-search">File Search tool</a>, which enables agents to retrieve information directly from uploaded files, such as user-supplied documents or product data, enabling a <a href="https://learn.microsoft.com/azure/ai-studio/concepts/retrieval-augmented-generation">RAG-style</a> search experience.</p><p>When the app starts, a vector store is created, the sales datasheet PDF file is uploaded to the vector store, and it is made available to the agent.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XHyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XHyD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 424w, https://substackcdn.com/image/fetch/$s_!XHyD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 848w, https://substackcdn.com/image/fetch/$s_!XHyD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 1272w, https://substackcdn.com/image/fetch/$s_!XHyD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XHyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png" width="1456" height="873" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:873,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:402040,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.dotnetcircuit.com/i/176815005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XHyD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 424w, https://substackcdn.com/image/fetch/$s_!XHyD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 848w, https://substackcdn.com/image/fetch/$s_!XHyD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 1272w, https://substackcdn.com/image/fetch/$s_!XHyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56bb8681-5a3e-490d-bc33-4ba1916fe4a0_2182x1308.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Other tools like code interpreter and multilingual visualizations are present in Lab 3 and Lab 4, which can be referred at -</p><p><a href="https://microsoft.github.io/build-your-first-agent-with-azure-ai-agent-service-workshop/lab-3-code_interpreter/"> </a> The sales agent is a hackathon project from the Microsoft agent <a href="https://microsoft.github.io/build-your-first-agent-with-azure-ai-agent-service-workshop/lab-3-code_interpreter/">hackathon tutorials.<br></a><br> I hope this post helped you understand how .NET developers can use agents in this space. If you found this article helpful, please consider following me for more content.</p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Machine Learning in .Net (ML.Net) ]]></title><description><![CDATA[As a .NET developer, I am eager to explore the integration of artificial intelligence (AI) into my applications.]]></description><link>https://newsletter.dotnetcircuit.com/p/machine-learning-in-net-mlnet</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/machine-learning-in-net-mlnet</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Tue, 21 Oct 2025 17:36:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!co_K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!co_K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!co_K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 424w, https://substackcdn.com/image/fetch/$s_!co_K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 848w, https://substackcdn.com/image/fetch/$s_!co_K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 1272w, https://substackcdn.com/image/fetch/$s_!co_K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!co_K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png" width="1400" height="897" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:897,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!co_K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 424w, https://substackcdn.com/image/fetch/$s_!co_K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 848w, https://substackcdn.com/image/fetch/$s_!co_K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 1272w, https://substackcdn.com/image/fetch/$s_!co_K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05427a0a-293b-442d-8090-ae20c32fd7dc_1400x897.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As a .NET developer, I am eager to explore the integration of artificial intelligence (AI) into my applications. Given the growing hype surrounding AI, I am particularly interested in understanding the practical steps involved in its adoption.</p><p>New AI models are constantly being released, and major tech companies are constantly competing to develop their own capabilities. This has prompted me to consider how I can leverage AI to enhance my applications.</p><p>I&#8217;ve decided to learn Artificial Intelligence (AI) as a C# developer to advance my professional development. Microsoft offers extensive documentation that serves as an entry point to connecting AI-related models and integrating them into applications. Consequently, I have commenced my learning process with <a href="https://learn.microsoft.com/en-us/dotnet/machine-learning/overview">ML.Net </a>Model Builder, which serves as the foundational component for this integration.</p><p><strong>General Explanation of the Machine Learning Concept</strong></p><p>Machine learning is a branch of artificial intelligence (AI) that focuses on enabling computers to learn from data and improve their performance over time without explicit programming. In this context, the data is being trained using machine learning algorithms.</p><p>Requirements:</p><ul><li><p>Visual Studio Code</p></li><li><p>Packages related to ML.Net</p></li><li><p>SDK: dotnet 8 SDK , ML.Net CLI</p></li></ul><p>In this demonstration, I will illustrate the process of constructing a machine learning model using the ML.Net CLI. Subsequently, I will demonstrate how to execute this command to generate a zip file containing the model. Finally, I will guide you on how to incorporate the generated model into a RESTful API. This example serves as a fundamental introduction to ML.Net for developers proficient in .NET programming.</p><p><strong>Problem statement:</strong><br>Construct a machine learning model capable of predicting the fare for a taxi ride, considering diverse input variables such as vendor identification, rate code, passenger count, trip duration in seconds, distance travelled, and payment method.</p><p><strong>Background:</strong></p><p>Taxi fare prediction is a pivotal component of the transportation sector, enabling both drivers and passengers to accurately estimate the cost of a ride. Precise fare predictions not only elevate customer satisfaction but also facilitate the optimisation of pricing strategies and contribute to the overall efficiency of taxi services.</p><p><strong>Data Description:</strong></p><p>The dataset contains historical data of taxi rides with the following features:</p><ul><li><p><strong>Vendor ID</strong>: A unique identifier for the taxi vendor.</p></li><li><p><strong>Rate Code</strong>: The rate code indicating the fare structure.</p></li><li><p><strong>Passenger Count</strong>: The number of passengers in the taxi.</p></li><li><p><strong>Trip Time in Seconds</strong>: The duration of the trip in seconds.</p></li><li><p><strong>Trip Distance</strong>: The distance covered during the ride (in kilometers or miles).</p></li><li><p><strong>Payment Type</strong>: The method of payment used (e.g., cash, credit card).</p></li></ul><p>&#8226; <strong>Fare Amount</strong>: The total fare charged for the ride (target variable).</p><p>Below is the project structure .</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i30p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i30p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 424w, https://substackcdn.com/image/fetch/$s_!i30p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 848w, https://substackcdn.com/image/fetch/$s_!i30p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 1272w, https://substackcdn.com/image/fetch/$s_!i30p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i30p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png" width="1400" height="1198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1198,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!i30p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 424w, https://substackcdn.com/image/fetch/$s_!i30p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 848w, https://substackcdn.com/image/fetch/$s_!i30p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 1272w, https://substackcdn.com/image/fetch/$s_!i30p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4e3b4f8-f698-4902-b45d-db12601ccb56_1400x1198.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Step 1:</strong></p><p>Create a New Solution for the Demo Application.</p><p>In the first step, create a new solution in Visual Studio Code and create a folder named &#8220;Data&#8221; to store the sample data file.</p><p>To initiate the model generation process, we require the data for prediction. I will be utilising the sample data provided in the Microsoft documentation:<strong> <a href="https://raw.githubusercontent.com/dotnet/machinelearning/main/test/data/taxi-fare-train.csv">https://raw.githubusercontent.com/dotnet/machinelearning/main/test/data/taxi-fare-train.csv</a>. </strong>Please prepare this CSV file and load it into the newly created &#8220;Data&#8221; folder as per above project structure .<strong><br><br><br>Step 2:</strong></p><p>To generate the console application for our Model project, execute the following command: </p><pre><code>mlnet regression - dataset &#8220;Data/taxiFare.csv&#8221; - label-col 6 - has-header true - name RegressionModel - train-time 60</code></pre><p>Various mlnet commands are the below in order to train and develop the custom models .</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MP4z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MP4z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 424w, https://substackcdn.com/image/fetch/$s_!MP4z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 848w, https://substackcdn.com/image/fetch/$s_!MP4z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 1272w, https://substackcdn.com/image/fetch/$s_!MP4z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MP4z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png" width="1400" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MP4z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 424w, https://substackcdn.com/image/fetch/$s_!MP4z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 848w, https://substackcdn.com/image/fetch/$s_!MP4z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 1272w, https://substackcdn.com/image/fetch/$s_!MP4z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e122a5a-31ce-424b-bc4b-b7eb5b462ce9_1400x367.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QKT_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QKT_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 424w, https://substackcdn.com/image/fetch/$s_!QKT_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 848w, https://substackcdn.com/image/fetch/$s_!QKT_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 1272w, https://substackcdn.com/image/fetch/$s_!QKT_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QKT_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png" width="1400" height="711" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:711,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QKT_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 424w, https://substackcdn.com/image/fetch/$s_!QKT_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 848w, https://substackcdn.com/image/fetch/$s_!QKT_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 1272w, https://substackcdn.com/image/fetch/$s_!QKT_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd46e9ab9-a830-4a55-8f05-2b71314ed292_1400x711.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Subsequently, the RegressionModel project is created, comprising the following files:</p><p>- <strong>Program.cs:</strong> This serves as the entry point to the application, where input data is passed to the Model and its output is extracted.</p><p>- <strong>mbconfig</strong>: This configuration file pertains to our Model project, detailing the CPU utilised for Model execution, column properties, and other relevant information.</p><p>- <strong>evaluate.cs </strong>class: The evaluate.cs class facilitates the evaluation of the model&#8217;s performance. Model Builder utilises the trained model to generate predictions on new test data, subsequently assessing the quality of these predictions.</p><p>- <strong>training.cs:</strong> This file is employed for training the model based on the provided data. Training is an automated process that instructs the Model Builder on how to respond to queries within the specified scenario. Once trained, the model can make predictions on input data that it has not encountered previously. For instance, if the objective is to predict taxi prices based on the input columns, the trained model will be capable of generating predictions on unseen data.</p><p>When running the console application , basically we are evaluating the model based on the internal algorithm which are already defined for the ML.Net task &#8212; Regression , the model get trained and processed in to .mlnet zip file</p><p>When training a model, it is possible to observe the algorithms it employs and the accuracy it will achieve based on their scores. As a developer learning about ML.Net, there is no need to be concerned about the intricate deep algorithms used behind the machine learning scenarios. Our initial step should be to comprehend how the ML model is generated and integrated. Once we have gained confidence in our overall understanding, we can focus on the data training process and identify algorithms that can be modified in the existing generated code to train our model for optimal accuracy scores.</p><p>Here&#8217;s a screenshot of when the model is training. It&#8217;s exploring all the available algorithms.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zjYg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zjYg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 424w, https://substackcdn.com/image/fetch/$s_!zjYg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 848w, https://substackcdn.com/image/fetch/$s_!zjYg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 1272w, https://substackcdn.com/image/fetch/$s_!zjYg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zjYg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png" width="1400" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zjYg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 424w, https://substackcdn.com/image/fetch/$s_!zjYg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 848w, https://substackcdn.com/image/fetch/$s_!zjYg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 1272w, https://substackcdn.com/image/fetch/$s_!zjYg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa80c6ea1-a1bc-45e5-acc2-646b12beb7be_1400x521.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Now your model is ready to use it .<br><br>Let&#8217;s run the console application in order to test the model , navigate to your Model project and run the below command:</p><p><code>dotnet run</code></p><p>Output:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vxqU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vxqU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 424w, https://substackcdn.com/image/fetch/$s_!vxqU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 848w, https://substackcdn.com/image/fetch/$s_!vxqU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 1272w, https://substackcdn.com/image/fetch/$s_!vxqU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vxqU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png" width="1400" height="272" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:272,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vxqU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 424w, https://substackcdn.com/image/fetch/$s_!vxqU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 848w, https://substackcdn.com/image/fetch/$s_!vxqU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 1272w, https://substackcdn.com/image/fetch/$s_!vxqU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5df8eb78-7ed1-4de0-895e-0f08731813cd_1400x272.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Step 3</strong> : Consume the Model through Rest api .<br><br>Create the dotnet web api project using below command: </p><pre><code>dotnet new webapi -n TaxiFareAPi -o TaxiFareApi - no-https</code></pre><p>Add the below nuget packages for the API project in the .csproj file:</p><pre><code>&lt;PackageReference Include=&#8221;Microsoft.AspNetCore.OpenApi&#8221; Version=&#8221;9.0.0&#8221; /&gt;
&lt;PackageReference Include=&#8221;Microsoft.ML&#8221; Version=&#8221;4.0.2&#8221; /&gt;
&lt;PackageReference Include=&#8221;Swashbuckle.AspNetCore&#8221; Version=&#8221;8.1.1&#8221; /&gt;
&lt;PackageReference Include=&#8221;Microsoft.ML.FastTree&#8221; Version=&#8221;3.0.1&#8221; /&gt;</code></pre><p></p><p>Below are the Controller, Service, and Input/Output classes. The model consumption is implemented in the service class using the ML context and is subsequently called by the controller. This process ensures that the model is consumed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Tiwx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Tiwx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 424w, https://substackcdn.com/image/fetch/$s_!Tiwx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 848w, https://substackcdn.com/image/fetch/$s_!Tiwx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 1272w, https://substackcdn.com/image/fetch/$s_!Tiwx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Tiwx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png" width="1400" height="785" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:785,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Tiwx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 424w, https://substackcdn.com/image/fetch/$s_!Tiwx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 848w, https://substackcdn.com/image/fetch/$s_!Tiwx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 1272w, https://substackcdn.com/image/fetch/$s_!Tiwx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7df38940-ac6c-4605-8f9b-7fbc973ded81_1400x785.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Upon constructing the API project and executing it on localhost, In order to test this on Postman will yield the following output:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1hg6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1hg6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 424w, https://substackcdn.com/image/fetch/$s_!1hg6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 848w, https://substackcdn.com/image/fetch/$s_!1hg6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 1272w, https://substackcdn.com/image/fetch/$s_!1hg6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1hg6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png" width="1400" height="651" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:651,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1hg6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 424w, https://substackcdn.com/image/fetch/$s_!1hg6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 848w, https://substackcdn.com/image/fetch/$s_!1hg6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 1272w, https://substackcdn.com/image/fetch/$s_!1hg6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9e712d5-edf0-45b4-be08-eaf01239645d_1400x651.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Finally, we are able to comprehend the ML.NET Module on the dotnet platform. It offers a wide range of machine learning models for training and evaluating data to achieve greater accuracy, which can then be integrated into applications based on the problem statement. The ML.NET documentation provides various ML tasks and underlying algorithms for exploration. Additionally, Azure Open AI services offer pre-built models that can be easily integrated into our applications.</p><p>We can conclude that AI has the potential to perform more complex tasks and do so at an unprecedented speed. However, it is crucial to exercise caution when handling data, ensuring that it is properly prepared, trained, and evaluated. By adopting a systematic approach to organising all modules, we can harness the full potential of AI in our applications.</p><p><strong>Next Steps in Learning in This Space:</strong></p><p>- Practice various problem statements.</p><p>- Train models effectively with high accuracy.</p><p>- Understand the AI workflow, RAG, AI agents, and the latest buzzword, MCP (Model Context Protocol).</p><p><strong>References</strong>:</p><p><a href="https://learn.microsoft.com/en-us/dotnet/machine-learning/overview">https://learn.microsoft.com/en-us/dotnet/machine-learning/overview</a></p>]]></content:encoded></item><item><title><![CDATA[Redis Cache Implementation in Dot Net Core ]]></title><description><![CDATA[In the world of .NET Core, Redis plays a crucial role in enhancing the performance of an application by reducing the load on the database.]]></description><link>https://newsletter.dotnetcircuit.com/p/redis-cache-implementation-in-dot</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/redis-cache-implementation-in-dot</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Fri, 26 Apr 2024 19:40:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Qjc-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qjc-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qjc-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 424w, https://substackcdn.com/image/fetch/$s_!Qjc-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 848w, https://substackcdn.com/image/fetch/$s_!Qjc-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 1272w, https://substackcdn.com/image/fetch/$s_!Qjc-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qjc-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png" width="1012" height="478" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:478,&quot;width&quot;:1012,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qjc-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 424w, https://substackcdn.com/image/fetch/$s_!Qjc-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 848w, https://substackcdn.com/image/fetch/$s_!Qjc-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 1272w, https://substackcdn.com/image/fetch/$s_!Qjc-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfe4cd9-6c5e-432c-a36c-4a0e67974ebc_1012x478.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>In the world of .NET Core, Redis plays a crucial role in enhancing the performance of an application by reducing the load on the database. In this comprehensive blog post, we will delve deep into the implementation of Redis Cache in Dot Net Core, unraveling its mysteries and exploring its pivotal role in system design.</p><p>Caching is a technique that stores frequently accessed data in memory so that it can be retrieved quickly without having to access the underlying database. This can improve the performance and scalability of web applications by reducing the load on the database.</p><p>Redis Cache, an open-source, in-memory data structure store, acts as a lightning-fast cache. Implemented seamlessly in Dot Net Core, it revolutionizes how we handle data, ensuring rapid access and retrieval, even for the most complex applications.</p><h1><strong>Why Redis Cache?</strong></h1><p>Before we dive into the implementation details, let&#8217;s understand why we need Redis Cache. In any application, data retrieval from a database is a time-consuming process. To improve this, we use caching. Caching refers to the process of storing frequently accessed data in a temporary storage area (<strong>cache</strong>). So, when the same data is requested again, it is retrieved from the cache instead of the database. This significantly improves the performance and speed of data retrieval.</p><p>Redis Cache comes into play here. It stores the frequently accessed data <strong>in-memory</strong> and retrieves it at a much faster rate compared to traditional databases</p><p>Redis isn&#8217;t just a cache; it&#8217;s a versatile data store with various types catering to diverse data needs. From simple strings to intricate sorted sets, grasp the nuances of Redis data types. Understand when to use hashes for efficient storage, or when to opt for sorted sets to handle ranking and scoring seamlessly. Uncover real-world scenarios where each data type shines, empowering you to make informed design decisions in your Dot Net Core projects.</p><h1><strong>Redis Data Types</strong></h1><p>Redis supports various types of data structures:</p><ul><li><p><strong>Strings</strong>: The most basic Redis data type that represents a sequence of bytes.</p></li><li><p><strong>Lists</strong>: Lists of strings sorted by insertion order.</p></li><li><p><strong>Sets</strong>: Unordered collections of unique strings.</p></li><li><p><strong>Hashes</strong>: Collections of field-value pairs.</p></li><li><p><strong>Sorted Sets</strong>: Collections of unique strings that maintain order by each string&#8217;s associated score.</p></li><li><p><strong>Bitmaps</strong>: Allow you to perform bitwise operations on strings.</p></li><li><p><strong>HyperLogLogs</strong>: Provide probabilistic estimates of the cardinality (i.e., number of elements) of large sets.</p></li><li><p><strong>Geospatial Indexes</strong>: Useful for finding locations within a given geographic radius or bounding box.</p></li><li><p><strong>Streams</strong>: Act like an append-only log that helps record events in the order they occur and then syndicate them for processing.</p></li></ul><p><strong>Implementing Redis Cache in Dot Net Core</strong></p><ol><li><p>First, we will install and configure Redis &#8212; to do this, grab the Redis image from Docker, as seen below:</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qCNw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qCNw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 424w, https://substackcdn.com/image/fetch/$s_!qCNw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 848w, https://substackcdn.com/image/fetch/$s_!qCNw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 1272w, https://substackcdn.com/image/fetch/$s_!qCNw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qCNw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png" width="1400" height="567" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:567,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!qCNw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 424w, https://substackcdn.com/image/fetch/$s_!qCNw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 848w, https://substackcdn.com/image/fetch/$s_!qCNw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 1272w, https://substackcdn.com/image/fetch/$s_!qCNw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8d4cd62-10e7-4567-9918-62811defcb81_1400x567.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>command to get the redis image: docker pull redis</p><p>once it is done, run the Redis image:</p><ul><li><p>d: Run in the background</p></li><li><p>-p-: Set the Port number</p></li><li><p>&#8212; name: name of the image</p></li></ul><pre><code>docker -d -p 6279:6279 --name dotnet-redis redis</code></pre><p>Once the Redis image setup is done successfully, verify whether the docker image is running or not by using the command: <strong>docker ps</strong></p><p>2. Next, Create a new .Net core API project and install the Nuget package named: <strong>Microsoft.Extensions.Caching.StackExchangeRedis</strong></p><p>3. We follow the <a href="https://medium.com/stackademic/repository-pattern-implementation-in-net-core-e36d12d8e508">repository pattern</a> here to go through the Redis implementation.</p><p>Assume that we have a repository class called Basket. The function of this Basket class is to retrieve and update the Basket details, such as items that are moved to the Basket and updated there. To expedite this process and avoid repeatedly retrieving the data from the Database, we will store the Basket class operations data in the Redis cache.</p><pre><code>
//interface 

using System;
using Basket.API.Entities;

namespace Basket.API.Repositories
{
    public interface IBasketRepository
    {
        Task&lt;ShoppingCart&gt; GetBasket(string userName);

        Task&lt;ShoppingCart&gt; UpdateBasket(ShoppingCart basket);

        Task DeleteBasket(string userName);
    }
}


//BasketRepository class

using System;
using Basket.API.Entities;
using Microsoft.Extensions.Caching.Distributed;
using Newtonsoft.Json;

namespace Basket.API.Repositories
{
    public class BasketRepository : IBasketRepository
    {
        private readonly IDistributedCache _redisCache;

        public BasketRepository(IDistributedCache redisCache)
        {
            _redisCache = redisCache ?? throw new ArgumentNullException(nameof(redisCache));
        }

        public async Task&lt;ShoppingCart&gt; GetBasket(string userName)
        {
            var basket = await _redisCache.GetStringAsync(userName);

            if (String.IsNullOrEmpty(basket))
                return null;

            return JsonConvert.DeserializeObject&lt;ShoppingCart&gt;(basket);
        }

        public async Task&lt;ShoppingCart&gt; UpdateBasket(ShoppingCart basket)
        {
            await _redisCache.SetStringAsync(basket.UserName, JsonConvert.SerializeObject(basket));

            return await GetBasket(basket.UserName);
        }

        public async Task DeleteBasket(string userName)
        {
            await _redisCache.RemoveAsync(userName);
        }
    }
}

</code></pre><p>The Redis cache is injected into this class and inside the method we are setting and getting the items as per the username.</p><p>Configure the Redis server in the appsettings.json file :</p><pre><code> "CacheSettings": {
    "ConnectionString": "localhost:6379"
  },</code></pre><p>Setting up the dependency injection for Basket service and Redis cache in <strong>program.cs</strong> file:</p><pre><code>builder.Services.AddScoped&lt;IBasketRepository, BasketRepository&gt;();

builder.Services.AddStackExchangeRedisCache(options =&gt;
{
    options.Configuration = builder.Configuration.GetValue&lt;string&gt;("CacheSettings:ConnectionString");
});</code></pre><p>The basic implementation of Redis in the dot net core project is seen above; once the Redis consumed methods are completed, these are called from the controller action methods.</p><p>Then I installed the RedisInsights client tool which is connected to redis server running on <strong>port : 6379 </strong>to view the data: you can see we used the Hash datatype to store the data in a key-value format:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kc5H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kc5H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 424w, https://substackcdn.com/image/fetch/$s_!Kc5H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 848w, https://substackcdn.com/image/fetch/$s_!Kc5H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 1272w, https://substackcdn.com/image/fetch/$s_!Kc5H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kc5H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png" width="1400" height="676" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:676,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Kc5H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 424w, https://substackcdn.com/image/fetch/$s_!Kc5H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 848w, https://substackcdn.com/image/fetch/$s_!Kc5H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 1272w, https://substackcdn.com/image/fetch/$s_!Kc5H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3862015-9c6f-4825-9858-1789f7ca1735_1400x676.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Advantages of using Redis Cache in Dot Net Core</strong></p><p>Redis Cache isn&#8217;t just a tool; it&#8217;s a solution. Explore the myriad advantages it offers, from unparalleled speed and scalability to fault tolerance and seamless integration with Dot Net Core technologies. Learn how Redis Cache enhances your project&#8217;s resilience, enabling it to handle surges in user traffic effortlessly. Understand its role in enhancing overall user satisfaction, making it a must-have component in your development toolkit.</p><ul><li><p><strong>Improved performance:</strong> Redis Cache can significantly improve the performance of web applications by reducing the load on the database.</p></li><li><p><strong>Scalability</strong>: Redis Cache is a distributed cache, which means that it can be scaled horizontally to meet the needs of even the most demanding applications.</p></li><li><p><strong>Reliability</strong>: Redis Cache is a reliable and durable cache, with features such as replication and persistence to prevent data loss.</p></li><li><p><strong>Easy to use</strong>: Redis Cache is easy to use and provides a simple API for storing and retrieving data from the cache.</p></li><li><p><strong>Data Structures</strong>: Unlike other key-value stores that offer string-to-string mappings, Redis offers numerous data structures.</p></li></ul><p><strong>When and how to use Redis Cache in Dot Net Core</strong></p><p>Redis Cache can be used in a variety of scenarios in Dot Net Core applications, including:</p><ul><li><p><strong>Caching frequently accessed data</strong>: Redis Cache can be used to cache frequently accessed data, such as product data, user data, and configuration data.</p></li><li><p><strong>Output caching</strong>: Redis Cache can be used to cache the output of controllers and services, which can improve the performance of dynamic pages.</p></li><li><p><strong>Session caching</strong>: Redis Cache can be used to cache session data, which can improve the performance of web applications and reduce the load on the database.</p></li><li><p><strong>Message queuing</strong>: Redis Cache can be used as a message queue to implement asynchronous communication between different parts of an application.</p></li></ul><p>Redis Cache can play an important role in <strong>system design</strong> by improving the performance, scalability, and reliability of web applications.</p><p>In this blog post, we&#8217;ve unraveled the mysteries of Redis Cache in the Dot Net Core framework and understood its role in system design. We also walked through a step-by-step process of implementing Redis Cache using StackExchange.Redis and configuring it in a .NET Core application. Finally, we highlighted some advantages of using Redis Cache such as high performance, scalability, persistence, and support for various data structures. you&#8217;re now equipped with the knowledge to transform your projects. Redis Cache isn&#8217;t just a tool; it&#8217;s your ticket to creating blazing-fast, reliable, and efficient applications.</p><p>Redis Cache in Dot Net Core isn&#8217;t merely a technological advancement; it&#8217;s a paradigm shift. Embrace it, integrate it, and witness the transformation it brings to your projects. Your users deserve nothing less than exceptional performance, and Redis Cache ensures you deliver exactly that.</p><p>Happy Coding!</p>]]></content:encoded></item><item><title><![CDATA[CQRS Pattern Implementation in .Net Core ]]></title><description><![CDATA[Embarking on a journey into the realm of design patterns, let&#8217;s delve into the intricacies of the CQRS (Command Query Responsibility Segregation) pattern and its implementation in the .NET Core framework.]]></description><link>https://newsletter.dotnetcircuit.com/p/cqrs-pattern-implementation-in-net</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/cqrs-pattern-implementation-in-net</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Fri, 26 Apr 2024 19:37:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!BPMZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BPMZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BPMZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 424w, https://substackcdn.com/image/fetch/$s_!BPMZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 848w, https://substackcdn.com/image/fetch/$s_!BPMZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 1272w, https://substackcdn.com/image/fetch/$s_!BPMZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BPMZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png" width="1400" height="778" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:778,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BPMZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 424w, https://substackcdn.com/image/fetch/$s_!BPMZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 848w, https://substackcdn.com/image/fetch/$s_!BPMZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 1272w, https://substackcdn.com/image/fetch/$s_!BPMZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58b2584c-9f65-4f86-bafe-c994bf4d71e3_1400x778.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>Embarking on a journey into the realm of design patterns, let&#8217;s delve into the intricacies of the CQRS (<strong>Command Query Responsibility Segregation)</strong> pattern and its implementation in the .NET Core framework.</p><p><strong>Understanding CQRS: A Paradigm Shift in Design</strong></p><p>CQRS, an architectural pattern, introduces a fundamental shift in the way we design and structure our applications. By segregating the responsibilities of handling commands (write operations) and queries (read operations), CQRS opens the door to enhanced scalability, maintainability, and flexibility. We&#8217;ll explore the anatomy of the pattern, its key components, and how it decouples the command and query pathways.</p><p>This separation allows you to independently scale and optimize your read and write workloads and offers a high level of flexibility.</p><p>The CQRS pattern is based on the principle that the data model used to update an application can be different from the model used to read data from it. This separation provides several benefits:</p><ol><li><p><strong>Performance Optimization</strong>: By separating reads and writes, you can optimize each operation independently.</p></li><li><p><strong>Complexity Management</strong>: CQRS allows you to handle complex business logic more effectively by focusing on one task at a time.</p></li><li><p><strong>Scalability</strong>: With CQRS, you can scale your read and write operations independently, which is particularly useful in cloud-based applications.</p></li></ol><p>However, implementing CQRS can also introduce some challenges:</p><ol><li><p><strong>Increased Complexity</strong>: CQRS can add complexity to your application, especially if your read and write operations are not significantly different.</p></li><li><p><strong>Data Consistency</strong>: Since reads and writes are handled separately, there can be a delay in reflecting the updates in the read model.</p></li></ol><p><strong>Implementing CQRS in .NET Core: Bringing Theory to Reality</strong></p><p>With the powerful ecosystem of .NET Core, implementing CQRS becomes an exciting endeavor. We&#8217;ll walk through practical examples, showcasing how to structure your application using separate models for commands and queries. Learn about the role of command handlers, query handlers, and the intricate dance between them. Witness the elegance of CQRS in action as we build a sample application step by step.</p><p>Here&#8217;s a step-by-step guide on how to implement the CQRS pattern in a .NET Core application:</p><ol><li><p><strong>Define Your Commands and Queries</strong>: Commands are methods that change the state of your data, while queries are methods that read your data.</p></li><li><p><strong>Create Command and Query Handlers</strong>: These handlers contain the logic for handling commands and queries.</p></li><li><p><strong>Use MediatR Library</strong>: MediatR is a popular library in .NET Core for implementing the CQRS pattern. It provides a simple, unambitious mediator implementation in .NET.</p></li><li><p><strong>Implement Command and Query Handlers</strong>: With MediatR, each command or query has its own handler. This separation makes it easier to maintain and test your application.</p></li></ol><p>I have created a Microservice application in .Net core (using .Net 6) which follows the <strong><a href="https://medium.com/stackademic/clean-architecture-design-in-net-e8114cc15f8c">Clean Architecture</a>. </strong>Below is the folder structure .</p><p>The Ordering API service (/checkoutorder) is responsible for checking out the order request.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1piR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1piR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 424w, https://substackcdn.com/image/fetch/$s_!1piR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 848w, https://substackcdn.com/image/fetch/$s_!1piR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 1272w, https://substackcdn.com/image/fetch/$s_!1piR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1piR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png" width="574" height="1362" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1362,&quot;width&quot;:574,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!1piR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 424w, https://substackcdn.com/image/fetch/$s_!1piR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 848w, https://substackcdn.com/image/fetch/$s_!1piR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 1272w, https://substackcdn.com/image/fetch/$s_!1piR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d0fa20b-48a4-4aa8-9485-4c47b065a42d_574x1362.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Under the CQRS pattern notion, queries and commands are developed individually; if we need to acquire data from the database, we use <strong>Queries</strong>; if we need to change or enter data into the database, we use <strong>Commands</strong>.</p><p><strong>Queries :</strong></p><p>The Handler class is found in the GetOrderList subdirectory. When we invoke it through the mediator, it connects to the DB repository interface to retrieve the OrderList.</p><pre><code>

//class : GetOrdersListQuery

using System;
using MediatR;

namespace Ordering.Application.Features.Orders.Queries.GetOrdersList
{
    public class GetOrdersListQuery : IRequest&lt;List&lt;OrdersVm&gt;&gt;
    {
        public string UserName { get; set; }

        public GetOrdersListQuery(string userName)
        {
            UserName = userName ?? throw new ArgumentNullException(nameof(userName));
        }
    }
}




//class : GetOrdersListQueryHandler

using System;
using AutoMapper;
using MediatR;
using Ordering.Application.Contracts.Persistence;

namespace Ordering.Application.Features.Orders.Queries.GetOrdersList
{
    public class GetOrdersListQueryHandler : IRequestHandler&lt;GetOrdersListQuery, List&lt;OrdersVm&gt;&gt;
    {
        private readonly IOrderRepository _orderRepository;
        private readonly IMapper _mapper;

        public GetOrdersListQueryHandler(IOrderRepository orderRepository, IMapper mapper)
        {
            _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));
            _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
        }

        public async Task&lt;List&lt;OrdersVm&gt;&gt; Handle(GetOrdersListQuery request,
            CancellationToken cancellationToken)
        {
            var orderList = await _orderRepository.GetOrdersByUserName(request.UserName);
            return _mapper.Map&lt;List&lt;OrdersVm&gt;&gt;(orderList);
        }
    }
}

</code></pre><p><strong>Commands:</strong></p><p>For the checkout order command, we are inserting the new order entity into the database. Before inserting this request into the database, we can validate the parameters of the request using Fluent validation, as shown below. If the validation is successful, the handler will proceed with the insertion using the AddAsync() method.</p><pre><code>using System;
using FluentValidation;

namespace Ordering.Application.Features.Orders.Commands.CheckoutOrder
{
    public class CheckoutOrderCommandValidator : AbstractValidator&lt;CheckoutOrderCommand&gt;
    {
        public CheckoutOrderCommandValidator()
        {
            RuleFor(p =&gt; p.UserName)
                .NotEmpty().WithMessage("{UserName} is required.")
                .NotNull()
                .MaximumLength(50).WithMessage("{UserName} must not exceed 50 characters.");

            RuleFor(p =&gt; p.EmailAddress)
               .NotEmpty().WithMessage("{EmailAddress} is required.");

            RuleFor(p =&gt; p.TotalPrice)
                .NotEmpty().WithMessage("{TotalPrice} is required.")
                .GreaterThan(0).WithMessage("{TotalPrice} should be greater than zero.");
        }
    }
}


// Hanlder class  :

using System;
using AutoMapper;
using MediatR;
using Microsoft.Extensions.Logging;
using Ordering.Application.Contracts.Infrastructure;
using Ordering.Application.Contracts.Persistence;
using Ordering.Application.Models;
using Ordering.Domain.Entities;

namespace Ordering.Application.Features.Orders.Commands.CheckoutOrder
{
    public class CheckoutOrderCommandHandler : IRequestHandler&lt;CheckoutOrderCommand, int&gt;
    {
        private readonly IOrderRepository _orderRepository;
        private readonly IMapper _mapper;
        private readonly IEmailService _emailService;
        private readonly ILogger&lt;CheckoutOrderCommandHandler&gt; _logger;

        public CheckoutOrderCommandHandler(IOrderRepository orderRepository, IMapper mapper, IEmailService emailService, ILogger&lt;CheckoutOrderCommandHandler&gt; logger)
        {
            _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));
            _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
           _logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }

        public async Task&lt;int&gt; Handle(CheckoutOrderCommand request, CancellationToken cancellationToken)
        {
            var orderEntity = _mapper.Map&lt;Order&gt;(request);
            var newOrder = await _orderRepository.AddAsync(orderEntity);

            _logger.LogInformation($"Order {newOrder.Id} is successfully created.");

            await SendMail(newOrder);

            return newOrder.Id;
        }

        
    }
}

</code></pre><p>Below is the code snippet to call this handler from the controller.</p><pre><code>
// To get list 
[HttpGet("{userName}", Name = "GetOrder")]
        [ProducesResponseType(typeof(IEnumerable&lt;OrdersVm&gt;), (int)HttpStatusCode.OK)]
        public async Task&lt;ActionResult&lt;IEnumerable&lt;OrdersVm&gt;&gt;&gt; GetOrdersByUserName(string userName)
        {
            var query = new GetOrdersListQuery(userName);
            var orders = await _mediator.Send(query);
            return Ok(orders);
        }

        // to insert into the DB 
        [HttpPost(Name = "CheckoutOrder")]
        [ProducesResponseType((int)HttpStatusCode.OK)]
        public async Task&lt;ActionResult&lt;int&gt;&gt; CheckoutOrder([FromBody] CheckoutOrderCommand command)
        {
            var result = await _mediator.Send(command);
            return Ok(result);
        }</code></pre><p>In the realm of modern application development, CQRS stands as a beacon of innovation. &#8220;Mastering CQRS Pattern in .NET Core&#8221; empowers you to harness its potential, providing a comprehensive guide to implementing, understanding, and mastering this transformative pattern.</p>]]></content:encoded></item><item><title><![CDATA[AWS Lambda with .NET ]]></title><description><![CDATA[In the dynamic world of modern software development, serverless architectures are revolutionizing the way we build scalable and cost-effective applications.]]></description><link>https://newsletter.dotnetcircuit.com/p/aws-lambda-with-net</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/aws-lambda-with-net</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Fri, 26 Apr 2024 19:35:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wADS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wADS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wADS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wADS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wADS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wADS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wADS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg" width="1400" height="788" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:788,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wADS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wADS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wADS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wADS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ffd276-d106-49e2-9d73-c45f4907d271_1400x788.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In the dynamic world of modern software development, serverless architectures are revolutionizing the way we build scalable and cost-effective applications. AWS Lambda, Amazon&#8217;s serverless computing service, empowers you to run code without the complexities of managing servers. When combined with Amazon API Gateway, you can create robust APIs to serve as front doors to your serverless logic.</p><p>If you&#8217;re a.NET developer, this blog post will help you use the potential of AWS Lambda and API Gateway. We&#8217;ll look at what these services are, why they matter, and walk through a practical example to help you understand.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.dotnetcircuit.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dileep&#8217;s Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>This post provides a quick introduction to AWS Lambda serverless technology for experienced developers with a background in.Net. It explains how it is configured and how to integrate it with practical examples.</p><p></p><p><strong>What is AWS Lambda?</strong></p><p>Let&#8217;s break it down:</p><ul><li><p><strong>Functions as a Service (FaaS):</strong> AWS Lambda adheres to the FaaS model. You write your core logic as self-contained functions. AWS handles the heavy lifting &#8212; provisioning, scaling, and managing the underlying infrastructure.</p></li><li><p><strong>Event-Driven:</strong> Lambda functions don&#8217;t run continuously. They are invoked in response to specific events/triggers like an HTTP request, a file upload to an S3 bucket, or a database record change.</p></li><li><p><strong>Pay-Per-Execution:</strong> You pay only for the compute time your functions consume. This means no costs are incurred when your code isn&#8217;t running.</p></li></ul><p></p><p>Now let's see when to use the AWS Lambda?</p><ul><li><p><strong>Event-Driven Workloads:</strong> If your application logic reacts to specific events (file uploads, API requests, database changes), Lambda&#8217;s event-driven nature is ideal.</p></li><li><p><strong>Short-Lived Tasks:</strong> Lambda excels at handling quick, stateless tasks. Don&#8217;t use it for long-running processes or applications requiring persistent connections.</p></li><li><p><strong>Cost-effectiveness:</strong> For applications with unpredictable or fluctuating workloads, the pay-per-execution model keeps costs low.</p></li><li><p><strong>Focus on Code:</strong> Want to ditch server management and focus on core logic? Lambda lets you do just that.</p></li><li><p><strong>Microservices Architecture:</strong> Break down monolithic applications into smaller, scalable Lambda functions for improved maintainability and deployment flexibility.</p></li></ul><p></p><p>Not to use AWS Lambda:<br><strong>Long-Running Processes:</strong> Lambda functions have a timeout limit .If your tasks or code execution time is more don&#8217;t use the lamda because the close is more for maintaining it hence other alternative are the containerized services like Amazon EC2 or Amazon ECS.</p><p><strong>State Management:</strong> Lambda functions are inherently stateless. If your application requires complex state management, consider managed services like Amazon DynamoDB or ElastiCache.</p><p></p><p><strong>What is Amazon API Gateway?</strong></p><p>Generally An API Gateway, acts as a central hub for managing APIs (Application Programming Interfaces). It sits between client applications and backend services, providing a unified interface for interacting with various functionalities offered by the backend. Here&#8217;s a breakdown of its key functionalities:</p><p></p><ul><li><p><strong>Single Entry Point:</strong> API Gateway serves as a single endpoint for all API requests, simplifying client interactions. Imagine it as a single front door leading to all the functionalities within a building.</p></li><li><p><strong>Routing:</strong> It efficiently routes incoming API requests to the appropriate backend services based on predefined rules. This routing logic can be based on factors like request path, headers, or parameters.</p></li><li><p><strong>Security:</strong> API Gateway enforces security measures like authentication and authorization. It ensures only authorized users or applications can access specific functionalities.</p></li><li><p><strong>Throttling and Rate Limiting:</strong> It safeguards your backend services from overload by throttling or rate-limiting requests. This prevents denial-of-service attacks and ensures smooth performance.</p></li><li><p><strong>Monitoring and Analytics:</strong> API Gateway provides valuable insights into API usage patterns. You can monitor metrics like latency, traffic volume, and error rates to identify bottlenecks and optimize performance.</p></li><li><p><strong>API Versioning:</strong> It facilitates managing different API versions. You can control access to specific versions and seamlessly roll out updates without disrupting existing client applications.</p></li><li><p><strong>Transformations:</strong> API Gateway can manipulate request and response data formats (e.g., JSON to XML) to ensure compatibility between different systems.</p></li></ul><p></p><p>API gateway on Amazon AWS:</p><ul><li><p><strong>AWS-Specific Integrations:</strong> It seamlessly integrates with other AWS services like Lambda, DynamoDB, and S3, making it easy to build serverless applications.</p></li><li><p><strong>Flexible API Design:</strong> Supports both RESTful APIs and WebSockets, catering to diverse application needs.</p></li><li><p><strong>Pay-Per-Use Model:</strong> You only pay for the resources consumed by your APIs, making it cost-effective for varying traffic loads.</p></li><li><p><strong>Developer Friendly:</strong> AWS offers robust tools and SDKs for various programming languages, making the development and management of APIs on API Gateway straightforward.</p></li></ul><p><strong>Why Lambda and API Gateway for .NET Developers?</strong></p><p></p><p>Here&#8217;s where the magic happens for .NET developers:</p><ol><li><p><strong>Focus on Code:</strong> Your primary concern becomes your business logic, not infrastructure hassles. This leads to shorter development cycles and faster iterations.</p></li><li><p><strong>Infinite Scalability:</strong> Lambda functions scale automatically to meet traffic demands. Whether it&#8217;s ten requests or a thousand, AWS handles it seamlessly.</p></li><li><p><strong>Cost-Efficiency:</strong> The pay-per-execution model means you don&#8217;t pay for idle resources. This is especially beneficial for unpredictable or fluctuating workloads.</p></li><li><p><strong>.NET Excellence:</strong> AWS provides excellent support for .NET on Lambda. You can use your favorite languages (C#, F#, etc.) and leverage familiar tools and libraries.</p></li><li><p><strong>Ecosystem Integration:</strong> Lambda functions effortlessly connect with other AWS services like S3, DynamoDB, SNS, and more, creating powerful event-driven architectures.</p></li></ol><p></p><p>Now hands on code &#8212; lets practically implement the Lambda function.</p><p>Prerequisite software, access, and tools must be installed on your machine.</p><ol><li><p>Visual Studio 2022 (extensions of AWS)</p></li><li><p>Dotnet SDK (<a href="https://dotnet.microsoft.com/en-us/download">https://dotnet.microsoft.com/en-us/download</a>)</p></li><li><p>AWS account with IAM-user created</p></li><li><p>AWS CLI (<a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html</a>)</p></li></ol><p>Create the user on AWS in order to access the resources :</p><p>Under the Users section create a new User :</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dVPq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dVPq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 424w, https://substackcdn.com/image/fetch/$s_!dVPq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 848w, https://substackcdn.com/image/fetch/$s_!dVPq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 1272w, https://substackcdn.com/image/fetch/$s_!dVPq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dVPq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png" width="1400" height="589" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:589,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dVPq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 424w, https://substackcdn.com/image/fetch/$s_!dVPq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 848w, https://substackcdn.com/image/fetch/$s_!dVPq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 1272w, https://substackcdn.com/image/fetch/$s_!dVPq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3375f771-dd99-4993-949d-7c9ec44c5a79_1400x589.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B3RC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B3RC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 424w, https://substackcdn.com/image/fetch/$s_!B3RC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 848w, https://substackcdn.com/image/fetch/$s_!B3RC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 1272w, https://substackcdn.com/image/fetch/$s_!B3RC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B3RC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png" width="1400" height="553" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:553,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B3RC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 424w, https://substackcdn.com/image/fetch/$s_!B3RC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 848w, https://substackcdn.com/image/fetch/$s_!B3RC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 1272w, https://substackcdn.com/image/fetch/$s_!B3RC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76c1c0e1-e54c-45da-84ae-7c845e45c755_1400x553.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O8tH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O8tH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 424w, https://substackcdn.com/image/fetch/$s_!O8tH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 848w, https://substackcdn.com/image/fetch/$s_!O8tH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 1272w, https://substackcdn.com/image/fetch/$s_!O8tH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O8tH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png" width="1400" height="611" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de095644-935f-4c81-bdf6-edda79a13665_1400x611.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:611,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!O8tH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 424w, https://substackcdn.com/image/fetch/$s_!O8tH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 848w, https://substackcdn.com/image/fetch/$s_!O8tH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 1272w, https://substackcdn.com/image/fetch/$s_!O8tH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde095644-935f-4c81-bdf6-edda79a13665_1400x611.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>attach the administrator access click next and then create a user.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8nMN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8nMN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 424w, https://substackcdn.com/image/fetch/$s_!8nMN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 848w, https://substackcdn.com/image/fetch/$s_!8nMN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 1272w, https://substackcdn.com/image/fetch/$s_!8nMN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8nMN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png" width="1400" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8nMN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 424w, https://substackcdn.com/image/fetch/$s_!8nMN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 848w, https://substackcdn.com/image/fetch/$s_!8nMN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 1272w, https://substackcdn.com/image/fetch/$s_!8nMN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e9187-0f0c-4a7d-b255-4000fc31e369_1400x560.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>Create the access key for this newly created user, which is used for connection to an AWS account from the AWS CLI .</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b810!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b810!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 424w, https://substackcdn.com/image/fetch/$s_!b810!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 848w, https://substackcdn.com/image/fetch/$s_!b810!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 1272w, https://substackcdn.com/image/fetch/$s_!b810!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b810!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png" width="1400" height="548" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:548,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b810!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 424w, https://substackcdn.com/image/fetch/$s_!b810!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 848w, https://substackcdn.com/image/fetch/$s_!b810!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 1272w, https://substackcdn.com/image/fetch/$s_!b810!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2326bc08-b959-476f-bd5a-c6b88cd2d26f_1400x548.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>select the Command Line Interface in next window and then give the description tag .</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zugl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zugl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 424w, https://substackcdn.com/image/fetch/$s_!Zugl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 848w, https://substackcdn.com/image/fetch/$s_!Zugl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 1272w, https://substackcdn.com/image/fetch/$s_!Zugl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zugl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png" width="1400" height="403" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:403,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Zugl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 424w, https://substackcdn.com/image/fetch/$s_!Zugl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 848w, https://substackcdn.com/image/fetch/$s_!Zugl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 1272w, https://substackcdn.com/image/fetch/$s_!Zugl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b2297e6-594a-425a-8525-4476560d08e5_1400x403.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!znFn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!znFn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 424w, https://substackcdn.com/image/fetch/$s_!znFn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 848w, https://substackcdn.com/image/fetch/$s_!znFn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 1272w, https://substackcdn.com/image/fetch/$s_!znFn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!znFn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png" width="1400" height="593" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:593,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!znFn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 424w, https://substackcdn.com/image/fetch/$s_!znFn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 848w, https://substackcdn.com/image/fetch/$s_!znFn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 1272w, https://substackcdn.com/image/fetch/$s_!znFn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a30484f-a032-4905-a4f2-b58bdbc5feab_1400x593.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>After creating the Access key, save it somewhere safe or download the.csv file at the bottom. Remember that you will need this Access key and Id to access to your AWS account via CLI, as mentioned below.</p><div><hr></div><p>To verify the AWS CLI :</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BY-U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BY-U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 424w, https://substackcdn.com/image/fetch/$s_!BY-U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 848w, https://substackcdn.com/image/fetch/$s_!BY-U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 1272w, https://substackcdn.com/image/fetch/$s_!BY-U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BY-U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png" width="1116" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:1116,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!BY-U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 424w, https://substackcdn.com/image/fetch/$s_!BY-U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 848w, https://substackcdn.com/image/fetch/$s_!BY-U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 1272w, https://substackcdn.com/image/fetch/$s_!BY-U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9579ae0b-2aee-46dc-b42a-025ac3923cb9_1116x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Now connect to your AWS account using AWS CLI tool:</p><pre><code>aws configure --profile profileName 
aws configure list-profiles  // to verify the profile crated </code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J2PZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J2PZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 424w, https://substackcdn.com/image/fetch/$s_!J2PZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 848w, https://substackcdn.com/image/fetch/$s_!J2PZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 1272w, https://substackcdn.com/image/fetch/$s_!J2PZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J2PZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png" width="1126" height="658" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:658,&quot;width&quot;:1126,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!J2PZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 424w, https://substackcdn.com/image/fetch/$s_!J2PZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 848w, https://substackcdn.com/image/fetch/$s_!J2PZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 1272w, https://substackcdn.com/image/fetch/$s_!J2PZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e112d55-9b2e-4953-8ecb-7aa314969586_1126x658.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After connecting, validate the profile and install AWS templates and lambda tools using the dotnet command (requires dotnetSDK). The following are the commands.</p><pre><code>dotnet tool install -g Amazon.Lambda.Tools
dotnet new install Amazon.Lambda.Templates</code></pre><p>Now create the function and deploy to AWS using below commands :</p><pre><code>dotnet new lambda.EmptyFunction --name functionName
dotnet lambda function-deploy  functionName</code></pre><p>While deploying the function to AWS , it will ask for roles, so create one and give access to newly created roles: This role is needed because the function needs access to connect to logs or any other resources like dynamodb.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tovm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tovm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 424w, https://substackcdn.com/image/fetch/$s_!tovm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 848w, https://substackcdn.com/image/fetch/$s_!tovm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 1272w, https://substackcdn.com/image/fetch/$s_!tovm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tovm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png" width="1400" height="589" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:589,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tovm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 424w, https://substackcdn.com/image/fetch/$s_!tovm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 848w, https://substackcdn.com/image/fetch/$s_!tovm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 1272w, https://substackcdn.com/image/fetch/$s_!tovm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4558092-4da6-40bb-8a93-d6ab79ce926a_1400x589.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Once the function deployment is successful , you can see the newly created function under the Lamda AWS , like below :</p><p>In the newly Created function : aws-lambda-tools-defaults.json is important where all the necessary details of the function are configured, entry point of the function is :<strong>FunctionHandler</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Nkz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Nkz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 424w, https://substackcdn.com/image/fetch/$s_!3Nkz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 848w, https://substackcdn.com/image/fetch/$s_!3Nkz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 1272w, https://substackcdn.com/image/fetch/$s_!3Nkz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Nkz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png" width="1400" height="472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dab75002-319b-41bd-9e73-5234d0235e79_1400x472.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:472,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3Nkz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 424w, https://substackcdn.com/image/fetch/$s_!3Nkz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 848w, https://substackcdn.com/image/fetch/$s_!3Nkz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 1272w, https://substackcdn.com/image/fetch/$s_!3Nkz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab75002-319b-41bd-9e73-5234d0235e79_1400x472.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RjRc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RjRc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 424w, https://substackcdn.com/image/fetch/$s_!RjRc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 848w, https://substackcdn.com/image/fetch/$s_!RjRc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 1272w, https://substackcdn.com/image/fetch/$s_!RjRc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RjRc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png" width="1400" height="534" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:534,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RjRc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 424w, https://substackcdn.com/image/fetch/$s_!RjRc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 848w, https://substackcdn.com/image/fetch/$s_!RjRc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 1272w, https://substackcdn.com/image/fetch/$s_!RjRc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae4aac19-c364-42ad-a911-dfb4978afe17_1400x534.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Run the function app from the AWS console, like below : Give the input string, which is converted to uppercase.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aUrj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aUrj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 424w, https://substackcdn.com/image/fetch/$s_!aUrj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 848w, https://substackcdn.com/image/fetch/$s_!aUrj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 1272w, https://substackcdn.com/image/fetch/$s_!aUrj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aUrj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png" width="1400" height="445" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:445,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!aUrj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 424w, https://substackcdn.com/image/fetch/$s_!aUrj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 848w, https://substackcdn.com/image/fetch/$s_!aUrj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 1272w, https://substackcdn.com/image/fetch/$s_!aUrj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3da3ca49-f465-4d49-b64f-bc346ee26a74_1400x445.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FPHg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FPHg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 424w, https://substackcdn.com/image/fetch/$s_!FPHg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 848w, https://substackcdn.com/image/fetch/$s_!FPHg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 1272w, https://substackcdn.com/image/fetch/$s_!FPHg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FPHg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png" width="1400" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!FPHg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 424w, https://substackcdn.com/image/fetch/$s_!FPHg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 848w, https://substackcdn.com/image/fetch/$s_!FPHg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 1272w, https://substackcdn.com/image/fetch/$s_!FPHg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe63f9841-7bf0-405e-bcef-2d5e1662036d_1400x572.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CAlM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CAlM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 424w, https://substackcdn.com/image/fetch/$s_!CAlM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 848w, https://substackcdn.com/image/fetch/$s_!CAlM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 1272w, https://substackcdn.com/image/fetch/$s_!CAlM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CAlM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png" width="1400" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!CAlM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 424w, https://substackcdn.com/image/fetch/$s_!CAlM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 848w, https://substackcdn.com/image/fetch/$s_!CAlM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 1272w, https://substackcdn.com/image/fetch/$s_!CAlM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39a4c88-8b6c-4ca6-9ac0-7978e4b4cf24_1400x573.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>To check the logs go to CloudWatch like shown in above image.</p><p>In this blog post, we explored how to implement and understand AWS Lambda using .NET as the backend language. We discussed the benefits of using Lambda for serverless computing and provided a step-by-step guide to creating and deploying a Lambda function.</p><p>By following these steps,.NET developers can leverage the power of AWS Lambda to build scalable, cost-effective, and flexible applications in the cloud. Whether you&#8217;re building APIs, processing data, or handling backend logic, AWS Lambda with .NET opens up a world of possibilities for your next project.</p><p>So, if you&#8217;re ready to dive into serverless computing and explore the endless opportunities it offers, start experimenting with AWS Lambda and .NET today!</p><p>In a future post, I&#8217;ll try to describe how the API Gateway authenticates to the Lambda function; keep tuned.</p><p>Happy Learning.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.dotnetcircuit.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dileep&#8217;s Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[CRUD Operations in .Net Core API ]]></title><description><![CDATA[Certainly! CRUD operations refer to the basic actions that can be performed on a database or an API resource.]]></description><link>https://newsletter.dotnetcircuit.com/p/crud-operations-in-net-core-api</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/crud-operations-in-net-core-api</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Fri, 10 Nov 2023 17:03:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!N3av!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d161165-a9fa-40f8-9c76-0aa8187e9cc3_648x658.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SkIE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SkIE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 424w, https://substackcdn.com/image/fetch/$s_!SkIE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 848w, https://substackcdn.com/image/fetch/$s_!SkIE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 1272w, https://substackcdn.com/image/fetch/$s_!SkIE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SkIE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png" width="700" height="258" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:258,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SkIE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 424w, https://substackcdn.com/image/fetch/$s_!SkIE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 848w, https://substackcdn.com/image/fetch/$s_!SkIE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 1272w, https://substackcdn.com/image/fetch/$s_!SkIE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3d406d8-d466-4ba7-a157-5fc4697f484f_700x258.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p>
      <p>
          <a href="https://newsletter.dotnetcircuit.com/p/crud-operations-in-net-core-api">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Configuration Settings in.Net core ]]></title><description><![CDATA[In the world of software development, managing configuration settings is a critical aspect of building robust and scalable applications.]]></description><link>https://newsletter.dotnetcircuit.com/p/configuration-settings-innet-core</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/configuration-settings-innet-core</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Wed, 18 Oct 2023 13:29:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fwl1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fwl1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fwl1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 424w, https://substackcdn.com/image/fetch/$s_!fwl1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 848w, https://substackcdn.com/image/fetch/$s_!fwl1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 1272w, https://substackcdn.com/image/fetch/$s_!fwl1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fwl1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png" width="883" height="463" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:463,&quot;width&quot;:883,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52936,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fwl1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 424w, https://substackcdn.com/image/fetch/$s_!fwl1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 848w, https://substackcdn.com/image/fetch/$s_!fwl1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 1272w, https://substackcdn.com/image/fetch/$s_!fwl1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37de2380-1c3d-418d-9744-77b0d838bc57_883x463.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>The .NET Core framework provides powerful tools and mechanisms to handle various configuration settings, making it easier for developers to securely store sensitive and non-sensitive information. In this blog post, we will delve into the concept of configuration settings in .NET Core, explore the mechanisms and patterns used for this purpose, and guide you on the path to becoming a configuration settings maestro.</p><p>Before we dive into the intricacies of configuration settings, let&#8217;s understand why they are essential. Configuration settings are the parameters and values that dictate how your application behaves. They encompass a wide range of information, from database connection strings and API keys to application-specific settings like the number of threads for parallel processing or feature flags. The ability to adjust these settings without changing the code allows for flexibility, scalability, and enhanced security.</p><p>In a .NET Core application, configuration settings can be used to control application behavior, manage external service integrations, and store sensitive data such as connection strings, secrets, and authentication tokens. But how do you effectively manage and access these settings? That&#8217;s where the magic of .NET Core&#8217;s configuration system comes into play.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b9Zb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b9Zb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 424w, https://substackcdn.com/image/fetch/$s_!b9Zb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 848w, https://substackcdn.com/image/fetch/$s_!b9Zb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 1272w, https://substackcdn.com/image/fetch/$s_!b9Zb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b9Zb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png" width="700" height="232" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:232,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b9Zb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 424w, https://substackcdn.com/image/fetch/$s_!b9Zb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 848w, https://substackcdn.com/image/fetch/$s_!b9Zb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 1272w, https://substackcdn.com/image/fetch/$s_!b9Zb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ed2ad8-4d0c-4768-8124-6964f2272fd1_700x232.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p><strong>ways to get the Key-Value pairs</strong> in the c# code:</p><p>Using the app.configuration() method we can get the key values in the program.cs file like</p><pre><code>app.UseEndpoints(endpoints =&gt; {

  endpoints.Map("/", async context =&gt;
  {
  
  await context.Response.WriteAsync(app.Configuration.GetValue&lt;string&gt;("Key") + "\n");

});

});</code></pre><div><hr></div><p>By using Iconfiguration inside the controller :</p><pre><code>public class HomeController : Controller
  {
    //private field
    private readonly IConfiguration _configuration;

    //constructor
    public HomeController(IConfiguration configuration)
    {
      _configuration = configuration;
    }

    [Route("/")]
    public IActionResult Index()
    {
//Hierarchical Configuration
//var getConnection= _configuration.GetSection("DBConnection");
//getConnection["ConnectionString"]
      ViewBag.MyKey = _configuration["Key"];
      ViewBag.MyAPIKey = _configuration.GetValue("APIKey", "the default key");

      return View();
    }
  }</code></pre><div><hr></div><p>Using the <strong>options pattern</strong>, we can tie the JSON setting to the class model: Assume we have an API client ID and client secret in the appsettings.These values are bound to a class in the JSON file and then used as follows:</p><p><strong>Options pattern (strongly typed)</strong>uses custom classes to specify what configuration settings are to be loaded into properties.</p><pre><code>//appsetting.json
{
"apiValues":
{
  "ClientID": "",
  "ClientSecret":""
}
}



public class ApiOptions
  {
    public string? ClientID { get; set; }
    public string? ClientSecret { get; set; }
  }

// inside the action method 
 [Route("/")]
    public IActionResult Index()
    {
      
      ApiOptions options = new ApiOptions();
      _configuration.GetSection("apiValues").Bind(options);

      ViewBag.ClientID = options.ClientID;
      ViewBag.ClientSecret = options.ClientSecret;

      return View();
    }</code></pre><div><hr></div><p><strong>Configuration as a service</strong> &#8212; instead of getting the values every time in each controller we can use the configuration as a service which is injected into any controller to get the key value fields :</p><pre><code>//add this in program.cs file 
builder.Services.Configure&lt;ApiOptions&gt;(builder.Configuration.GetSection("apiValues"));

//in controller class
 public class HomeController : Controller
  {
    //private field
    private readonly ApiOptions _options;

    //constructor
    public HomeController(IOptions&lt;ApiOptions&gt; apiOptions)
    {
      _options = apiOptions.Value;
    }

    [Route("/")]
    public IActionResult Index()
    {
      ViewBag.ClientID = _options.ClientID;
      ViewBag.ClientSecret = _options.ClientSecret;

      return View();
    }
  }</code></pre><div><hr></div><h2><strong>Environment Specific Configuration</strong></h2><p>Order of Precedence of Configuration Sources</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!czpg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!czpg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 424w, https://substackcdn.com/image/fetch/$s_!czpg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 848w, https://substackcdn.com/image/fetch/$s_!czpg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 1272w, https://substackcdn.com/image/fetch/$s_!czpg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!czpg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png" width="561" height="260" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5650491-93c8-4bf3-b41d-214559666e98_561x260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:561,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!czpg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 424w, https://substackcdn.com/image/fetch/$s_!czpg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 848w, https://substackcdn.com/image/fetch/$s_!czpg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 1272w, https://substackcdn.com/image/fetch/$s_!czpg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5650491-93c8-4bf3-b41d-214559666e98_561x260.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>First, the key-value pairs in the appsettings.json are checked, If they are found, they are returned; if they are not found, they are searched in the following section, appsettingsEnvironment.json file. This environment will be located in the launchsettings.json file under the properties folder, the Precedence will function similarly to the values found in the most recent settings they are only fetched.</p><h1><strong>User Secrets</strong></h1><p>User secrets are a convenient way to store development-specific settings that should not be included in version control. You can use the <code>dotnet user-secrets</code> command to manage these secrets at the user level. For example, you can store a database connection string as a user secret:</p><p>If you want to store the keys that are outside the source control the user-secrets is the best place to configure it, the user-secrets are stored on the developer machine, and the secret key is created for this configuration.</p><p>Run the command: dotnet user-secret init</p><p>you can see the &lt;UserSecretId&gt; per developer machine is created, in order to add the new keys inside this secrets.json :</p><p>cmd: dotnet user-secrets set &#8220;FirstKey&#8221; &#8220;FirstValue&#8221;</p><p>To view the newly added secret keys right-click on the project and goto Manage secrets then the secrets.json file will be opened :</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ff18!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ff18!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 424w, https://substackcdn.com/image/fetch/$s_!ff18!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 848w, https://substackcdn.com/image/fetch/$s_!ff18!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 1272w, https://substackcdn.com/image/fetch/$s_!ff18!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ff18!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png" width="700" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ff18!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 424w, https://substackcdn.com/image/fetch/$s_!ff18!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 848w, https://substackcdn.com/image/fetch/$s_!ff18!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 1272w, https://substackcdn.com/image/fetch/$s_!ff18!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c20948a-69ec-4bcf-98c3-fe5d029702b8_700x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jyJk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jyJk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 424w, https://substackcdn.com/image/fetch/$s_!jyJk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 848w, https://substackcdn.com/image/fetch/$s_!jyJk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 1272w, https://substackcdn.com/image/fetch/$s_!jyJk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jyJk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png" width="700" height="226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39204c04-9712-40f3-9f28-50c93b75af93_700x226.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:226,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jyJk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 424w, https://substackcdn.com/image/fetch/$s_!jyJk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 848w, https://substackcdn.com/image/fetch/$s_!jyJk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 1272w, https://substackcdn.com/image/fetch/$s_!jyJk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39204c04-9712-40f3-9f28-50c93b75af93_700x226.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h1><strong>Environment Variables</strong></h1><p>Environment variables are an excellent choice for storing sensitive information because they can be securely managed at the system level. .NET Core allows you to load environment variables directly into your configuration: In the prod environment we don&#8217;t get any visual studio there to configure the values only the Terminal will be available, we can set configuration values as in-process environment variables.</p><pre><code>$Env:ParentKey__ChildKey="value"
dotnet run --no-launch-profile

//__ (underscore and underscore) is the separator between parent key and child key.</code></pre><div><hr></div><h2><strong>Custom Json Configuration</strong></h2><p>We can also add custom JSON files to contain the key-value pairs; this was utilized in large-scale projects where a lot of configuration needed to be preserved; in this idea, the custom JSON file is bonded to the model class.</p><pre><code>builder.Host.ConfigureAppConfiguration( (hostingContext, config) =&gt; {
    config.AddJsonFile("filename.json", optional: true, reloadOnChange: true);
});</code></pre><div><hr></div><h2><strong>Azure Key Vault</strong></h2><p>When working with sensitive data in a secure way, Azure Key Vault is a popular choice. .NET Core provides an Azure Key Vault configuration provider, allowing you to fetch secrets and configuration settings from Azure Key Vault securely. This is ideal for managing production secrets and certificates.</p><pre><code>var azureKeyVaultEndpoint = "https://your-key-vault.vault.azure.net/";
var configuration = new ConfigurationBuilder()
    .AddAzureKeyVault(azureKeyVaultEndpoint)
    .Build();</code></pre><div><hr></div><p>Configuring your .NET Core application effectively is a crucial aspect of software development. With the powerful configuration system provided by .NET Core, you can easily manage settings, both sensitive and non-sensitive, to build robust and flexible applications. By following best practices and patterns, such as strongly typed configuration and secrets management, you can ensure your application is secure and scalable.</p><p>In a world where data security is paramount, .NET Core&#8217;s configuration management capabilities empower developers to navigate the complexities of sensitive information confidently. Whether you&#8217;re safeguarding API keys, managing database connections, or fine-tuning application behavior, a deep understanding of .NET Core&#8217;s configuration settings will undoubtedly set you on the path to success.</p><p>So, the next time you embark on a.NET Core project, remember that configuration settings are more than just variables; they are the cornerstone that assures your application&#8217;s integrity and resilience in the face of changing problems. Accept the power of configuration management and watch your .NET Core projects fly to new heights of efficiency and security. Happy coding!</p><p><strong>&#127760; Connect with Me:</strong></p><p>&#128279; <strong>Medium:</strong> https://medium.com/@dileepsreepathi<br>&#128279; <strong>LinkedIn:</strong> https://www.linkedin.com/in/dileep-sreepathi/<br></p><div class="embedded-publication-wrap" data-attrs="{&quot;id&quot;:2018953,&quot;name&quot;:&quot;Dileep&#8217;s Substack&quot;,&quot;logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b6cb749-3656-455a-a6aa-34cd4e6d9530_500x500.png&quot;,&quot;base_url&quot;:&quot;https://dileepsreepathi.substack.com&quot;,&quot;hero_text&quot;:&quot;I'm thrilled to have you here, and I'm excited to embark on this journey of exploration and learning together. In this space, I plan to share my thoughts, insights, and experiences on a wide range of topics in the field of Computer Science and Engineering&quot;,&quot;author_name&quot;:&quot;Dileep&quot;,&quot;show_subscribe&quot;:true,&quot;logo_bg_color&quot;:null,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPublicationToDOMWithSubscribe"><div class="embedded-publication show-subscribe"><a class="embedded-publication-link-part" native="true" href="https://dileepsreepathi.substack.com?utm_source=substack&amp;utm_campaign=publication_embed&amp;utm_medium=web"><img class="embedded-publication-logo" src="https://substackcdn.com/image/fetch/$s_!evmZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b6cb749-3656-455a-a6aa-34cd4e6d9530_500x500.png" width="56" height="56"><span class="embedded-publication-name">Dileep&#8217;s Substack</span><div class="embedded-publication-hero-text">I'm thrilled to have you here, and I'm excited to embark on this journey of exploration and learning together. In this space, I plan to share my thoughts, insights, and experiences on a wide range of topics in the field of Computer Science and Engineering</div></a><form class="embedded-publication-subscribe" method="GET" action="https://dileepsreepathi.substack.com/subscribe?"><input type="hidden" name="source" value="publication-embed"><input type="hidden" name="autoSubmit" value="true"><input type="email" class="email-input" name="email" placeholder="Type your email..."><input type="submit" class="button primary" value="Subscribe"></form></div></div>]]></content:encoded></item><item><title><![CDATA[Repository Pattern Implementation in .Net Core ]]></title><description><![CDATA[In the vibrant world of web development, where RESTful APIs reign supreme, mastering the art of organizing your code is crucial.]]></description><link>https://newsletter.dotnetcircuit.com/p/repository-pattern-implementation</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/repository-pattern-implementation</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Sun, 15 Oct 2023 08:33:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vyI!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2faf3749-a3b6-45d1-9990-28c2323f0e57_512x512.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As aspiring developers, we often find ourselves entangled in the complexities of handling business logic within our applications. Fear not, for there exists a design pattern that not only simplifies this process but also enhances the maintainability and flexibility of your codebase: the Repository Pattern.</p>
      <p>
          <a href="https://newsletter.dotnetcircuit.com/p/repository-pattern-implementation">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Data Consistency]]></title><description><![CDATA[Data consistency in the realm of system design.]]></description><link>https://newsletter.dotnetcircuit.com/p/data-consistency</link><guid isPermaLink="false">https://newsletter.dotnetcircuit.com/p/data-consistency</guid><dc:creator><![CDATA[Dileep]]></dc:creator><pubDate>Tue, 10 Oct 2023 17:22:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nLJo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nLJo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nLJo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 424w, https://substackcdn.com/image/fetch/$s_!nLJo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 848w, https://substackcdn.com/image/fetch/$s_!nLJo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 1272w, https://substackcdn.com/image/fetch/$s_!nLJo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nLJo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp" width="900" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7204,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nLJo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 424w, https://substackcdn.com/image/fetch/$s_!nLJo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 848w, https://substackcdn.com/image/fetch/$s_!nLJo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 1272w, https://substackcdn.com/image/fetch/$s_!nLJo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6686f00-71a4-4819-a2d0-ae04f6771af0_900x600.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Data consistency is one of the most important considerations in the system design process for large-scale distributed systems. It ensures that all users see the same data at the same time, even as updates and modifications are being made.</p><p>In this blog post, we will delve into the complexities of data consistency, exploring its implementation, understanding its nuances, and discussing the various types of data consistency. By the end of this journey, you will not only comprehend the intricacies of this critical concept but also appreciate its role in enhancing the efficiency of accessing data from databases in large-scale distributed systems.</p><p></p><p><strong>Understanding Data Consistency: A Foundation of System Design</strong></p><p>At its core, data consistency refers to the uniformity of data across all nodes in a distributed system. In simpler terms, it ensures that when multiple users access the system simultaneously, they all see the same set of data. Achieving data consistency is challenging, especially in large-scale distributed systems where data is spread across multiple servers, often in different geographical locations.</p><p>There are two main types of data consistency: <strong>strong consistency</strong> and <strong>eventual consistency</strong>. Strong consistency guarantees that all replicas of data are always up-to-date. Eventual consistency allows for temporary inconsistencies but guarantees that all replicas will eventually converge to the same view.</p><p>Implementing data consistency involves striking a delicate balance between performance and reliability. Several strategies can be employed, each with its own set of advantages and drawbacks.</p><p><strong>1. Strong Consistency: The Gold Standard</strong></p><p>Strong consistency guarantees that once a piece of data is updated, all subsequent accesses to that data will return the updated value. While this approach ensures data accuracy, it can impact performance due to the need for synchronization among distributed nodes. However, for applications where data accuracy is non-negotiable, strong consistency remains the gold standard.</p><ul><li><p><em>Pros:</em> Ensures data accuracy, and simplifies application logic.</p></li><li><p><em>Cons:</em> This may lead to latency issues, especially in geographically dispersed systems, and increased complexity in implementation.</p></li></ul><p><strong>2. Eventual Consistency: Embracing the Asynchronous Nature</strong></p><p>Eventual consistency, on the other hand, acknowledges that in a distributed system, it takes time for all nodes to receive updates. With eventual consistency, all nodes will converge to the same state given enough time, even if some temporary inconsistencies are observed. This approach prioritizes system availability and partition tolerance, making it suitable for systems where real-time consistency is not critical.</p><ul><li><p><em>Pros:</em> Enhances system availability, improved performance, easier to implement.</p></li><li><p><em>Cons:</em> Temporary inconsistencies can confuse users, and complex conflict resolution mechanisms are required.</p></li></ul><p></p><p>The choice of data consistency model depends on the specific requirements of the system. For example, systems that require high availability may be willing to sacrifice strong consistency for better performance and scalability. On the other hand, systems that require high data integrity may need to use strong consistency, even if it comes at a cost in terms of performance.</p><p><strong>Implementing Data Consistency</strong></p><p>There are a number of different techniques that can be used to implement data consistency in distributed systems. Some of the most common techniques include:</p><ul><li><p><strong>Distributed transactions:</strong> Distributed transactions allow multiple database operations to be executed as a single unit, ensuring that all or none of the operations succeed. This can be used to implement strong consistency.</p></li><li><p><strong>Replication:</strong> Replication involves creating multiple copies of data and storing them on different servers. This can be used to improve availability and performance, but it can also make it more difficult to maintain data consistency.</p></li><li><p><strong>Versioning:</strong> Versioning allows multiple versions of the same data to be stored at the same time. This can be used to implement eventual consistency.</p></li><li><p><strong>Conflict resolution:</strong> Conflict resolution algorithms are used to resolve conflicts between different versions of data. This is important for systems that use eventual consistency.</p></li></ul><p><strong>Choosing the Right Data Consistency Model</strong></p><p>The choice of data consistency model depends on the specific requirements of the system. Some factors to consider include:</p><ul><li><p><strong>Availability:</strong> How important is it for the system to be available even if there are inconsistencies in the data?</p></li><li><p><strong>Performance:</strong> How important is it for the system to be performant, even if it comes at the cost of some data consistency?</p></li><li><p><strong>Integrity:</strong> How important is it for the data to be always consistent?</p></li></ul><p><strong>Examples of Data Consistency in Practice</strong></p><p>Here are some examples of how data consistency is used in practice:</p><ul><li><p><strong>Financial systems:</strong> Financial systems require high data integrity. Therefore, they typically use strong consistency models, even if it comes at a cost in terms of performance.</p></li><li><p><strong>Social media systems:</strong> Social media systems require high availability and performance. Therefore, they may be willing to sacrifice strong consistency for better performance and scalability.</p></li><li><p><strong>E-commerce systems:</strong> E-commerce systems need to be both available and reliable. They typically use eventual consistency models, with conflict resolution algorithms to ensure that data is eventually consistent.</p></li></ul><p></p><p><strong>Which Data Consistency Type Should You Choose?</strong></p><p>The choice of data consistency type depends on the specific requirements of the system. If data consistency is critical, then you may need to use strong consistency, even if it comes at a cost in terms of performance and scalability. However, if availability and performance are more important, then you may be able to get away with using eventual consistency.</p><p><strong>How to Implement Data Consistency Efficiently</strong></p><p>There are a number of things you can do to implement data consistency efficiently:</p><ul><li><p><strong>Use the right data consistency model:</strong> Choose the data consistency model that is most appropriate for your system's requirements.</p></li><li><p><strong>Use the right data structures:</strong> Choose data structures that are designed for data consistency. For example, you can use a distributed hash table (DHT) to store replicated data in a consistent way.</p></li><li><p><strong>Use caching:</strong> Caching can be used to improve performance and reduce the number of database</p></li></ul><p>In the intricate landscape of large-scale distributed systems, achieving data consistency is akin to mastering a delicate dance between accuracy and efficiency. As architects of these systems, it is imperative to choose the right consistency model that aligns with the application's requirements. Understanding the nuances of strong, eventual, and causal consistency empowers designers to make informed decisions, ensuring that the system operates seamlessly even in the face of network partitions and high user loads.</p><p>In closing, the journey toward data consistency in system design is not without its challenges, but it is a journey well worth undertaking. By embracing the complexities and nuances of various consistency models, architects and developers can pave the way for efficient data access, creating robust and reliable systems that stand the test of time. Remember, in the world of large-scale distributed systems, data consistency isn't just a goal; it's the foundation upon which innovation and reliability thrive.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.dotnetcircuit.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dileep&#8217;s Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>