<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Abhith Rajan — everything</title><description>Abhith Rajan is a Dubai-based full-stack software engineer — .NET, TypeScript and Azure — shipping since 2012. Notes, snippets and curated links on building and running software.</description><link>https://www.abhith.net/</link><language>en</language><image><url>https://www.abhith.net/img/site/brand/icon.png</url><title>Abhith Rajan — everything</title><link>https://www.abhith.net</link></image><item><title>Cost Optimization: Auto Shutdown and Startup of Tagged VMs with Azure Automation</title><link>https://www.abhith.net/blog/cost-optimization-auto-shutdown-and-startup-of-tagged-vms-with-azure-automation/</link><guid isPermaLink="true">https://www.abhith.net/blog/cost-optimization-auto-shutdown-and-startup-of-tagged-vms-with-azure-automation/</guid><description>Unlock cost savings in Azure environments through automated VM shutdown and startup. Implement Azure Automation to optimize resource management and cut unnecessary expenses</description><pubDate>Tue, 30 May 2023 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;In today’s cloud computing era, optimizing costs has become crucial for effective resource management. One area where organizations can achieve significant cost savings is by automating the shutdown and startup processes of virtual machines (VMs) in their test environments. Microsoft Azure offers various solutions to help accomplish this goal, and one powerful approach is through Azure Automation.&lt;/p&gt;
&lt;h2 id=&quot;the-significance-of-cost-optimization&quot;&gt;The Significance of Cost Optimization&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#the-significance-of-cost-optimization&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Test environments play a vital role in software development and testing processes. However, these environments often remain idle during non-working hours, such as nights and weekends. Continuously running VMs during these periods can lead to unnecessary expenses. By implementing an automated solution that shuts down and starts up VMs based on predefined schedules, organizations can save a substantial amount of money.&lt;/p&gt;
&lt;h2 id=&quot;azure-automation-streamlining-cost-optimization&quot;&gt;Azure Automation: Streamlining Cost Optimization&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#azure-automation-streamlining-cost-optimization&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Azure Automation is a cloud-based service that enables you to automate the management of your Azure resources. It offers a wide range of capabilities for process automation, configuration management, and update management. Through the use of &lt;strong&gt;Runbooks&lt;/strong&gt;, you can schedule the shutdown and startup of VMs based on specific criteria, optimizing costs in test environments.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/runbooks.ARq5CSLg_Z151O3o.webp&quot; alt=&quot;Runbooks&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1253&quot; height=&quot;463&quot;&gt;&lt;figcaption&gt;Runbooks&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;implementing-vm-shutdown-with-azure-automation&quot;&gt;Implementing VM Shutdown with Azure Automation&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#implementing-vm-shutdown-with-azure-automation&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/stop.CAw0oehR_1yerXb.webp&quot; alt=&quot;Stop VM Runbook&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1863&quot; height=&quot;800&quot;&gt;&lt;figcaption&gt;Stop VM Runbook&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;To implement the VM shutdown process, you can utilize PowerShell scripts within an Azure Automation runbook. The following code snippet illustrates how to shut down VMs during weekdays (Monday to Friday) from 10 PM to 6 AM:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Get the current time in the time zone of your choice&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;TimeZone&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;System.TimeZoneInfo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]::FindSystemTimeZoneById(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Arabian Standard Time&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;System.TimeZoneInfo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]::ConvertTimeFromUtc([&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]::UtcNow&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;TimeZone&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Connect to Azure Account using Managed Identity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Conn&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;Connect-AzAccount&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Identity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Weekday Shutdown (Mon-Fri, 10pm-6am)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; ((&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.DayOfWeek&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-ge&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Monday&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.DayOfWeek&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-le&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Friday&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;HH:mm&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-ge&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;22:00&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-or&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;HH:mm&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-lt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;06:00&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VMs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;Get-AzResource&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Tag &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{ &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Availability&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Available 6am-10pm Mon-Fri, Unavailable 10pm-6am Mon-Fri and all day Sat-Sun&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;ResourceType &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Microsoft.Compute/virtualMachines&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VMs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;Stop-AzVM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;ResourceGroupName &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VM.ResourceGroupName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Name &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VM.Name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Force&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;$TimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById(&amp;quot;Arabian Standard Time&amp;quot;)$ScheduledTime = [System.TimeZoneInfo]::ConvertTimeFromUtc([DateTime]::UtcNow, $TimeZone)$Conn = Connect-AzAccount -Identityif (($ScheduledTime.DayOfWeek -ge &amp;quot;Monday&amp;quot;) -and ($ScheduledTime.DayOfWeek -le &amp;quot;Friday&amp;quot;) -and ($ScheduledTime.ToString(&amp;quot;HH:mm&amp;quot;) -ge &amp;quot;22:00&amp;quot;) -or ($ScheduledTime.ToString(&amp;quot;HH:mm&amp;quot;) -lt &amp;quot;06:00&amp;quot;)) {   $VMs = Get-AzResource -Tag @{ Availability = &amp;quot;Available 6am-10pm Mon-Fri, Unavailable 10pm-6am Mon-Fri and all day Sat-Sun&amp;quot; } -ResourceType &amp;quot;Microsoft.Compute/virtualMachines&amp;quot;   foreach ($VM in $VMs) {       Stop-AzVM -ResourceGroupName $VM.ResourceGroupName -Name $VM.Name -Force   }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This code snippet retrieves the current time in the specified time zone, connects to your Azure account using Managed Identity, and identifies the VMs based on a specified tag “Availability = Available 6am-10pm Mon-Fri, Unavailable 10pm-6am Mon-Fri and all day Sat-Sun”. It checks if the current time falls within the desired shutdown window and proceeds to stop each VM using the Stop-AzVM command.&lt;/p&gt;
&lt;p&gt;Schedule for VM Shutdown:&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/stop-schedule.rbw22E3p_Z12PDbs.webp&quot; alt=&quot;Stop VM Schedule&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1863&quot; height=&quot;849&quot;&gt;&lt;figcaption&gt;Stop VM Schedule&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;implementing-vm-startup-with-azure-automation&quot;&gt;Implementing VM Startup with Azure Automation&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#implementing-vm-startup-with-azure-automation&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Similarly, you can implement the VM startup process using another PowerShell script within a separate Azure Automation runbook. The script can be scheduled to run during working hours or any other predefined schedule. The code snippet below demonstrates how to start VMs during weekdays:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Get the current time in the time zone of your choice&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;TimeZone&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;System.TimeZoneInfo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]::FindSystemTimeZoneById(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Arabian Standard Time&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;System.TimeZoneInfo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]::ConvertTimeFromUtc([&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]::UtcNow&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;TimeZone&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Connect to Azure Account using Managed Identity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Conn&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;Connect-AzAccount&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Identity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Weekday Start (Mon-Fri, 6am-10pm)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; ((&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.DayOfWeek&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-ge&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Monday&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.DayOfWeek&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-le&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Friday&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;HH:mm&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-ge&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;06:00&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ScheduledTime.ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;HH:mm&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-lt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;22:00&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VMs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;Get-AzResource&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Tag &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{ &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Availability&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Available 6am-10pm Mon-Fri, Unavailable 10pm-6am Mon-Fri and all day Sat-Sun&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;ResourceType &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Microsoft.Compute/virtualMachines&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VMs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;Start-AzVM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;ResourceGroupName &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VM.ResourceGroupName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Name &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;VM.Name&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;$TimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById(&amp;quot;Arabian Standard Time&amp;quot;)$ScheduledTime = [System.TimeZoneInfo]::ConvertTimeFromUtc([DateTime]::UtcNow, $TimeZone)$Conn = Connect-AzAccount -Identityif (($ScheduledTime.DayOfWeek -ge &amp;quot;Monday&amp;quot;) -and ($ScheduledTime.DayOfWeek -le &amp;quot;Friday&amp;quot;) -and ($ScheduledTime.ToString(&amp;quot;HH:mm&amp;quot;) -ge &amp;quot;06:00&amp;quot;) -and ($ScheduledTime.ToString(&amp;quot;HH:mm&amp;quot;) -lt &amp;quot;22:00&amp;quot;)) {   $VMs = Get-AzResource -Tag @{ Availability = &amp;quot;Available 6am-10pm Mon-Fri, Unavailable 10pm-6am Mon-Fri and all day Sat-Sun&amp;quot; } -ResourceType &amp;quot;Microsoft.Compute/virtualMachines&amp;quot;   foreach ($VM in $VMs) {       Start-AzVM -ResourceGroupName $VM.ResourceGroupName -Name $VM.Name   }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The above code snippet retrieves the current time, connects to your Azure account using Managed Identity, and starts VMs based on the specified criteria. It identifies VMs tagged with “Availability = Available 6am-10pm Mon-Fri, Unavailable 10pm-6am Mon-Fri and all day Sat-Sun” and initiates the startup process using the Start-AzVM command.&lt;/p&gt;
&lt;p&gt;Schedule for VM Startup:&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/start-schedule.C-wIIEOF_Z2pIRc.webp&quot; alt=&quot;Start VM Schedule&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;588&quot; height=&quot;851&quot;&gt;&lt;figcaption&gt;Start VM Schedule&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;additional-considerations&quot;&gt;Additional Considerations&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-considerations&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When implementing Azure Automation for VM shutdown and startup, keep the following points in mind:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create an Azure Automation account to host your runbooks.&lt;/li&gt;
&lt;li&gt;Enable Managed Identity for Azure Automation to securely connect to your Azure resources.
 &lt;img src=&quot;https://www.abhith.net/_astro/identity.DAVztfwM_Z2uV2bK.webp&quot; alt=&quot;Managed identity enabled&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;732&quot; height=&quot;565&quot;&gt;&lt;/li&gt;
&lt;li&gt;Grant the necessary permissions to the Managed Identity. In this case, assigning the &lt;strong&gt;Virtual Machine Contributor&lt;/strong&gt; role at the resource group level is sufficient for performing the shutdown and startup actions.
 &lt;img src=&quot;https://www.abhith.net/_astro/role-assignments.DeATOAgU_Z1Yuq7u.webp&quot; alt=&quot;Role assignments&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1566&quot; height=&quot;358&quot;&gt;&lt;/li&gt;
&lt;li&gt;Ensure relevant VMs are appropriately tagged for efficient automation.
 &lt;img src=&quot;https://www.abhith.net/_astro/tagged-vm.CUlnjZ65_Z1wsPjB.webp&quot; alt=&quot;Tagged VM&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1345&quot; height=&quot;415&quot;&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By following these guidelines and leveraging Azure Automation, you can effectively optimize costs by automating the shutdown and startup of tagged VMs in your test environments. This approach ensures that VMs are active only when needed,thereby reducing unnecessary expenses. Additionally, it streamlines resource management and ensures that resources are available and ready for use during working hours.&lt;/p&gt;
&lt;p&gt;Moreover, Azure Automation provides flexibility in scheduling the shutdown and startup processes based on specific criteria. You can customize the schedules according to your organization’s requirements, taking into account factors such as different time zones or varying working hours across teams.&lt;/p&gt;
&lt;p&gt;Implementing VM shutdown and startup through Azure Automation offers several benefits:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cost savings&lt;/strong&gt;: By automatically shutting down VMs during non-working hours, organizations can significantly reduce costs associated with running idle resources. This optimization can lead to substantial savings over time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Resource availability&lt;/strong&gt;: VMs can be automatically started up before working hours, ensuring that the necessary resources are available when the team begins their tasks. This eliminates delays caused by manual startup processes and improves productivity.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Scalability and agility&lt;/strong&gt;: Azure Automation allows for easy scaling of the solution to accommodate changing needs. As your organization grows or experiences fluctuations in demand, you can adjust the automation processes accordingly, ensuring efficient resource utilization.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Centralized management&lt;/strong&gt;: Azure Automation provides a centralized platform for managing and monitoring the automated shutdown and startup processes. You can view and track the status of the runbooks, monitor resource utilization, and make adjustments as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compliance and security&lt;/strong&gt;: By leveraging Managed Identity and assigning the appropriate permissions, Azure Automation ensures secure access to Azure resources without the need for storing credentials within the automation scripts. This improves compliance with security best practices and reduces potential risks.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In conclusion, automating the shutdown and startup processes of tagged VMs using Azure Automation is a powerful solution for cost optimization and resource management in test environments. By implementing predefined schedules and leveraging the flexibility of Azure Automation, organizations can achieve significant cost savings, improve resource availability, and streamline operations.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Remember, cost optimization is an ongoing process, and regularly reviewing and adjusting your automation schedules based on changing requirements can further enhance your cost-saving efforts.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you have any questions or need clarification on any part of the post, feel free to leave a comment, and I’ll be glad to assist you.&lt;/p&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Discover the power of Azure Automation for cost optimization in Azure environments. Cut unnecessary expenses, optimize resource management, and efficiently manage tagged VMs with automated VM shutdown and startup. &lt;a href=&quot;https://t.co/bVUXhZ2cwT&quot;&gt;https://t.co/bVUXhZ2cwT&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/Azure?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#Azure&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/CostOptimization?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#CostOptimization&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/Automation?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#Automation&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1663511639147028480?ref_src=twsrc%5Etfw&quot;&gt;May 30, 2023&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>azure</category><author>Abhith Rajan</author></item><item><title>Decode JWT Token</title><link>https://www.abhith.net/snippets/javascript/decode-jwt-token/</link><guid isPermaLink="true">https://www.abhith.net/snippets/javascript/decode-jwt-token/</guid><description>Get JWT token payload using JavaScript Buffer</description><pubDate>Mon, 29 Aug 2022 09:26:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;method&quot;&gt;Method&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#method&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;decodeJwt&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70&quot;&gt;token&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;base64Payload&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;token&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;payloadBuffer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Buffer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;base64Payload&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;base64&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;JSON&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;payloadBuffer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;());&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;function decodeJwt(token) {  var base64Payload = token.split(&amp;quot;.&amp;quot;)[1];  var payloadBuffer = Buffer.from(base64Payload, &amp;quot;base64&amp;quot;);  return JSON.parse(payloadBuffer.toString());}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#usage&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;payload&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;decodeJwt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;payload&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;var payload = decodeJwt(  &amp;quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&amp;quot;);console.log(payload);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;</content:encoded><category>javascript</category><author>Abhith Rajan</author></item><item><title>Output Environment Variable</title><link>https://www.abhith.net/snippets/powershell/output-environment-variable/</link><guid isPermaLink="true">https://www.abhith.net/snippets/powershell/output-environment-variable/</guid><description>Print environment variable to the console in PowerShell</description><pubDate>Mon, 25 Jul 2022 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;If you want to print the value of an environment variable, you can use the &lt;code&gt;$env:variable_name&lt;/code&gt; syntax.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--2:#1D689E&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;env:&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;MY_VARIABLE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;$env:MY_VARIABLE&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;MY_VARIABLE&lt;/code&gt; with the name of the environment variable you want to print.&lt;/p&gt;</content:encoded><category>powershell</category><author>Abhith Rajan</author></item><item><title>Delete All Local/Remote Git Tags</title><link>https://www.abhith.net/snippets/git/delete-all-local-remote-git-tags/</link><guid isPermaLink="true">https://www.abhith.net/snippets/git/delete-all-local-remote-git-tags/</guid><description>Remove all git tags from your local/origin git repository.</description><pubDate>Thu, 02 Jun 2022 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;On rare occasions, you may want to remove all local and remote git tags from your repository. For that, you can follow the below &lt;a href=&quot;#recommended-steps&quot;&gt;Recommended Steps&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In short, first, we are replacing the local tags with the remote tags, then removing all remote tags with reference to the local tags, and finally, removing all local tags.&lt;/p&gt;
&lt;h2 id=&quot;recommended-steps&quot;&gt;Recommended Steps&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#recommended-steps&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;1-delete-all-local-tags&quot;&gt;1. Delete all local tags&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#1-delete-all-local-tags&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tag&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-d&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; $(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tag&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-l&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git tag -d $(git tag -l)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;2-fetch-all-remote-tags&quot;&gt;2. Fetch all remote tags&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2-fetch-all-remote-tags&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;fetch&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git fetch&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Retrieves all remote tags giving you a complete list of remote tags.&lt;/p&gt;
&lt;h3 id=&quot;3-delete-all-remote-tags&quot;&gt;3. Delete All remote tags&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#3-delete-all-remote-tags&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;origin&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--delete&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; $(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tag&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-l&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git push origin --delete $(git tag -l)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Deletes the remote tags with reference to the local list.&lt;/p&gt;
&lt;h3 id=&quot;4-delete-all-local-tags&quot;&gt;4. Delete All local tags&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#4-delete-all-local-tags&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tag&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-d&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; $(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tag&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-l&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git tag -d $(git tag -l)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Once again, deletes all local tags.&lt;/p&gt;
&lt;h2 id=&quot;unnecessary-details&quot;&gt;Unnecessary Details&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#unnecessary-details&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the rare occasions to delete all tags in my case was, that we were maintaining a monorepo in Azure DevOps, and wanted to migrate it to GitHub, but in a &lt;strong&gt;repo per component&lt;/strong&gt; manner. So,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First I did import the monorepo by following 👉 &lt;a href=&quot;https://www.abhith.net/blog/github-vs-azure-devops-for-code/#code-migration-from-azure-devops-to-github&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Code Migration From Azure DevOps to GitHub&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;Then removed all other component’s code from the repo (git history is still dirty with other component’s old commits)&lt;/li&gt;
&lt;li&gt;Re-configured the existing Azure pipeline triggers, i.e switched to a tag-based trigger. So, on each new release in GitHub, the connected Azure pipelines will run.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now, the monorepo had so many tags including the tags of the other components. So, I wanted to remove all the tags from the repo before proceeding with the GitHub releases, and I did use the &lt;a href=&quot;#recommended-steps&quot;&gt;Recommended Steps&lt;/a&gt; above.&lt;/p&gt;</content:encoded><category>git</category><category>github</category><author>Abhith Rajan</author></item><item><title>How We Use Jira Automation</title><link>https://www.abhith.net/blog/how-we-use-jira-automation/</link><guid isPermaLink="true">https://www.abhith.net/blog/how-we-use-jira-automation/</guid><description>Jira automation makes your project management easier by automating so much of the work you already do.</description><pubDate>Sun, 10 Apr 2022 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;We use &lt;a href=&quot;https://www.abhith.net/topics/jira/&quot;&gt;Jira&lt;/a&gt; for our issue/task management at work. As a DevOps guy, one of my favorite features of Jira is Jira automation.&lt;/p&gt;
&lt;p&gt;For automation starters, the good thing is there are many predefined templates available at the &lt;a href=&quot;https://www.atlassian.com/software/jira/automation-template-library?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=how-we-use-jira-automation&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Jira automation template library&lt;/a&gt;, which we can use as a reference to create our own with adaptations as per our needs.&lt;/p&gt;
&lt;p&gt;Before getting into the automation rules which we use, to get a better picture, better to know about our current workflow.&lt;/p&gt;
&lt;h2 id=&quot;workflow&quot;&gt;Workflow&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#workflow&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Our current workflow is,&lt;/p&gt;
&lt;pre class=&quot;mermaid&quot; data-mermaid&gt;flowchart LR
Backlog --&amp;gt; Todo
Todo --&amp;gt; InDev[In Dev]
InDev --&amp;gt; ReadyForQA[Ready for QA]
ReadyForQA --&amp;gt; InTest[In Test]
InTest --&amp;gt; IsQAPassed{Is QA passed?}
IsQAPassed --&amp;gt; |Yes| ReadyToDeploy[Ready to Deploy]
IsQAPassed -. Yes .-&amp;gt; Done
IsQAPassed --&amp;gt; |No| Todo
ReadyToDeploy --&amp;gt; Done&lt;/pre&gt;
&lt;p&gt;And, we configured our Jira to have the following two custom fields for issue types, which are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Developer&lt;/li&gt;
&lt;li&gt;Tester&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both of them are of the type &lt;code&gt;User Picker (single user)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is to retain the developer, and tester information on the issue since the assignee may change during state transition as per the workflow.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/custom-fields.Bf5KiIwm_THLjk.webp&quot; alt=&quot;Custom fields&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1278&quot; height=&quot;811&quot;&gt;&lt;figcaption&gt;Custom fields&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Now, let’s jump into the automation rules which we use. They are,&lt;/p&gt;
&lt;h2 id=&quot;automation-rules&quot;&gt;Automation rules&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#automation-rules&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Auto-assign to whoever created the issue&lt;/li&gt;
&lt;li&gt;Close duplicate issues&lt;/li&gt;
&lt;li&gt;Link issues that are mentioned in the comments&lt;/li&gt;
&lt;li&gt;When a commit is created and the status is ‘To do’ → then transition this issue to ‘In Dev’&lt;/li&gt;
&lt;li&gt;On Pull Request created → comment the details&lt;/li&gt;
&lt;li&gt;On Pull Request merged → comment the details&lt;/li&gt;
&lt;li&gt;Comment on Ready for QA items if not assigned to a QA&lt;/li&gt;
&lt;li&gt;Assign issue back to Developer once Ready To Deploy&lt;/li&gt;
&lt;li&gt;Assign issue back to Developer once Done&lt;/li&gt;
&lt;li&gt;When issue is resolved → comment on related issues&lt;/li&gt;
&lt;li&gt;Label issues as stale that have not had recent interaction&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/automations.eI2d828Q_ZrDb3C.webp&quot; alt=&quot;Automation&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1625&quot; height=&quot;633&quot;&gt;&lt;figcaption&gt;Automation&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I hope the names are self-explanatory. Now let’s dig into each and will try to explain the use case for each,&lt;/p&gt;
&lt;h3 id=&quot;1-auto-assign-to-whoever-created-the-issue&quot;&gt;1. Auto-assign to whoever created the issue&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#1-auto-assign-to-whoever-created-the-issue&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is very simple automation. When an issue is created &lt;strong&gt;without an assignee&lt;/strong&gt;, automatically assign it to the person who created it.&lt;/p&gt;
&lt;p&gt;This ensures that someone is always accountable for an issue by making sure it is always assigned to whoever created it.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/auto-assign-to-whoever-created-the-issue-1.CQNFzKgd_LI4DE.webp&quot; alt=&quot;Auto-assign to whoever created the issue&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1326&quot; height=&quot;784&quot;&gt;&lt;figcaption&gt;Auto-assign to whoever created the issue&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And the result will be,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/1-auto-assign-to-whoever-created-the-issue-result.CaVs7yGl_Zv5cbD.webp&quot; alt=&quot;Automation auto assigned to reporter&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;489&quot; height=&quot;232&quot;&gt;&lt;figcaption&gt;Automation auto assigned to reporter&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;There’s a template for the same in the Jira automation template library.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://www.atlassian.com/software/jira/automation-template-library/rules?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=how-we-use-jira-automation#/rule/1381434&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Smart auto-assign&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;2-close-duplicate-issues&quot;&gt;2. Close duplicate issues&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2-close-duplicate-issues&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Sometimes, we have multiple similar issues. We can close the second issue and keep the first issue open just by adding a link to the second issue as,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The second issue &lt;code&gt;duplicates&lt;/code&gt; the first issue.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/close-duplicate-issues-1.CVopig3-_Z1YTKme.webp&quot; alt=&quot;Link issue as duplicates&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;626&quot; height=&quot;69&quot;&gt;&lt;figcaption&gt;Link issue as duplicates&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The automation rule for closing such duplicate is,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/close-duplicate-issues-2.CCWU_Bxx_1CPTzQ.webp&quot; alt=&quot;Trigger - Close duplicate issues&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1315&quot; height=&quot;514&quot;&gt;&lt;figcaption&gt;Trigger - Close duplicate issues&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;That will do,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/2-close-duplicate-issues-result.Dy9_P4y3_ceifb.webp&quot; alt=&quot;Duplicate issue closed by automation&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;527&quot; height=&quot;304&quot;&gt;&lt;figcaption&gt;Duplicate issue closed by automation&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;3-link-issues-that-are-mentioned-in-the-comments&quot;&gt;3. Link issues that are mentioned in the comments&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#3-link-issues-that-are-mentioned-in-the-comments&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This will help us to link issues that are mentioned in the comments. And, along with the automation rule &lt;strong&gt;When issue is resolved → comment on related issues&lt;/strong&gt;, this is a great way of notifying the related issues and the watchers of the same.&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;https://www.abhith.net/_astro/link-issues-that-are-mentioned-in-the-comments-1.OD7GLQoi_Zzgpuq.webp&quot; alt=&quot;Trigger - Link issues that are mentioned in the comments&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1316&quot; height=&quot;594&quot;&gt;
 &lt;img src=&quot;https://www.abhith.net/_astro/link-issues-that-are-mentioned-in-the-comments-2.BJFa-6_V_YTNzv.webp&quot; alt=&quot;Check whether any issue mentioned in the comments&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1321&quot; height=&quot;594&quot;&gt;
 &lt;img src=&quot;https://www.abhith.net/_astro/link-issues-that-are-mentioned-in-the-comments-3.pfsb8mcB_Z1EQrNW.webp&quot; alt=&quot;Link the mentioned issue&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1326&quot; height=&quot;596&quot;&gt;&lt;/p&gt;
&lt;p&gt;The result is,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/link-issues-that-are-mentioned-in-the-comments-result.C6nHkdSX_Z1KdLKq.webp&quot; alt=&quot;Automation links the commented issue&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;528&quot; height=&quot;73&quot;&gt;&lt;figcaption&gt;Automation links the commented issue&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;4-when-a-commit-is-created-and-the-status-is-to-do--then-transition-this-issue-to-in-dev&quot;&gt;4. When a commit is created and the status is ‘To do’ → then transition this issue to ‘In Dev’&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#4-when-a-commit-is-created-and-the-status-is-to-do--then-transition-this-issue-to-in-dev&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We already connected our &lt;strong&gt;GitHub&lt;/strong&gt; repos to our JIRA cloud.
And, this automation will help us to transition the issue to ‘In Dev’ when a commit is created in Github.&lt;/p&gt;
&lt;p&gt;You can use the smart commit message to trigger this automation.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://support.atlassian.com/jira-software-cloud/docs/process-issues-with-smart-commits/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=how-we-use-jira-automation&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Process issues with smart commits | Jira Software Cloud | Atlassian Support&lt;/a&gt;&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/when-a-commit-is-created-and-the-status-is-to-do-then-transition-this-issue-to-in-dev-1.Pf5ZS4XC_ZYbh3E.webp&quot; alt=&quot;Trigger - When a commit is created and the status is &apos;To do&apos; → then transition this issue to &apos;In Dev&apos;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1318&quot; height=&quot;548&quot;&gt;&lt;figcaption&gt;Trigger - When a commit is created and the status is &amp;#39;To do&amp;#39; → then transition this issue to &amp;#39;In Dev&amp;#39;&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;That’s it, automation will take care of the issue transition,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/when-a-commit-is-created-and-the-status-is-to-do-then-transition-this-issue-to-in-dev-result.DYKpVxNp_9NK0K.webp&quot; alt=&quot;Issue transition&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;503&quot; height=&quot;70&quot;&gt;&lt;figcaption&gt;Issue transition&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;5-on-pull-request-created--comment-the-details&quot;&gt;5. On Pull Request created → comment the details&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#5-on-pull-request-created--comment-the-details&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is to comment on the issue about the details of the pull request so the watchers are informed that there’s some progress on the work item.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/on-pull-request-created-comment-the-details-1.DeDkWwwe_ZYeqk2.webp&quot; alt=&quot;Comment - On Pull Request created → comment the details&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1317&quot; height=&quot;520&quot;&gt;&lt;figcaption&gt;Comment - On Pull Request created → comment the details&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Then automation will do,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/on-pull-request-created-comment-the-details-result.Cw21-j2O_2mYe4n.webp&quot; alt=&quot;Comments PR details when PR created&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;894&quot; height=&quot;96&quot;&gt;&lt;figcaption&gt;Comments PR details when PR created&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;6-on-pull-request-merged--comment-the-details&quot;&gt;6. On Pull Request merged → comment the details&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#6-on-pull-request-merged--comment-the-details&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Similar to &lt;strong&gt;On Pull Request created → comment the details&lt;/strong&gt;, this is to comment the details of the pull request on the issue so the watchers are informed that there is more progress on the work item.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/on-pull-request-merged-comment-the-details-1.CFri-dI7_Z2r6b3y.webp&quot; alt=&quot;Comment - On Pull Request merged → comment the details&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1318&quot; height=&quot;531&quot;&gt;&lt;figcaption&gt;Comment - On Pull Request merged → comment the details&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Then automation will do,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/on-pull-request-merged-comment-the-details-result.BpQVmkDy_Z1516cV.webp&quot; alt=&quot;Comments PR details when PR merged&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;875&quot; height=&quot;91&quot;&gt;&lt;figcaption&gt;Comments PR details when PR merged&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;7-comment-on-ready-for-qa-items-if-not-assigned-to-a-qa&quot;&gt;7. Comment on Ready for QA items if not assigned to a QA&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#7-comment-on-ready-for-qa-items-if-not-assigned-to-a-qa&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As per our workflow, the dev should assign the task to a QA person when the task is ready for QA.
But, if the dev doesn’t assign the task to a QA person, then automation comments on the issue to alert the dev person.&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;https://www.abhith.net/_astro/comment-on-ready-for-qa-items-if-not-assigned-to-a-qa-1.CBDzZq0u_1xgXHD.webp&quot; alt=&quot;Scheduled trigger&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1305&quot; height=&quot;604&quot;&gt;
 &lt;img src=&quot;https://www.abhith.net/_astro/comment-on-ready-for-qa-items-if-not-assigned-to-a-qa-2.BSFmSqj8_Z13UCMD.webp&quot; alt=&quot;Comment&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1320&quot; height=&quot;513&quot;&gt;&lt;/p&gt;
&lt;p&gt;That’s it, automation will notify the developer in case they forgot to assign the task to a QA person.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/comment-on-ready-for-qa-items-if-not-assigned-to-a-qa-result.3w9Ea9OV_Z1PRey6.webp&quot; alt=&quot;Automation comment&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;502&quot; height=&quot;98&quot;&gt;&lt;figcaption&gt;Automation comment&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;8-assign-issue-back-to-developer-once-ready-to-deploy&quot;&gt;8. Assign issue back to Developer once Ready To Deploy&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#8-assign-issue-back-to-developer-once-ready-to-deploy&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Once the QA passed, the QA person should assign the task back to the developer of that work item along with changing the status to &lt;strong&gt;Ready to Deploy&lt;/strong&gt;. But, we observed that most time the QA person forgets to assign the task back to the dev.
To avoid this, we are using this automation rule to assign the task back to the dev once the task is ready to deploy.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/assign-issue-back-to-developer-once-ready-to-deploy-1.vNgROBHv_Z33qqJ.webp&quot; alt=&quot;Change assignee&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1331&quot; height=&quot;728&quot;&gt;&lt;figcaption&gt;Change assignee&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Now automation will take care of the assignee switching,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/assign-issue-back-to-developer-once-ready-to-deploy-result.D-c7UCxo_nNh91.webp&quot; alt=&quot;Assignee changed&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;494&quot; height=&quot;171&quot;&gt;&lt;figcaption&gt;Assignee changed&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;9-assign-issue-back-to-developer-once-done&quot;&gt;9. Assign issue back to Developer once Done&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#9-assign-issue-back-to-developer-once-done&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is similar to &lt;strong&gt;Assign issue back to Developer once Ready To Deploy&lt;/strong&gt;, but this is to assign the task back to the dev once the task is done.&lt;/p&gt;
&lt;p&gt;That is because, once QA passed, QA can either mark it as &lt;strong&gt;Done&lt;/strong&gt; or &lt;strong&gt;Ready to Deploy&lt;/strong&gt;.
 &lt;img src=&quot;https://www.abhith.net/_astro/assign-issue-back-to-developer-once-done-1.lp8L6aY__Z2f614j.webp&quot; alt=&quot;Condition&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1325&quot; height=&quot;731&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;10-when-issue-is-resolved--comment-on-related-issues&quot;&gt;10. When issue is resolved → comment on related issues&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#10-when-issue-is-resolved--comment-on-related-issues&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As I mentioned in the automation rule &lt;strong&gt;3. Link issues that are mentioned in the comments&lt;/strong&gt;, this is a great way of notifying the related issues and the watchers of the same.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/when-issue-is-resolved-comment-on-related-issues-1.tMxrIDFi_1ypT2c.webp&quot; alt=&quot;Comment on related issues&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1360&quot; height=&quot;772&quot;&gt;&lt;figcaption&gt;Comment on related issues&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;This rule does,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/10-when-issue-is-resolved-comment-on-related-issues-result.Dzux0_Um_USqoQ.webp&quot; alt=&quot;Commented on related issue&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;772&quot; height=&quot;251&quot;&gt;&lt;figcaption&gt;Commented on related issue&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;11-label-issues-as-stale-that-have-not-had-recent-interaction&quot;&gt;11. Label issues as stale that have not had recent interaction&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#11-label-issues-as-stale-that-have-not-had-recent-interaction&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;After a period of inactivity (now set to 60d), a stale label will be applied to mark an issue with &lt;code&gt;Todo&lt;/code&gt; status as &lt;strong&gt;stale&lt;/strong&gt; and posts a comment to notify contributors that the issue will be closed.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/label-issues-as-stale-that-have-not-had-recent-interaction-1.Dz93etzY_ZO7jxq.webp&quot; alt=&quot;Label issues as stale that have not had recent interaction&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1335&quot; height=&quot;787&quot;&gt;&lt;figcaption&gt;Label issues as stale that have not had recent interaction&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Before adding this rule to the automation, I had around ~250 issues assigned to me in the Backlog. Most of them were created by myself since I have a habit of making notes of all work items in the Jira after any work-related discussions. But all of those were sitting there for so long whereas our priorities were wholly different and some were too old and stale of course. And, we recently started to work based on the backlog items so having a long backlog with stale work items is not a good thing and it was hard to prioritize the work too.&lt;/p&gt;
&lt;p&gt;So, I decided to add this rule to the automation and it labeled the stale issues.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/stale.BLNReTXj_2pLNPn.webp&quot; alt=&quot;Stale issues&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1005&quot; height=&quot;316&quot;&gt;&lt;figcaption&gt;Stale issues&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Then I went around all my stale issues, closed the ones which were not relevant anymore, and the ones which are not stale simply removed the stale label. In the end, I ended up having around ~50 items in the backlog.
So, picking up items for the next sprint was easy and I was able to prioritize the backlog items.&lt;/p&gt;
&lt;h4 id=&quot;is-closing-stale-issues-really-a-good-idea&quot;&gt;Is closing stale issues really a good idea?&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#is-closing-stale-issues-really-a-good-idea&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;In any successful software project, there’s always more work to do than people to do it. As more and more work piles up, it becomes paralyzing. Just making decisions about what work should and shouldn’t get done can exhaust all available resources.&lt;/p&gt;
&lt;p&gt;Focusing on issues that are actively affecting humans is an effective method for prioritizing work.&lt;/p&gt;
&lt;p&gt;To some, a robot trying to close stale issues may seem inhospitable or offensive to contributors. But the alternative is to disrespect them by setting false expectations and implicitly ignoring their work. This automation makes it explicit: if work is not progressing, then it’s stale. A comment is all it takes to keep the conversation alive.&lt;/p&gt;
&lt;h2 id=&quot;planned-improvements&quot;&gt;Planned Improvements&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#planned-improvements&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Rule to auto-assign to the tester when transitioned to &lt;strong&gt;Ready for QA&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Rule to auto-assign to the developer when transitioned to &lt;strong&gt;Todo&lt;/strong&gt; from &lt;strong&gt;In Test&lt;/strong&gt; (QA not passed case)&lt;/li&gt;
&lt;li&gt;Close issues that are marked as stale, after a period of inactivity.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#final-thoughts&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Jira automation helps us to manage the work items more efficiently and we are loving it.
If you have any questions related to any of the Jira automation rules, or if you have any suggestions, please feel free to post them in the comments 👇&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.atlassian.com/software/jira/automation-template-library/most-popular?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=how-we-use-jira-automation&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Most popular Jira automation templates | Atlassian&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;This is how we use Jira Automation.&lt;br&gt; &lt;a href=&quot;https://t.co/uZkdcDGtH2&quot;&gt;https://t.co/uZkdcDGtH2&lt;/a&gt;&lt;br&gt;&lt;br&gt; &lt;a href=&quot;https://x.com/hashtag/jira?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#jira&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/projectmanagement?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#projectmanagement&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1513555118817435657?ref_src=twsrc%5Etfw&quot;&gt;April 11, 2022&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>jira</category><category>project-management</category><author>Abhith Rajan</author></item><item><title>GitHub vs Azure DevOps - For Code</title><link>https://www.abhith.net/blog/github-vs-azure-devops-for-code/</link><guid isPermaLink="true">https://www.abhith.net/blog/github-vs-azure-devops-for-code/</guid><description>Comparing GitHub and Azure DevOps for code management and related features. Hopefully, this post will encourage you to switch to GitHub.</description><pubDate>Tue, 01 Feb 2022 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;I have been using &lt;a href=&quot;https://www.abhith.net/topics/azure-devops/&quot;&gt;Azure DevOps&lt;/a&gt; as well as &lt;a href=&quot;https://www.abhith.net/topics/github/&quot;&gt;GitHub&lt;/a&gt; for many years now.
All open-source stuff is on GitHub (some private repositories too.), and all work stuff is on Azure DevOps.
I love &lt;a href=&quot;https://www.abhith.net/topics/azure-devops/&quot;&gt;Azure DevOps&lt;/a&gt;, but for &lt;strong&gt;code&lt;/strong&gt; management, I prefer using &lt;a href=&quot;https://www.abhith.net/topics/github/&quot;&gt;GitHub&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;Since both are owned by &lt;strong&gt;Microsoft&lt;/strong&gt;, and seeing the recent developments and features all happening on the GitHub side compared to Azure DevOps, my mind is pretty clear on which to choose for the future.
It’s not just me, but many people agree on the same.
Jump to the &lt;a href=&quot;https://www.youtube.com/watch?v=K5aO97x2208&amp;amp;t=2420s&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;40:20&lt;/a&gt; on the below video and hear yourself.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;youtube: https://www.youtube.com/watch?v=K5aO97x2208&amp;amp;start=2420s&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So, I would like to see this change (move all our repo to GitHub) in my organization.
Currently, we use Azure DevOps for both code &amp;amp; CI/CD pipelines.&lt;/p&gt;
&lt;p&gt;Since it is an organization-wide change, I cannot just go and tell my manager about this change.
Instead, I have to present what benefits we are getting through this change.&lt;/p&gt;
&lt;p&gt;For that, I thought of creating an internal presentation and side-by-side this public blog.&lt;/p&gt;
&lt;p&gt;So in this post, I will try to list out things that attract me towards GitHub for code management.&lt;/p&gt;
&lt;h2 id=&quot;dependabot&quot;&gt;Dependabot&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#dependabot&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Automated dependency updates built into GitHub.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One of the main attracting factors towards GitHub.
Since we have many projects and tracking all the dependencies manually is not possible at all.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Keep all your packages up to date with Dependabot&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dependabot&lt;/strong&gt;’s automated PRs with updated packages/dependencies help a lot.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/dependabot-prs.DD4_Iy3u_ZKvimT.webp&quot; alt=&quot;Dependabot PRs&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;&lt;figcaption&gt;Dependabot PRs&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And the security alerts,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/dependabot-alerts.BliJdlod_1RMK2r.webp&quot; alt=&quot;Dependabot Alerts&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;&lt;figcaption&gt;Dependabot Alerts&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;code-scanning&quot;&gt;Code Scanning&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#code-scanning&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://resources.github.com/code-scanning/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Code scanning&lt;/a&gt; is GitHub’s native SAST (Static Application Security Testing) tool, a developer-first approach to SAST that enables vulnerabilities to be found and remediated effortlessly before they reach production.&lt;/p&gt;
&lt;p&gt;Here’s what GitHub code scanning can help you do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Find, triage, and prioritize vulnerabilities in your code.&lt;/li&gt;
&lt;li&gt;See security issues in your pull requests as part of your review process.&lt;/li&gt;
&lt;li&gt;Prevent new vulnerabilities from making it to production.&lt;/li&gt;
&lt;li&gt;Schedule scans for specific days and times, or trigger scans when a specific event occurs in the repository, such as a push.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href=&quot;https://codeql.github.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;CodeQL&lt;/a&gt; action part of the code scanning features of GitHub is good even though comes at a price (of course free for open source).
And I prefer the &lt;code&gt;security-and-quality&lt;/code&gt; query suite for the &lt;code&gt;CodeQL&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/code-scanning-alerts.BLmJOJsG_Z2hIDk2.webp&quot; alt=&quot;Code Scanning Alerts&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;&lt;figcaption&gt;Code Scanning Alerts&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;marketplace-and-integrations&quot;&gt;Marketplace and integrations&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#marketplace-and-integrations&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Both Azure DevOps and GitHub have many integrations available.
But IMHO, GitHub has a better collection, growing too.&lt;/p&gt;
&lt;h3 id=&quot;jira&quot;&gt;JIRA&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#jira&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We manage our work items through &lt;a href=&quot;https://www.abhith.net/topics/jira/&quot;&gt;Jira&lt;/a&gt;. One of the main things we are missing in Azure DevOps is the Jira integration whereas there’s an official integration available between JIRA and GitHub.&lt;/p&gt;
&lt;p&gt;Linking work items to code have many benefits.&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;https://www.abhith.net/_astro/jira-development.DYESIaJ6_VSO3c.webp&quot; alt=&quot;Development links in the Jira issue details&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;
 &lt;img src=&quot;https://www.abhith.net/_astro/jira-branches.Dgefgs2X_GDCR0.webp&quot; alt=&quot;GitHub Branches&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;
 &lt;img src=&quot;https://www.abhith.net/_astro/jira-commits.DIfzjIrB_2pE1rV.webp&quot; alt=&quot;GitHub Commits&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;
 &lt;img src=&quot;https://www.abhith.net/_astro/jira-prs.Ch1iXJWo_Z7L4KO.webp&quot; alt=&quot;GitHub PRs&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;&lt;/p&gt;
&lt;p&gt;GitHub issues, boards all are awesome but JIRA is a bit more advanced as well as customizable for software project management, so can’t ask to switch to GitHub at this time (still I prefer GitHub).&lt;/p&gt;
&lt;h2 id=&quot;github-checks&quot;&gt;GitHub Checks&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#github-checks&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are several GitHub apps which is capable of running powerful checks against the code changes in the repository.
Apps that perform continuous integration, code linting, or code scanning services and provide detailed feedback on commits.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/checks.a1F46CL3_2n9NzA.webp&quot; alt=&quot;GitHub Checks&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;929&quot; height=&quot;443&quot;&gt;&lt;figcaption&gt;GitHub Checks&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;release-notes&quot;&gt;Release Notes&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#release-notes&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The GitHub releases are a great way to share the latest version of your code.
The &lt;strong&gt;release notes&lt;/strong&gt; associated with the release are a great way to share the changes in the code.
 &lt;img src=&quot;https://www.abhith.net/_astro/releases.DQ39CC--_Z8scbx.webp&quot; alt=&quot;Releases&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;&lt;/p&gt;
&lt;p&gt;Do you know that GitHub can help in making release notes?
 &lt;img src=&quot;https://www.abhith.net/_astro/release-notes.Dlt2i8Sw_Z1iVk1q.webp&quot; alt=&quot;Release notes&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1261&quot; height=&quot;912&quot;&gt;&lt;/p&gt;
&lt;p&gt;Having the release notes part of each release, and helping with making the release notes is another plus side of Github.&lt;/p&gt;
&lt;h2 id=&quot;azure-pipelines-vs-github-actions&quot;&gt;Azure Pipelines vs GitHub Actions&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#azure-pipelines-vs-github-actions&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Azure Pipelines are way matured compared to GitHub Actions (👈 this may change in the future).&lt;/p&gt;
&lt;p&gt;But yes, a complete switch to GitHub from Azure DevOps might be possible by replacing Azure DevOps pipelines with GitHub actions.
But people mostly hate change when things are working fine with the current setup.
So one step at a time in terms of change.&lt;/p&gt;
&lt;p&gt;i.e First code migration, then slowly pipelines.
The first candidate for GitHub Actions can be PR builds.&lt;/p&gt;
&lt;p&gt;While comparing both, I love the following facts about the GitHub action,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Easy to create by just placing the workflow file in the &lt;code&gt;.github/workflows&lt;/code&gt; directory. Whereas Azure DevOps requires you to create a new pipeline in the UI.&lt;/li&gt;
&lt;li&gt;Suggestions for the workflow file are provided in the GitHub action UI based on your project’s type.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;mobile-application&quot;&gt;Mobile Application&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#mobile-application&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;GitHub’s mobile application is a great way to manage your code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can do PR review,&lt;/li&gt;
&lt;li&gt;Merge code,&lt;/li&gt;
&lt;li&gt;And so on,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All through the mobile app.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/app_GitHub.BrtKa2we_Z28riuj.webp&quot; alt=&quot;GitHub Mobile App&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1440&quot; height=&quot;3040&quot;&gt;&lt;figcaption&gt;GitHub Mobile App&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Azure DevOps doesn’t have such a mobile application but you can access the DevOps portal through the mobile browser, the UI is somewhat responsive, but the experience is still way better in GitHub’s mobile app, and the app is getting new features on every release.&lt;/p&gt;
&lt;h2 id=&quot;powerful-web-based-editor-vs-code-on-web&quot;&gt;Powerful web-based editor (VS Code on Web)&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#powerful-web-based-editor-vs-code-on-web&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;I never liked &amp;quot;.&amp;quot; this much.&lt;br&gt;&lt;br&gt;We can open any &lt;a href=&quot;https://x.com/hashtag/github?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#github&lt;/a&gt; repo on &lt;a href=&quot;https://x.com/hashtag/vscode?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#vscode&lt;/a&gt;, directly on your browser, by simply pressing &amp;quot;.&amp;quot; (no quotes, just that dot).&lt;br&gt;&lt;br&gt;The repo will open in &lt;a href=&quot;https://t.co/P2oEcfcGFA&quot;&gt;https://t.co/P2oEcfcGFA&lt;/a&gt;, a kind of Visual Studio Code on the browser. &lt;a href=&quot;https://t.co/ZUFNJe443s&quot;&gt;pic.twitter.com/ZUFNJe443s&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1504864768389222404?ref_src=twsrc%5Etfw&quot;&gt;March 18, 2022&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;
&lt;p&gt;The &lt;a href=&quot;https://github.dev/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;github.dev&lt;/a&gt; and the shortcut ”.”, 👌. I am using it more often, even this blog am maintaining most of the time via the web editor of GitHub.&lt;/p&gt;
&lt;h2 id=&quot;and&quot;&gt;And&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#and&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;PR review is much better on GitHub. The sticky checkbox on each file is way better than the sidebar static checkboxes in the Azure DevOps.&lt;/li&gt;
&lt;li&gt;The GitHub organization landing page with repositories sorted by last updated gives a better insight to the team.&lt;/li&gt;
&lt;li&gt;The total number of repositories indicator in GitHub is a good metric, not sure how to find the total number of repositories in the Azure DevOps organization since repositories are kept under projects in the Azure DevOps organization.&lt;/li&gt;
&lt;li&gt;The GitHub community. You can follow external projects, and people and can learn from them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;pricing&quot;&gt;Pricing&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#pricing&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Looks complicated on GitHub. In most places, it is like &lt;code&gt;Contact Sales&lt;/code&gt;.
The change would be an easier task if the billing could be done through an Azure Subscription but it looks like it is not possible at the moment.&lt;/p&gt;
&lt;p&gt;Anyway, the free plan offers enough feature sets to start with GitHub.&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;If you plan to migrate to GitHub, the following sections will help you.&lt;/p&gt;
&lt;h2 id=&quot;code-migration-from-azure-devops-to-github&quot;&gt;Code Migration From Azure DevOps to GitHub&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#code-migration-from-azure-devops-to-github&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The code repository migration from Azure DevOps to GitHub is pretty easy.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Import repository
 &lt;img src=&quot;https://www.abhith.net/_astro/import-repo.bKtcm5jm_khoCz.webp&quot; alt=&quot;Import repository&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1011&quot; height=&quot;910&quot;&gt;&lt;/li&gt;
&lt;li&gt;Give your Azure DevOps Repo URL, and fill in the rest.&lt;/li&gt;
&lt;li&gt;And on the next screen, it will ask for credentials to access your DevOps repo. &lt;code&gt;Git credentials&lt;/code&gt; for the Azure DevOps repo will work fine. You can generate that one on the clone window on Azure DevOps as shown below.
 &lt;img src=&quot;https://www.abhith.net/_astro/git-credentials.D70bhAwJ_Z1Jg9EO.webp&quot; alt=&quot;Azure DevOps &gt; Git Credentials&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;929&quot;&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That’s it. You will not miss any code history after migration.&lt;/p&gt;
&lt;h2 id=&quot;change-azure-pipeline-repository-from-azure-devops-to-github&quot;&gt;Change Azure Pipeline Repository From Azure DevOps to GitHub&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#change-azure-pipeline-repository-from-azure-devops-to-github&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Since in our case, we have all pipelines already configured in the DevOps.
And don’t want to change any of them other than the repository location.
This can be done by following the below steps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Edit the existing pipeline&lt;/li&gt;
&lt;li&gt;In the upper right corner open the … menu&lt;/li&gt;
&lt;li&gt;Pick the ⚡ Triggers option&lt;/li&gt;
&lt;li&gt;Click the YAML tab&lt;/li&gt;
&lt;li&gt;Click the Get Sources option&lt;/li&gt;
&lt;li&gt;Reconfigure the source repo to GitHub.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You might need to choose a &lt;code&gt;GitHub connection&lt;/code&gt; to pick the repo.
For that, better to install the &lt;a href=&quot;https://github.com/marketplace/azure-pipelines?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Azure Pipelines&lt;/a&gt; GitHub app and give it access to the repository.
Which will create a connection back to your Azure DevOps account.&lt;/p&gt;
&lt;h2 id=&quot;final-notes&quot;&gt;Final Notes&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#final-notes&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After reading this,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you convinced that GitHub is better compared to Azure DevOps for code?&lt;/li&gt;
&lt;li&gt;If you are a GitHub pro, did I miss any goodness of GitHub over Azure DevOps in terms of code management?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let me know in the comments below 👇&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://acloudguru.com/blog/engineering/azure-devops-vs-github-comparing-microsofts-devops-twins?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Azure DevOps vs GitHub: Comparing Microsoft’s DevOps Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.upguard.com/blog/microsoft-visual-studio-team-services-vs-github?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=github-vs-azure-devops-for-code&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Azure DevOps vs GitHub | UpGuard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#changelog&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;2022-07-20&quot;&gt;2022-07-20&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2022-07-20&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added the &lt;strong&gt;Powerful web-based editor&lt;/strong&gt; section&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2022-07-13&quot;&gt;2022-07-13&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2022-07-13&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added the &lt;strong&gt;And&lt;/strong&gt; section&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2022-06-07&quot;&gt;2022-06-07&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2022-06-07&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added &lt;strong&gt;Release Notes&lt;/strong&gt; and &lt;strong&gt;Mobile Application&lt;/strong&gt; sections.&lt;/li&gt;
&lt;li&gt;Updated &lt;strong&gt;Azure Pipelines vs GitHub Actions&lt;/strong&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;&lt;a href=&quot;https://x.com/hashtag/github?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#github&lt;/a&gt; vs &lt;a href=&quot;https://x.com/hashtag/AzureDevOps?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#AzureDevOps&lt;/a&gt; - for code.&lt;br&gt;&lt;br&gt;Comparing GitHub and Azure DevOps for code management and related features. Hopefully, this post will encourage you to switch to GitHub.&lt;a href=&quot;https://t.co/ZNnEPhnKgQ&quot;&gt;https://t.co/ZNnEPhnKgQ&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1488579218971807756?ref_src=twsrc%5Etfw&quot;&gt;February 1, 2022&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>github</category><category>azure-devops</category><author>Abhith Rajan</author></item><item><title>2021 Year In Review</title><link>https://www.abhith.net/blog/2021-year-in-review/</link><guid isPermaLink="true">https://www.abhith.net/blog/2021-year-in-review/</guid><description>Abhith Rajan&apos;s 2021 year end reflection.</description><pubDate>Tue, 25 Jan 2022 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;A bit late to review 2021 work-life but “better late than never”, right?&lt;/p&gt;
&lt;p&gt;In 2021, my focus was on mainly &lt;strong&gt;&lt;a href=&quot;https://www.abhith.net/topics/cloud-native/&quot;&gt;Cloud Native&lt;/a&gt;&lt;/strong&gt; solutions. And one of my favorites of last year is, &lt;strong&gt;&lt;a href=&quot;https://www.abhith.net/topics/dapper/&quot;&gt;Dapr&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Other interesting findings of last year are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.abhith.net/topics/backstage/&quot;&gt;Backstage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.abhith.net/topics/cloudevents/&quot;&gt;CloudEvents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/dotnet/tye?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=2021-year-in-review&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Tye&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And the list goes on.&lt;/p&gt;
&lt;p&gt;Let’s talk about work for now.&lt;/p&gt;
&lt;h2 id=&quot;more-azure&quot;&gt;More Azure&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#more-azure&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I’m an &lt;a href=&quot;https://www.abhith.net/topics/azure/&quot;&gt;Azure&lt;/a&gt; guy. Interacting with it almost every working day.
My 2021 facts related to Azure are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Started using more &lt;a href=&quot;https://www.abhith.net/topics/azure-logic-apps/&quot;&gt;Azure Logic Apps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Used &lt;a href=&quot;https://www.abhith.net/topics/cosmos-db/&quot;&gt;Azure Cosmos DB&lt;/a&gt; the first time - it is our event store now.&lt;/li&gt;
&lt;li&gt;Integrated Azure maps&lt;/li&gt;
&lt;li&gt;Used &lt;a href=&quot;https://www.abhith.net/topics/azure-cognitive-search/&quot;&gt;Azure Cognitive Search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Baby steps with Azure Synapse + Power BI&lt;/li&gt;
&lt;li&gt;Azure app configuration + Feature flags - Advocating colleagues to use feature flags.&lt;/li&gt;
&lt;li&gt;Release annotation in &lt;a href=&quot;https://www.abhith.net/topics/app-insights/&quot;&gt;Azure Application Insights&lt;/a&gt; - Want to make it part of CD, TODO for 2022.&lt;/li&gt;
&lt;li&gt;Started switching to Azure Managed Identity&lt;/li&gt;
&lt;li&gt;Played with &lt;a href=&quot;https://www.abhith.net/topics/machine-learning/&quot;&gt;ML Studio&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;rest-of-the-work&quot;&gt;Rest of the work&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#rest-of-the-work&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Some of the other notable things I was doing last year are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Introduced geofence-based solutions - Hoo, the left-hand rule.&lt;/li&gt;
&lt;li&gt;Migrated to &lt;a href=&quot;https://www.abhith.net/topics/jira/&quot;&gt;JIRA&lt;/a&gt; cloud and set up some easy JIRA automation.&lt;/li&gt;
&lt;li&gt;Now everywhere &lt;a href=&quot;https://www.abhith.net/topics/cloudevents/&quot;&gt;CloudEvents&lt;/a&gt; - I like that spec.&lt;/li&gt;
&lt;li&gt;Done &lt;a href=&quot;https://www.abhith.net/topics/azure-devops/&quot;&gt;CI/CD&lt;/a&gt; setup for Java, &lt;a href=&quot;https://www.abhith.net/topics/angular/&quot;&gt;Angular&lt;/a&gt; projects other than &lt;a href=&quot;https://www.abhith.net/topics/dotnet/&quot;&gt;.NET&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;More into &lt;a href=&quot;https://www.abhith.net/topics/event-sourcing/&quot;&gt;Event-driven&lt;/a&gt; architectures.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And yeah, we switched to &lt;strong&gt;Postman&lt;/strong&gt; cloud.
The Postman is a good tool but for a &lt;a href=&quot;https://www.abhith.net/topics/microservices/&quot;&gt;microservice&lt;/a&gt; guy like me, the tabs are not enough.&lt;/p&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Tab groups in &lt;a href=&quot;https://x.com/hashtag/Chrome?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#Chrome&lt;/a&gt; are so good for devs.&lt;br&gt;I wish &lt;a href=&quot;https://x.com/hashtag/postman?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#postman&lt;/a&gt; had something similar. &lt;a href=&quot;https://t.co/QIk22kkjGZ&quot;&gt;pic.twitter.com/QIk22kkjGZ&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1408467163690713093?ref_src=twsrc%5Etfw&quot;&gt;June 25, 2021&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;
&lt;h2 id=&quot;pure-work&quot;&gt;Pure Work&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#pure-work&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;During this period, I have introduced around 12 RFCs in my workplace out of that 9 got landed in the production already.
Rest are on the way. If you wonder what is an RFC, it is where we propose a new feature (major) to be developed, and the way it should be developed, some more deep dives into technical plus user stories on the same.&lt;/p&gt;
&lt;p&gt;And I closed almost 263 JIRA work items during the same period.&lt;/p&gt;
&lt;p&gt;A major role that I handled last year is to team up with a &lt;strong&gt;Java&lt;/strong&gt; resource where I managed the work.
Even though I am not a &lt;strong&gt;Java&lt;/strong&gt; guy, I was reviewing the PRs (even corrected some, 😁).
And it went really well, together we delivered &lt;em&gt;7&lt;/em&gt; java microservice &lt;em&gt;components&lt;/em&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;components&lt;/code&gt; term came to me from &lt;a href=&quot;https://www.abhith.net/topics/backstage/&quot;&gt;Backstage&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Regarding &lt;strong&gt;PR&lt;/strong&gt;s, previously I was following &lt;strong&gt;Gitflow&lt;/strong&gt;, now switched to &lt;strong&gt;GitHub flow&lt;/strong&gt;.
And for release, &lt;strong&gt;Release Flow&lt;/strong&gt; as recommended by &lt;a href=&quot;https://devblogs.microsoft.com/devops/release-flow-how-we-do-branching-on-the-vsts-team/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=2021-year-in-review&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Microsoft VSTS Team&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When I switch any of my workflow or tools, I always recommend my colleagues to follow the same by pointing out the benefits.
My interest in &lt;a href=&quot;https://www.abhith.net/topics/backstage/&quot;&gt;Backstage&lt;/a&gt; is because I care about developer experience too.
Always looking for great ways to organize work, improve the workflows.&lt;/p&gt;
&lt;h2 id=&quot;plans-for-2022&quot;&gt;Plans for 2022&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#plans-for-2022&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Even though I’m working mostly on the Azure, never went for a certification. This year, I will.&lt;/li&gt;
&lt;li&gt;After delivering several components (stable, reliable, and feature-rich) successfully by just &lt;strong&gt;managing&lt;/strong&gt; the work, I realized that way I can contribute more to the work. Feels like time to go up a level, let’s see.&lt;/li&gt;
&lt;li&gt;Code migration from &lt;a href=&quot;https://www.abhith.net/topics/azure-devops/&quot;&gt;Azure DevOps&lt;/a&gt; to &lt;a href=&quot;https://www.abhith.net/topics/github/&quot;&gt;GitHub&lt;/a&gt;: Advocating team about the benefits of &lt;strong&gt;GitHub&lt;/strong&gt; over &lt;strong&gt;Azure DevOps&lt;/strong&gt; for code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Wish me a good year 😊&lt;/p&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Wish me a good year 😊&lt;a href=&quot;https://t.co/kSgkIfIMyK&quot;&gt;https://t.co/kSgkIfIMyK&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1486046399846567936?ref_src=twsrc%5Etfw&quot;&gt;January 25, 2022&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>general</category><author>Abhith Rajan</author></item><item><title>Create New Database Level User</title><link>https://www.abhith.net/snippets/sql-server/create-new-database-level-user/</link><guid isPermaLink="true">https://www.abhith.net/snippets/sql-server/create-new-database-level-user/</guid><description>Create a database-level user in SQL Server/Azure SQL.</description><pubDate>Sun, 23 Jan 2022 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;Connect to your SQL-Server using privileged account credentials (eg. sa) in your favorite IDE.
I still use &lt;strong&gt;SSMS&lt;/strong&gt; together with &lt;strong&gt;Azure Data Studio&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Set the query target database, In most IDE, right click on the DB, then new query.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; USER [username]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;PASSWORD&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;password&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;-- add user to role(s) in db&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ROLE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [db_datareader] &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ADD&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; MEMBER [username];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ROLE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [db_datawriter] &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ADD&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; MEMBER [username];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ROLE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [db_ddladmin] &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ADD&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; MEMBER [username];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;GRANT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;EXECUTE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;TO&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [username]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;CREATE USER [username]WITH PASSWORD = &apos;password&apos;-- add user to role(s) in dbALTER ROLE [db_datareader] ADD MEMBER [username];ALTER ROLE [db_datawriter] ADD MEMBER [username];ALTER ROLE [db_ddladmin] ADD MEMBER [username];GRANT EXECUTE TO [username]&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Execute the above statement after replacing the &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt; according to your choice.
You can also manage the roles as per your needs.&lt;/p&gt;
&lt;p&gt;Some of the &lt;code&gt;Fixed-database&lt;/code&gt; roles are,&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Fixed-Database role name&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;db_owner&lt;/td&gt;&lt;td&gt;Members of the db_owner fixed database role can perform all configuration and maintenance activities on the database, and can also drop the database in SQL Server. (In SQL Database and Azure Synapse, some maintenance activities require server-level permissions and cannot be performed by db_owners.)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;db_ddladmin&lt;/td&gt;&lt;td&gt;Members of the db_ddladmin fixed database role can run any Data Definition Language (DDL) command in a database.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;db_datawriter&lt;/td&gt;&lt;td&gt;Members of the db_datawriter fixed database role can add, delete, or change data in all user tables.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;db_datareader&lt;/td&gt;&lt;td&gt;Members of the db_datareader fixed database role can read all data from all user tables and views. User objects can exist in any schema except sys and INFORMATION_SCHEMA.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note&lt;/em&gt;&lt;/strong&gt;: In order to connect to the DB using the new credentials, &lt;strong&gt;you need to specify the database name&lt;/strong&gt; in the advanced options from your IDE since the above credentials don’t have the privilege to list the DB’s in the server.&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=snippets&amp;amp;utm_content=create-new-database-level-user&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Database-Level Roles - SQL Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/statements/grant-object-permissions-transact-sql?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=snippets&amp;amp;utm_content=create-new-database-level-user&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;GRANT Object Permissions (Transact-SQL)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>sql-server</category><category>security</category><author>Abhith Rajan</author></item><item><title>ASP.NET Core - OAuth 2.0 Client Access Token Management</title><link>https://www.abhith.net/blog/aspnet-core-oauth-2-0-client-access-token-management/</link><guid isPermaLink="true">https://www.abhith.net/blog/aspnet-core-oauth-2-0-client-access-token-management/</guid><description>OAuth 2.0 client access token management in an ASP.NET Core application</description><pubDate>Sun, 09 Jan 2022 14:11:27 GMT</pubDate><content:encoded>&lt;p&gt;In a &lt;strong&gt;microservice&lt;/strong&gt; world, the machine (microservice A) to machine (microservice B) communications can be secured using an &lt;strong&gt;OAuth 2.0&lt;/strong&gt; compatible token service, &lt;strong&gt;IdentityServer&lt;/strong&gt; in our case. i.e To successfully call microservice B, microservice A needs to get an access token first via client credentials grant type from the IdentityServer with the right scope for the operation.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;microservice A calls IdentityServer to get an &lt;code&gt;access token&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;microservice A then calls microservice B with the access token in the authorization header (bearer token).&lt;/li&gt;
&lt;li&gt;microservice B validates the access token, responds to microservice A with a valid response.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The above steps are fine for a single call, but in case of multiple calls from A to B, A doesn’t need to get an IdentityServer token every time since each token has its validity, so basically, A can reuse the token until it expires.&lt;/p&gt;
&lt;p&gt;For the token reusing, you don’t need to implement the caching and refreshing token logic anywhere since some good people who are maintaining &lt;a href=&quot;https://github.com/IdentityModel/IdentityModel.AspNetCore?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-oauth-2-0-client-access-token-management&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;IdentityModel.AspNetCore&lt;/a&gt; already done that. All we need to do is set up it, and consume it.&lt;/p&gt;
&lt;p&gt;The library will take care of the following,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;caching abstraction for access tokens&lt;/li&gt;
&lt;li&gt;automatic renewal of expired access tokens&lt;/li&gt;
&lt;li&gt;token lifetime automation for HttpClient&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;let’s jump into the setup. Following are our assumptions,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;microservice B has endpoints,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POST /orders&lt;/code&gt; and it requires IdentityServer token with &lt;code&gt;orders.write&lt;/code&gt; scope to create new orders,&lt;/li&gt;
&lt;li&gt;and to fetch the orders &lt;code&gt;GET /orders&lt;/code&gt; endpoint, the scope for that one is &lt;code&gt;orders.read&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;microservice A has valid client credentials configured on the IdentityServer with the above scopes added to the allowed scopes. i.e microservice A is allowed to call the microservice B.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So let’s configure microservice A,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;IdentityModel.AspNetCore&lt;/code&gt; package&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the &lt;code&gt;Startup.cs&lt;/code&gt; &amp;gt; &lt;code&gt;ConfigureServices&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Setup token management service&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddAccessTokenManagement&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Client&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Clients&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AppConsts&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StsClientName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ClientCredentialsTokenRequest&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Address&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetValue&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication:Sts:BaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;)}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;/connect/token&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Token service (IdentityServer) base URL&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClientId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication:Sts:ClientId&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClientSecret&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication:Sts:ClientSecret&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Scope&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AppConsts&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;OrdersWriteScope&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AppConsts&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;OrdersReadScope&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Any number of scopes, space separated&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Adds a named HTTP client for the factory that automatically sends the client access token&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddClientAccessTokenClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AppConsts&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StsClientName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AppConsts&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StsClientName&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;client&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;client&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;BaseAddress&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Uri&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ApiBaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))); &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// microservice B base URL&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;// Setup token management serviceservices.AddAccessTokenManagement(options =&gt;{  options.Client.Clients.Add(AppConsts.StsClientName, new ClientCredentialsTokenRequest  {    Address = $&amp;quot;{Configuration.GetValue&lt;string&gt;(&amp;quot;Authentication:Sts:BaseUrl&amp;quot;)}/connect/token&amp;quot;, // Token service (IdentityServer) base URL    ClientId = Configuration.GetValue&lt;string&gt;(&amp;quot;Authentication:Sts:ClientId&amp;quot;),    ClientSecret = Configuration.GetValue&lt;string&gt;(&amp;quot;Authentication:Sts:ClientSecret&amp;quot;),    Scope = $&amp;quot;{AppConsts.OrdersWriteScope} {AppConsts.OrdersReadScope}&amp;quot; // Any number of scopes, space separated  });});// Adds a named HTTP client for the factory that automatically sends the client access tokenservices.AddClientAccessTokenClient(AppConsts.StsClientName, AppConsts.StsClientName, client =&gt; client.BaseAddress = new Uri(Configuration.GetValue&lt;string&gt;(&amp;quot;ApiBaseUrl&amp;quot;))); // microservice B base URL&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Here we setup the token management service and a named HttpClient that uses the same.
Also you can observe, we moved the static string params to a &lt;code&gt;AppConsts.cs&lt;/code&gt; file,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AppConsts&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;OrdersWriteScope&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;orders.write&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;OrdersReadScope&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;orders.read&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;StsClientName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;microservice_a_api_client&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public class AppConsts{    public const string OrdersWriteScope = &amp;quot;orders.write&amp;quot;;    public static string OrdersReadScope = &amp;quot;orders.read&amp;quot;;    public static string StsClientName = &amp;quot;microservice_a_api_client&amp;quot;;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And the configurations like client credentials, token service endpoint, and rest are kept in the &lt;code&gt;appsettings.json&lt;/code&gt; or somewhere more private like Azure App Configuration, keyvault, and loaded to the aspnetcore configurations.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ApiBaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://microservice-b.com&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Sts&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;BaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://my-identityserver.com&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;ClientId&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;microservice_a_api&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;ClientSecret&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &amp;quot;ApiBaseUrl&amp;quot;: &amp;quot;https://microservice-b.com&amp;quot;,  &amp;quot;Authentication&amp;quot;: {    &amp;quot;Sts&amp;quot;: {      &amp;quot;BaseUrl&amp;quot;: &amp;quot;https://my-identityserver.com&amp;quot;,      &amp;quot;ClientId&amp;quot;: &amp;quot;microservice_a_api&amp;quot;,      &amp;quot;ClientSecret&amp;quot;: &amp;quot;&amp;quot;    }  },&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Configuration is done, now let’s consume the &lt;code&gt;HttpClient&lt;/code&gt;.
Here I’m using &lt;code&gt;Flurl&lt;/code&gt; to make the HTTP request, if you prefer direct HttpClient usage, you can do that way. You don’t need to do anything special to get the access token since it is already taken care of.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Flurl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Http&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;GetOrdersQueryHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IRequestHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeInput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeOutput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;readonly&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IFlurlClient&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;_flurlClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetOrdersQueryHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IHttpClientFactory&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;httpClientFactory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;httpClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;httpClientFactory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AppConsts&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StsClientName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_flurlClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;FlurlClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;httpClient&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeOutput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Handle&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeInput&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CancellationToken&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;cancellationToken&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_flurlClient&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;/orders&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetJsonAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeOutput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;cancellationToken&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using Flurl.Http;public class GetOrdersQueryHandler : IRequestHandler&lt;SomeInput, SomeOutput&gt;{    private readonly IFlurlClient _flurlClient;    public GetOrdersQueryHandler(IHttpClientFactory httpClientFactory)    {        var httpClient = httpClientFactory.CreateClient(AppConsts.StsClientName);        _flurlClient = new FlurlClient(httpClient);    }    public async Task&lt;SomeOutput&gt; Handle(SomeInput request, CancellationToken cancellationToken)    {        return await _flurlClient                .Request($&amp;quot;/orders&amp;quot;)                .GetJsonAsync&lt;SomeOutput&gt;(cancellationToken);    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;As you can see, we use the named httpClient, and that client is already configured to have the access token with the scopes.
That’s it. You can use the same way to call the create order endpoint since the client has an access token with both scopes.&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://identitymodel.readthedocs.io/en/latest/aspnetcore/overview.html?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-oauth-2-0-client-access-token-management&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Identitymodel For Workers And Web Apps&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>aspnet-core</category><category>api-management</category><category>identityserver</category><author>Abhith Rajan</author></item><item><title>UTC to UAE Time (Arabian Standard Time)</title><link>https://www.abhith.net/snippets/sql-server/utc-to-uae-time/</link><guid isPermaLink="true">https://www.abhith.net/snippets/sql-server/utc-to-uae-time/</guid><description>Convert UTC time to Arabian Standard Time in SQL Server</description><pubDate>Tue, 07 Sep 2021 09:26:00 GMT</pubDate><content:encoded>&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;datetime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;SWITCHOFFSET&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;GETUTCDATE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;DATEPART&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;TZOFFSET&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;GETUTCDATE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;AT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;TIME&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ZONE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;Arabian Standard Time&amp;#39;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; CreationTime&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;SELECT CONVERT(datetime, SWITCHOFFSET(GETUTCDATE(), DATEPART(TZOFFSET,GETUTCDATE() AT TIME ZONE &apos;Arabian Standard Time&apos;))) AS CreationTime&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;GETUTCDATE()&lt;/code&gt; with your table column that has the UTC time.&lt;/p&gt;</content:encoded><category>sql-server</category><author>Abhith Rajan</author></item><item><title>Azure Cognitive Search - GeographyPoint to GeoJSON in .NET 5</title><link>https://www.abhith.net/blog/azure-cognitive-search-geographypoint-to-geojson-in-dotnet-5/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-cognitive-search-geographypoint-to-geojson-in-dotnet-5/</guid><description>Microsoft.Spatial GeographyPoint to GeoJSON in .NET5 using System.Text.Json.</description><pubDate>Sat, 13 Mar 2021 17:11:27 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Azure Cognitive Search Service&lt;/strong&gt; supported data types includes &lt;code&gt;Edm.GeographyPoint&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;While creating index definition using attributes in &lt;code&gt;C#&lt;/code&gt;, to specify the field type as &lt;code&gt;Edm.GeographyPoint&lt;/code&gt; we can use the &lt;code&gt;GeographyPoint&lt;/code&gt; as the type.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Azure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Search&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Documents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Indexes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Spatial&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RestaurantIndexModel&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SimpleField&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;IsFilterable&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;IsSortable&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;GeographyPoint&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using Azure.Search.Documents.Indexes;using Microsoft.Spatial;public class RestaurantIndexModel{    ...    [SimpleField(IsFilterable = true, IsSortable = true)]    public GeographyPoint Location { get; set; }    ...}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;We need to have the NuGet package &lt;code&gt;Microsoft.Spatial&lt;/code&gt; to use the &lt;code&gt;GeographyPoint&lt;/code&gt; type.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PackageReference&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Microsoft.Spatial&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;7.8.3&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &lt;PackageReference Include=&amp;quot;Microsoft.Spatial&amp;quot; Version=&amp;quot;7.8.3&amp;quot; /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And with that, you can create the index definition,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/index-definition.N_l9JXbf_1OwLHG.webp&quot; alt=&quot;Index definition&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1048&quot; height=&quot;610&quot;&gt;&lt;figcaption&gt;Index definition&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;But when you try to index a document with the same type,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;restaurant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;GeographyPoint&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;restaurantResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Latitude&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;restaurantResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Longitude&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;restaurant.Location = GeographyPoint.Create(restaurantResult.Value.Latitude, restaurantResult.Value.Longitude);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;You may encounter the following issue,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;error&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;code&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;The request is invalid. Details: parameters : Invalid GeoJSON. The &amp;#39;type&amp;#39; member is required, but was not found.&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{  &amp;quot;error&amp;quot;: {    &amp;quot;code&amp;quot;: &amp;quot;&amp;quot;,    &amp;quot;message&amp;quot;: &amp;quot;The request is invalid. Details: parameters : Invalid GeoJSON. The &apos;type&apos; member is required, but was not found.\r\n&amp;quot;  }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The way you can fix this is by,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add the following NuGet package,&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PackageReference&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Microsoft.Azure.Core.Spatial&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.0.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &lt;PackageReference Include=&amp;quot;Microsoft.Azure.Core.Spatial&amp;quot; Version=&amp;quot;1.0.0&amp;quot; /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And then annotate your index model to use the &lt;code&gt;MicrosoftSpatialGeoJsonConverter&lt;/code&gt; as the &lt;strong&gt;JsonConverter&lt;/strong&gt; by,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Json&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Serialization&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Azure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Core&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Serialization&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Azure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Search&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Documents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Indexes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Spatial&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RestaurantIndexModel&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;JsonConverter&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;MicrosoftSpatialGeoJsonConverter&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SimpleField&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;IsFilterable&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;IsSortable&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;GeographyPoint&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using System.Text.Json.Serialization;using Azure.Core.Serialization;using Azure.Search.Documents.Indexes;using Microsoft.Spatial;public class RestaurantIndexModel{    ...    [JsonConverter(typeof(MicrosoftSpatialGeoJsonConverter))]    [SimpleField(IsFilterable = true, IsSortable = true)]    public GeographyPoint Location { get; set; }    ...}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;That will do.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/indexed-doc.DYtbAX2p_I6XjN.webp&quot; alt=&quot;Indexd document&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1044&quot; height=&quot;690&quot;&gt;&lt;figcaption&gt;Indexd document&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to?pivots=dotnet-5-0&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-cognitive-search-geographypoint-to-geojson-in-dotnet-5&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;How to write custom converters for JSON serialization - .NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/api/overview/azure/microsoft.core.spatial-readme-pre?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-cognitive-search-geographypoint-to-geojson-in-dotnet-5&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;System.Text.Json support for Microsoft.Spatial library for .NET - Azure for .NET Developers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>dotnet</category><category>azure-cognitive-search</category><author>Abhith Rajan</author></item><item><title>NDepend - The Best-in-class Static Code Analyzer for Dotnet</title><link>https://www.abhith.net/blog/ndepend-the-best-in-class-static-code-analyzer-for-dotnet/</link><guid isPermaLink="true">https://www.abhith.net/blog/ndepend-the-best-in-class-static-code-analyzer-for-dotnet/</guid><description>NDepend is my favorite static code analyzer for dotnet. Check how I use it.</description><pubDate>Wed, 09 Dec 2020 15:11:27 GMT</pubDate><content:encoded>&lt;p&gt;If you check my &lt;a href=&quot;https://www.abhith.net/about/&quot;&gt;about&lt;/a&gt; page, I have mentioned that,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My role involves prototyping, developing backend as well as front end apps with modern workflows, frameworks. &lt;strong&gt;Keeping an eye on the patterns and organized code.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To keep the code organized and to make sure the quality is met, I depend on &lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend&lt;/a&gt; is the best-in-class static code analyzer for &lt;a href=&quot;https://www.abhith.net/topics/dotnet/&quot;&gt;dotnet&lt;/a&gt;. And the best come with a price too, i.e it’s a PAID tool. &lt;a href=&quot;https://www.linkedin.com/in/patrick-smacchia-b0123110/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Someone&lt;/a&gt; was kind enough to send me a licensed version.&lt;/p&gt;
&lt;p&gt;When I tried &lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend&lt;/a&gt; the first time, it was overwhelming, the amount of information it throws out after analysis was too much 😲.
Still am exploring many sides of the information it shares. In this post, I will share how I use it and the areas where it helps.&lt;/p&gt;
&lt;h2 id=&quot;initial-setup&quot;&gt;Initial Setup&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#initial-setup&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Once you download the package, getting started is easy. Run the app and its Start page got everything you need to get started,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/startpage_censored.CT8VsnkA_Z23Tg0C.webp&quot; alt=&quot;Start Page&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;913&quot; height=&quot;690&quot;&gt;&lt;figcaption&gt;Start Page&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;In my case, I installed the visual studio extension. With that, you can easily attach a new or existing &lt;strong&gt;NDepend project&lt;/strong&gt; with the opened solution.&lt;/p&gt;
&lt;p&gt;Eh, what is an NDepend project?&lt;/p&gt;
&lt;p&gt;This is mentioned in their getting started docs.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://www.ndepend.com/docs/getting-started-with-ndepend?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Getting Started with NDepend&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A NDepend project can be attached to several Visual Studio solutions.&lt;/li&gt;
&lt;li&gt;This is useful if you wish to analyze several .NET assemblies compiled with several Visual Studio solutions.&lt;/li&gt;
&lt;li&gt;A benefit will be the possibility to navigate across several Visual Studio solutions opened in several Visual Studio instances.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once the initial setup and first analysis of the project are done, you will be presented with the analysis report. And it will be part of its dashboard.&lt;/p&gt;
&lt;h2 id=&quot;dashboard&quot;&gt;Dashboard&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#dashboard&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I love metrics and staring at them is one of my hobbies. So do I love the &lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend&lt;/a&gt; dashboard since it shows all the metrics nicely.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/dashboard-1_censored.DKeBbAad_hbWbC.webp&quot; alt=&quot;Dashboard Metrics&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;769&quot; height=&quot;674&quot;&gt;&lt;figcaption&gt;Dashboard Metrics&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Want to check how the code evolved compared to a previous date?
Just choose the baseline to any previous analysis date.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/dashboard-diff-baseline_censored.Bdz1Nomf_1uicoF.webp&quot; alt=&quot;Different Baseline Metrics&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;763&quot; height=&quot;674&quot;&gt;&lt;figcaption&gt;Different Baseline Metrics&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Want some charts?&lt;/p&gt;
&lt;p&gt;Here we go. Following are the default ones ready for you to see the trend.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/dashboard-2.DQiKuihj_10r25C.webp&quot; alt=&quot;Dashboard Trend Charts&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;858&quot; height=&quot;893&quot;&gt;&lt;figcaption&gt;Dashboard Trend Charts&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Noticed the &lt;strong&gt;Create Trend Chart&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;We can create more trend charts as per our needs and metrics can be selected from a categorized list. In which one category I like is the &lt;strong&gt;Third-Party Usage&lt;/strong&gt;,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/Third-Party-Trend.CTZB4kG1_ZW5RKH.webp&quot; alt=&quot;Third-Party Usage Trend&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;934&quot; height=&quot;526&quot;&gt;&lt;figcaption&gt;Third-Party Usage Trend&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;So far, I just scratched the surface of the &lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Ndepend&lt;/a&gt; tool only. More about it is on the way.&lt;/p&gt;
&lt;p&gt;In the meantime check out these great articles about &lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend&lt;/a&gt;, which share a lot (really, a lot) about its features.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tomassetti.me/ndepend/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend: Static Analysis For Software Architects - Review | tomassetti.me&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.c-sharpcorner.com/article/ndepend-a-complete-static-code-analysis-tool/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend - A Complete Static Code Analysis Tool | c-sharpcorner.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://dev.to/chris_mckelt/ndepend-code-analysis-415a?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend code analysis | dev.to&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://killalldefects.com/2019/11/02/tracking-dotnet-code-quality-with-ndepend/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Tracking .NET Code Quality with NDepend - Kill All Defects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://medium.com/@alexandre.malavasi/code-quality-with-ndepend-tool-net-core-854ec070b47d?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Code Quality with NDepend tool — .NET Core&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://anthonygiretti.com/2020/05/09/integrate-ndepend-2020-into-your-net-core-projects/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Integrate NDepend 2020 into your .NET Core projects – Anthony Giretti’s .NET blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://surfingthecode.com/it-ndepends-part-3-new-dependency-graph-in-ndepend-2020.1/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=ndepend-the-best-in-class-static-code-analyzer-for-dotnet&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;It NDepends! Part 3: New dependency graph in NDepend 2020.1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>dotnet</category><category>ide</category><category>c-sharp</category><author>Abhith Rajan</author></item><item><title>Azure Logic Apps - Get Application Insights/Azure Monitor Logs Query Result on Microsoft Teams</title><link>https://www.abhith.net/blog/azure-logic-apps-get-application-insights-azure-monitor-logs-query-result-on-microsoft-teams/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-logic-apps-get-application-insights-azure-monitor-logs-query-result-on-microsoft-teams/</guid><description>Use Azure Logic Apps to create daily reports from Application Insights or Azure Monitor Logs and receive it on Microsoft Teams.</description><pubDate>Tue, 17 Nov 2020 22:11:27 GMT</pubDate><content:encoded>&lt;p&gt;I love to monitor things. &lt;strong&gt;Application Insights&lt;/strong&gt; is one of my favorite tools in this category.
Checking &lt;strong&gt;Failures&lt;/strong&gt; and &lt;strong&gt;Performance&lt;/strong&gt; sections on the Application Insights were my first thing in the morning for some time in the past.
Since some apps especially built by third parties lack Application Insights integration, we check &lt;strong&gt;Application Gateway&lt;/strong&gt; access logs too.&lt;/p&gt;
&lt;p&gt;Instead of manually checking every day, to ease the process what I did is configured a couple of logic apps to send a message on the &lt;strong&gt;Teams&lt;/strong&gt; channel with a list of results from &lt;strong&gt;Application Insights&lt;/strong&gt; and &lt;strong&gt;Azure Monitor&lt;/strong&gt; Logs.&lt;/p&gt;
&lt;p&gt;The configured daily reports include,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Application Insights - Performance&lt;/li&gt;
&lt;li&gt;Application Gateway - Failures&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The steps involved in configuring these are almost similar.&lt;/p&gt;
&lt;p&gt;First, you need to define the query, in the logs section of each service try out your query and see if the expected results coming.
Then we need to design an &lt;strong&gt;Adaptive card&lt;/strong&gt; for teams. This can be easily done on &lt;a href=&quot;https://adaptivecards.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-logic-apps-get-application-insights-azure-monitor-logs-query-result-on-microsoft-teams&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;adaptivecards.io&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;adaptive-cards&quot;&gt;Adaptive Cards&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#adaptive-cards&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Adaptive Cards are platform-agnostic snippets of UI, authored in JSON, that apps and services can openly exchange. When delivered to a specific app, the JSON is transformed into native UI that automatically adapts to its surroundings. It helps design and integrate light-weight UI for all major platforms and frameworks.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/adaptive-card-designer.rY3m477C_2xzaY.webp&quot; alt=&quot;Adaptive Cards&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;947&quot;&gt;&lt;figcaption&gt;Adaptive Cards&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The easiest way to design the adaptive card is to pick the matching sample from the &lt;a href=&quot;https://adaptivecards.io/samples/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-logic-apps-get-application-insights-azure-monitor-logs-query-result-on-microsoft-teams&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;adaptivecards.io website&lt;/a&gt; and edit it in the live designer there itself to adjust it to your needs.&lt;/p&gt;
&lt;p&gt;Couple of cards which I designed that suited my needs shared below,&lt;/p&gt;
&lt;h3 id=&quot;simple-card&quot;&gt;Simple card&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#simple-card&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/sample-card.B-QC9GUi_Z1kcslH.webp&quot; alt=&quot;A simple adaptive card&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;627&quot; height=&quot;391&quot;&gt;&lt;figcaption&gt;A simple adaptive card&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The &lt;code&gt;schema&lt;/code&gt; of the same given below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;$schema&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;AdaptiveCard&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;speak&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;lt;s&amp;gt;Order update.&amp;lt;/s&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;body&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Order Update&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;isSubtle&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;@{triggerBody()?[&amp;#39;Label&amp;#39;]}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;None&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;color&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Attention&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Medium&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Order&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;isSubtle&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;@{json(base64ToString(triggerBody()?[&amp;#39;ContentData&amp;#39;])).OrderId}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Small&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;actions&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Action.OpenUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;View&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;url&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://my-website.com/path/to/resource&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{  &amp;quot;$schema&amp;quot;: &amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;,  &amp;quot;type&amp;quot;: &amp;quot;AdaptiveCard&amp;quot;,  &amp;quot;version&amp;quot;: &amp;quot;1.2&amp;quot;,  &amp;quot;speak&amp;quot;: &amp;quot;&lt;s&gt;Order update.&lt;/s&gt;&amp;quot;,  &amp;quot;body&amp;quot;: [    {      &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,      &amp;quot;columns&amp;quot;: [        {          &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,          &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;,          &amp;quot;items&amp;quot;: [            {              &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,              &amp;quot;text&amp;quot;: &amp;quot;Order Update&amp;quot;,              &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;right&amp;quot;,              &amp;quot;isSubtle&amp;quot;: true            },            {              &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,              &amp;quot;text&amp;quot;: &amp;quot;@{triggerBody()?[&apos;Label&apos;]}&amp;quot;,              &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;,              &amp;quot;spacing&amp;quot;: &amp;quot;None&amp;quot;,              &amp;quot;size&amp;quot;: &amp;quot;Large&amp;quot;,              &amp;quot;color&amp;quot;: &amp;quot;Attention&amp;quot;            }          ]        }      ]    },    {      &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,      &amp;quot;spacing&amp;quot;: &amp;quot;Medium&amp;quot;,      &amp;quot;separator&amp;quot;: true,      &amp;quot;columns&amp;quot;: [        {          &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,          &amp;quot;width&amp;quot;: 1,          &amp;quot;items&amp;quot;: [            {              &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,              &amp;quot;text&amp;quot;: &amp;quot;Order&amp;quot;,              &amp;quot;isSubtle&amp;quot;: true,              &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;            },            {              &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,              &amp;quot;text&amp;quot;: &amp;quot;@{json(base64ToString(triggerBody()?[&apos;ContentData&apos;])).OrderId}&amp;quot;,              &amp;quot;spacing&amp;quot;: &amp;quot;Small&amp;quot;            }          ]        }      ]    }  ],  &amp;quot;actions&amp;quot;: [    {      &amp;quot;type&amp;quot;: &amp;quot;Action.OpenUrl&amp;quot;,      &amp;quot;title&amp;quot;: &amp;quot;View&amp;quot;,      &amp;quot;url&amp;quot;: &amp;quot;https://my-website.com/path/to/resource&amp;quot;    }  ]}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The above card is used to notify when there is a new message in an &lt;strong&gt;Azure Service Bus Topic&lt;/strong&gt; and the &lt;code&gt;@{triggerBody()?[&amp;#39;Label&amp;#39;]}&lt;/code&gt; is used to get the &lt;strong&gt;Message Label&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Similarly, &lt;code&gt;@{json(base64ToString(triggerBody()?[&amp;#39;ContentData&amp;#39;])).OrderId}&lt;/code&gt; is used to get the &lt;code&gt;OrderId&lt;/code&gt; from the message body.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Our focus in this article is on a card with a list of items.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;card-with-a-list-of-items&quot;&gt;Card with a list of items&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#card-with-a-list-of-items&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Initial design with a single row of information will look like,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/card-with-list-of-items-1.Bx8NNBQV_ZEickV.webp&quot; alt=&quot;Card with single row&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;551&quot; height=&quot;386&quot;&gt;&lt;figcaption&gt;Card with single row&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And it’s &lt;code&gt;schema&lt;/code&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot; style=&quot;--lnWidth:3ch&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;AdaptiveCard&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;body&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;style&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;emphasis&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;**Performance (App Insights)**&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;bleed&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;style&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;emphasis&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Operation Name&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Count&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Avg&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Percentiles 50 / 99&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;bleed&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;some operation&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;wrap&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Small&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;my app cloud role name&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;wrap&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;321 &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;color&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Attention&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;123ms&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Small&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;456 / 789&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;$schema&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;fallbackText&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This card requires Adaptive Cards v1.2 support to be rendered properly.&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{  &amp;quot;type&amp;quot;: &amp;quot;AdaptiveCard&amp;quot;,  &amp;quot;body&amp;quot;: [    {      &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,      &amp;quot;style&amp;quot;: &amp;quot;emphasis&amp;quot;,      &amp;quot;items&amp;quot;: [        {          &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,          &amp;quot;columns&amp;quot;: [            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;size&amp;quot;: &amp;quot;Large&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;**Performance (App Insights)**&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            }          ]        }      ],      &amp;quot;bleed&amp;quot;: true    },    {      &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,      &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,      &amp;quot;style&amp;quot;: &amp;quot;emphasis&amp;quot;,      &amp;quot;items&amp;quot;: [        {          &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,          &amp;quot;columns&amp;quot;: [            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;Operation Name&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            },            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;Count&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;            },            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;Avg&amp;quot;,                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                },                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;Percentiles 50 / 99&amp;quot;,                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;,              &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;            }          ]        }      ],      &amp;quot;bleed&amp;quot;: true    },    {      &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,      &amp;quot;items&amp;quot;: [        {          &amp;quot;columns&amp;quot;: [            {              &amp;quot;items&amp;quot;: [                {                  &amp;quot;text&amp;quot;: &amp;quot;some operation&amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;wrap&amp;quot;: true                },                {                  &amp;quot;size&amp;quot;: &amp;quot;Small&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;my app cloud role name&amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;wrap&amp;quot;: true                }              ],              &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            },            {              &amp;quot;items&amp;quot;: [                {                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;,                  &amp;quot;separator&amp;quot;: true,                  &amp;quot;text&amp;quot;: &amp;quot;321 &amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;                }              ],              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;            },            {              &amp;quot;items&amp;quot;: [                {                  &amp;quot;color&amp;quot;: &amp;quot;Attention&amp;quot;,                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;123ms&amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;                },                {                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;,                  &amp;quot;size&amp;quot;: &amp;quot;Small&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;456 / 789&amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;                }              ],              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            }          ],          &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;        }      ],      &amp;quot;separator&amp;quot;: true    }  ],  &amp;quot;$schema&amp;quot;: &amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;,  &amp;quot;version&amp;quot;: &amp;quot;1.2&amp;quot;,  &amp;quot;fallbackText&amp;quot;: &amp;quot;This card requires Adaptive Cards v1.2 support to be rendered properly.&amp;quot;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the schema, there are three &lt;strong&gt;Container&lt;/strong&gt;,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First one contains the main heading&lt;/li&gt;
&lt;li&gt;Second column headings&lt;/li&gt;
&lt;li&gt;The last one with the data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will be dynamically populating the third container items. And the result looks like,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/app-insights-performance.eeIVGkKO_Z1H0swK.webp&quot; alt=&quot;Card with rows&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;631&quot; height=&quot;513&quot;&gt;&lt;figcaption&gt;Card with rows&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And for a reference, A slightly altered design also given below,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/card-with-list-of-items-2.CRZ93eax_Z1sjN1S.webp&quot; alt=&quot;Card with a row of data&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;565&quot; height=&quot;385&quot;&gt;&lt;figcaption&gt;Card with a row of data&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And the &lt;code&gt;schema&lt;/code&gt; for this one is,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot; style=&quot;--lnWidth:3ch&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;AdaptiveCard&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;body&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;style&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;emphasis&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;**Application Gateway - Failed Requests**&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;bleed&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;style&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;emphasis&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;URL&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Status&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Count&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;bleed&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/path/to/resource&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;wrap&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;color&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Attention&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Small&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;demo.myapp.com&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;wrap&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;404 &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;123 &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;$schema&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;fallbackText&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This card requires Adaptive Cards v1.2 support to be rendered properly.&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{  &amp;quot;type&amp;quot;: &amp;quot;AdaptiveCard&amp;quot;,  &amp;quot;body&amp;quot;: [    {      &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,      &amp;quot;style&amp;quot;: &amp;quot;emphasis&amp;quot;,      &amp;quot;items&amp;quot;: [        {          &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,          &amp;quot;columns&amp;quot;: [            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;size&amp;quot;: &amp;quot;large&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;**Application Gateway - Failed Requests**&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            }          ]        }      ],      &amp;quot;bleed&amp;quot;: true    },    {      &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,      &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,      &amp;quot;style&amp;quot;: &amp;quot;emphasis&amp;quot;,      &amp;quot;items&amp;quot;: [        {          &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,          &amp;quot;columns&amp;quot;: [            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;URL&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            },            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;Status&amp;quot;,                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;            },            {              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;items&amp;quot;: [                {                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;Count&amp;quot;,                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                }              ],              &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;            }          ]        }      ],      &amp;quot;bleed&amp;quot;: true    },    {      &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,      &amp;quot;items&amp;quot;: [        {          &amp;quot;columns&amp;quot;: [            {              &amp;quot;items&amp;quot;: [                {                  &amp;quot;text&amp;quot;: &amp;quot;/path/to/resource&amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;wrap&amp;quot;: true                },                {                  &amp;quot;color&amp;quot;: &amp;quot;Attention&amp;quot;,                  &amp;quot;size&amp;quot;: &amp;quot;Small&amp;quot;,                  &amp;quot;text&amp;quot;: &amp;quot;demo.myapp.com&amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                  &amp;quot;wrap&amp;quot;: true                }              ],              &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;            },            {              &amp;quot;items&amp;quot;: [                {                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;,                  &amp;quot;separator&amp;quot;: true,                  &amp;quot;text&amp;quot;: &amp;quot;404 &amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;                }              ],              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;            },            {              &amp;quot;items&amp;quot;: [                {                  &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;,                  &amp;quot;separator&amp;quot;: true,                  &amp;quot;text&amp;quot;: &amp;quot;123 &amp;quot;,                  &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;                }              ],              &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,              &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;            }          ],          &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;        }      ],      &amp;quot;separator&amp;quot;: true    }  ],  &amp;quot;$schema&amp;quot;: &amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;,  &amp;quot;version&amp;quot;: &amp;quot;1.2&amp;quot;,  &amp;quot;fallbackText&amp;quot;: &amp;quot;This card requires Adaptive Cards v1.2 support to be rendered properly.&amp;quot;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;When fed with data, the result is,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/application-gateway-failed-requests.DhI31vpZ_1QeVK2.webp&quot; alt=&quot;Application Gateway - Failed Requests&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;612&quot; height=&quot;531&quot;&gt;&lt;figcaption&gt;Application Gateway - Failed Requests&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Once we are done with adaptive card design, it’s time to move on to Logic App designer.&lt;/p&gt;
&lt;h2 id=&quot;logic-app&quot;&gt;Logic App&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#logic-app&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The only tricky part of the Logic app was to generate the rows of items. The other steps are pretty much straight forward. And the overall steps are,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/all-steps.JXyCHdi5_ZuQYaK.webp&quot; alt=&quot;All steps&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1077&quot; height=&quot;637&quot;&gt;&lt;figcaption&gt;All steps&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Let’s go through each step.&lt;/p&gt;
&lt;h3 id=&quot;1-recurrence-trigger&quot;&gt;1. Recurrence trigger&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#1-recurrence-trigger&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Configured it to trigger daily.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/1-recurrence.BugsZB5k_wmhEf.webp&quot; alt=&quot;Recurrence trigger&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;616&quot; height=&quot;193&quot;&gt;&lt;figcaption&gt;Recurrence trigger&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;2-getting-a-query-result&quot;&gt;2. Getting a query result&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2-getting-a-query-result&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;For Application Insights query results, use the &lt;strong&gt;Application Insights&lt;/strong&gt; connector and action &lt;strong&gt;Run Analytics Query&lt;/strong&gt;&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/2-run-analytics-query.mEnDcN6D_Z1zEhFi.webp&quot; alt=&quot;Run Analytics Query&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;607&quot; height=&quot;407&quot;&gt;&lt;figcaption&gt;Run Analytics Query&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h4 id=&quot;query-to-get-performance-metrics-from-application-insights&quot;&gt;Query to get performance metrics from Application insights&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#query-to-get-performance-metrics-from-application-insights&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;let dataset=requests&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| where timestamp &amp;gt; ago(1d);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;dataset&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| summarize count_=sum(itemCount), avg(duration), percentiles(duration, 50, 99) by operation_Name, cloud_RoleName&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| union(dataset&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| summarize count_=sum(itemCount), avg_duration=avg(duration), percentiles(duration, 50, 99)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| extend operation_Name=&amp;quot;Overall&amp;quot;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| top 30 by avg_duration desc&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;let dataset=requests| where timestamp &gt; ago(1d);dataset| summarize count_=sum(itemCount), avg(duration), percentiles(duration, 50, 99) by operation_Name, cloud_RoleName| union(dataset| summarize count_=sum(itemCount), avg_duration=avg(duration), percentiles(duration, 50, 99)| extend operation_Name=&amp;quot;Overall&amp;quot;)| top 30 by avg_duration desc&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And in case of &lt;strong&gt;Application Gateway&lt;/strong&gt; access logs, we need to use the &lt;strong&gt;Azure Monitor Logs&lt;/strong&gt; connector and it’s &lt;strong&gt;Run query and list results&lt;/strong&gt; action, details &lt;a href=&quot;https://docs.microsoft.com/en-us/connectors/azuremonitorlogs/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-logic-apps-get-application-insights-azure-monitor-logs-query-result-on-microsoft-teams#run-query-and-list-results&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/azure-monitor.C2cA5JX9_Z1ou9TT.webp&quot; alt=&quot;Run query and list results&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;607&quot; height=&quot;606&quot;&gt;&lt;figcaption&gt;Run query and list results&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;em&gt;Note: &lt;strong&gt;Diagnostic setting&lt;/strong&gt; for &lt;strong&gt;Application Gateway&lt;/strong&gt; should be configured to feed access log data to the log analytics workspace before.&lt;/em&gt;&lt;/p&gt;
&lt;h4 id=&quot;query-to-get-failed-requests-summary-from-application-gateway&quot;&gt;Query to get failed requests summary from Application Gateway&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#query-to-get-failed-requests-summary-from-application-gateway&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;AzureDiagnostics&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| where ResourceProvider == &amp;quot;MICROSOFT.NETWORK&amp;quot; and Category == &amp;quot;ApplicationGatewayAccessLog&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| where httpStatus_d &amp;gt;= 400&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| where TimeGenerated &amp;gt; ago(1d)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| summarize count_= count(httpStatus_d) by httpStatus_d,requestUri_s, host_s&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| order by count_ desc&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;| top 30 by count_&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;AzureDiagnostics| where ResourceProvider == &amp;quot;MICROSOFT.NETWORK&amp;quot; and Category == &amp;quot;ApplicationGatewayAccessLog&amp;quot;| where httpStatus_d &gt;= 400| where TimeGenerated &gt; ago(1d)| summarize count_= count(httpStatus_d) by httpStatus_d,requestUri_s, host_s| order by count_ desc| top 30 by count_&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;aside class=&quot;alert alert--info&quot; role=&quot;note&quot; aria-label=&quot;Info&quot;&gt; &lt;p class=&quot;alert__title&quot;&gt;&lt;span class=&quot;alert__icon&quot; aria-hidden=&quot;true&quot;&gt;ℹ&lt;/span&gt;Info&lt;/p&gt; &lt;div class=&quot;alert__body&quot;&gt;&lt;p&gt;In both queries, I am limiting the number of results since the Teams post
message action has a message size limit.&lt;/p&gt;&lt;/div&gt; &lt;/aside&gt;
&lt;h3 id=&quot;3-initialize-an-array-variable&quot;&gt;3. Initialize an array variable&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#3-initialize-an-array-variable&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Since we are expecting a list of rows from the above query, to map it to rows in the Teams card message, we use this.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/3-initialize-variable.BBuhRS30_1B63Dv.webp&quot; alt=&quot;Initialize an array variable&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;617&quot; height=&quot;172&quot;&gt;&lt;figcaption&gt;Initialize an array variable&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;4-for-each-row-in-the-query-result-we-map-the-result-item-to-an-adaptive-card-row&quot;&gt;4. For each row in the query result, we map the result item to an Adaptive card row.&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#4-for-each-row-in-the-query-result-we-map-the-result-item-to-an-adaptive-card-row&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/4-for-each.qJ6gz_5I_1JsYp3.webp&quot; alt=&quot;For each&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;638&quot; height=&quot;847&quot;&gt;&lt;figcaption&gt;For each&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Here the &lt;code&gt;value&lt;/code&gt; is an array of query results from step 2.
And for each item in the array, we are appending the &lt;strong&gt;JSON object that represents the row of data in the adaptive card&lt;/strong&gt; (under the third &lt;strong&gt;Container&lt;/strong&gt; items).&lt;/p&gt;
&lt;h3 id=&quot;5-append-the-rows-to-the-rest-of-the-adaptive-card-schema-in-the-teams-connector-channel&quot;&gt;5. Append the rows to the rest of the Adaptive card schema in the Teams connector channel.&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#5-append-the-rows-to-the-rest-of-the-adaptive-card-schema-in-the-teams-connector-channel&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/5-post-message.DXw519ob_1c8evW.webp&quot; alt=&quot;Initialize an array variable&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;605&quot; height=&quot;670&quot;&gt;&lt;figcaption&gt;Initialize an array variable&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The full &lt;code&gt;Message&lt;/code&gt; is,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;AdaptiveCard&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;body&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;style&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;emphasis&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;size&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;**Performance (App Insights)**&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;bleed&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;style&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;emphasis&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ColumnSet&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;columns&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;spacing&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Large&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Operation Name&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Count&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Column&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;weight&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Bolder&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Avg&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Percentiles 50 / 99&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;stretch&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;horizontalAlignment&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Right&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;bleed&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;items&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;variables(&amp;#39;rows&amp;#39;)&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;separator&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;$schema&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;fallbackText&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This card requires Adaptive Cards v1.2 support to be rendered properly.&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{    &amp;quot;type&amp;quot;: &amp;quot;AdaptiveCard&amp;quot;,    &amp;quot;body&amp;quot;: [        {            &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,            &amp;quot;style&amp;quot;: &amp;quot;emphasis&amp;quot;,            &amp;quot;items&amp;quot;: [                {                    &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,                    &amp;quot;columns&amp;quot;: [                        {                            &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,                            &amp;quot;items&amp;quot;: [                                {                                    &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                                    &amp;quot;size&amp;quot;: &amp;quot;Large&amp;quot;,                                    &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                                    &amp;quot;text&amp;quot;: &amp;quot;**Performance (App Insights)**&amp;quot;                                }                            ],                            &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;                        }                    ]                }            ],            &amp;quot;bleed&amp;quot;: true        },        {            &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,            &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,            &amp;quot;style&amp;quot;: &amp;quot;emphasis&amp;quot;,            &amp;quot;items&amp;quot;: [                {                    &amp;quot;type&amp;quot;: &amp;quot;ColumnSet&amp;quot;,                    &amp;quot;columns&amp;quot;: [                        {                            &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,                            &amp;quot;spacing&amp;quot;: &amp;quot;Large&amp;quot;,                            &amp;quot;items&amp;quot;: [                                {                                    &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                                    &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                                    &amp;quot;text&amp;quot;: &amp;quot;Operation Name&amp;quot;                                }                            ],                            &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;                        },                        {                            &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,                            &amp;quot;items&amp;quot;: [                                {                                    &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                                    &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                                    &amp;quot;text&amp;quot;: &amp;quot;Count&amp;quot;                                }                            ],                            &amp;quot;width&amp;quot;: &amp;quot;auto&amp;quot;                        },                        {                            &amp;quot;type&amp;quot;: &amp;quot;Column&amp;quot;,                            &amp;quot;items&amp;quot;: [                                {                                    &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                                    &amp;quot;weight&amp;quot;: &amp;quot;Bolder&amp;quot;,                                    &amp;quot;text&amp;quot;: &amp;quot;Avg&amp;quot;,                                    &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                                },                                {                                    &amp;quot;type&amp;quot;: &amp;quot;TextBlock&amp;quot;,                                    &amp;quot;text&amp;quot;: &amp;quot;Percentiles 50 / 99&amp;quot;,                                    &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                                }                            ],                            &amp;quot;width&amp;quot;: &amp;quot;stretch&amp;quot;,                            &amp;quot;horizontalAlignment&amp;quot;: &amp;quot;Right&amp;quot;                        }                    ]                }            ],            &amp;quot;bleed&amp;quot;: true        },        {            &amp;quot;type&amp;quot;: &amp;quot;Container&amp;quot;,            &amp;quot;items&amp;quot;: @{variables(&apos;rows&apos;)},            &amp;quot;separator&amp;quot;: true        }    ],    &amp;quot;$schema&amp;quot;: &amp;quot;http://adaptivecards.io/schemas/adaptive-card.json&amp;quot;,    &amp;quot;version&amp;quot;: &amp;quot;1.2&amp;quot;,    &amp;quot;fallbackText&amp;quot;: &amp;quot;This card requires Adaptive Cards v1.2 support to be rendered properly.&amp;quot;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Notice the &lt;code&gt;@{variables(&amp;#39;rows&amp;#39;)}&lt;/code&gt;, that’s where the magic happens. So the array we prepared in the previous step gets appended here, and hence we get to see the multiple rows in the adaptive card. To understand better, cross-check the above one with the original &lt;code&gt;schema&lt;/code&gt; mentioned in the very beginning &lt;a href=&quot;#card-with-a-list-of-items&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;aside class=&quot;alert alert--info&quot; role=&quot;note&quot; aria-label=&quot;Info&quot;&gt; &lt;p class=&quot;alert__title&quot;&gt;&lt;span class=&quot;alert__icon&quot; aria-hidden=&quot;true&quot;&gt;ℹ&lt;/span&gt;Info&lt;/p&gt; &lt;div class=&quot;alert__body&quot;&gt;&lt;p&gt;The adaptive card schema version kept to 1.2 even though the latest version is
1.3 since Microsoft Teams currently does not support 1.3. That may change in
the future.&lt;/p&gt;&lt;/div&gt; &lt;/aside&gt;
&lt;p&gt;That’s all. Run the logic app and see a message popping up on Teams.&lt;/p&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Simplifying work by automating routine tasks 🧑‍💻&lt;a href=&quot;https://x.com/hashtag/azurelogicapps?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#azurelogicapps&lt;/a&gt;&lt;br&gt; + &lt;br&gt;( &lt;a href=&quot;https://x.com/hashtag/azuremonitor?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#azuremonitor&lt;/a&gt; ||  &lt;a href=&quot;https://x.com/hashtag/applicationinsights?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#applicationinsights&lt;/a&gt;) &lt;br&gt;👇&lt;br&gt; &lt;a href=&quot;https://x.com/hashtag/microsoftteams?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#microsoftteams&lt;/a&gt;&lt;a href=&quot;https://t.co/ZyZc7Kh85i&quot;&gt;https://t.co/ZyZc7Kh85i&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1330952694161432581?ref_src=twsrc%5Etfw&quot;&gt;November 23, 2020&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>azure-logic-apps</category><category>app-insights</category><category>devops</category><author>Abhith Rajan</author></item><item><title>Microsoft Clarity - Setting Up with GatsbyJS &amp; First Impressions</title><link>https://www.abhith.net/blog/microsoft-clarity-setting-up-with-gatsbyjs-and-first-impressions/</link><guid isPermaLink="true">https://www.abhith.net/blog/microsoft-clarity-setting-up-with-gatsbyjs-and-first-impressions/</guid><description>Add Microsoft Clarity analytics to the GatsbyJS website in a simple step. Also, a quick look at what Microsoft Clarity offers.</description><pubDate>Wed, 04 Nov 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I’m impressed. From a long-term &lt;strong&gt;Google Analytics&lt;/strong&gt; user point, &lt;strong&gt;Clarity&lt;/strong&gt; provides more info about the actual user interactions on the website.&lt;/p&gt;
&lt;p&gt;Getting started was pretty easy.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sign-up &lt;a href=&quot;https://clarity.microsoft.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=microsoft-clarity-setting-up-with-gatsbyjs-and-first-impressions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;, it’s &lt;strong&gt;FREE&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create a Clarity project for your website.&lt;/li&gt;
&lt;li&gt;Integrate with your website.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are already some direct integrations available. In my case, I have opted for the &lt;code&gt;Install tracking code manually&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;integrating-microsoft-clarity-with-gatsbyjs-website&quot;&gt;Integrating Microsoft Clarity with GatsbyJS website&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#integrating-microsoft-clarity-with-gatsbyjs-website&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;official-plugin&quot;&gt;Official plugin&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#official-plugin&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;
Navigate to the root of your Gatsby project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;
Open your preferred command line and run one of the following commands.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;install&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;gatsby-plugin-clarity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;npm install gatsby-plugin-clarity&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;gatsby-plugin-clarity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;yarn add gatsby-plugin-clarity&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;
Navigate to gatsby-config.js.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;
Add the following to your plugins array&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;resolve&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`gatsby-plugin-clarity`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// String value for your clarity project ID&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;clarity_project_id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;YOUR&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;CLARITY&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;PROJECT&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Boolean value for enabling clarity while developing&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// true will enable clarity tracking code on both development and production environments&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// false will enable clarity tracking code on production environment only&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;enable_on_dev_env&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{    resolve: `gatsby-plugin-clarity`,    options: {      // String value for your clarity project ID      clarity_project_id: YOUR-CLARITY-PROJECT-ID,      // Boolean value for enabling clarity while developing      // true will enable clarity tracking code on both development and production environments      // false will enable clarity tracking code on production environment only      enable_on_dev_env: true    },}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The Clarity tracking code is now installed.&lt;/p&gt;
&lt;h3 id=&quot;legacy-way-of-installing-deprecated&quot;&gt;Legacy way of installing [DEPRECATED]&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#legacy-way-of-installing-deprecated&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It is very similar to adding &lt;strong&gt;Google AdSense&lt;/strong&gt; as described in my older post here,&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://www.abhith.net/blog/gatsbyjs-add-google-adsense/&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;GatsbyJS - Add Google AdSense&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All you have to do is, update your &lt;code&gt;gatsby-ssr.js&lt;/code&gt; with the below code (if there is no &lt;code&gt;gatsby-ssr.js&lt;/code&gt; file on your project directory then create one at the root).&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;React&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;react&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;onRenderBody&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; ({ &lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70&quot;&gt;setHeadComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70&quot;&gt;setPostBodyComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; }) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;pluginOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;head: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;process&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;env&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;NODE_ENV&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`production`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;setComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;pluginOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;head&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;setHeadComponents&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;setPostBodyComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;setComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;([&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;script&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;async&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;__html: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;(function(c,l,a,r,i,t,y){&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;t=l.createElement(r);t.async=1;t.src=&amp;quot;https://www.clarity.ms/tag/&amp;quot;+i;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;})(window, document, &amp;quot;clarity&amp;quot;, &amp;quot;script&amp;quot;, &amp;quot;&amp;lt;YOUR-CLARITY-PROJECT-ID&amp;gt;&amp;quot;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;import React from &amp;quot;react&amp;quot;;export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) =&gt; {  const pluginOptions = {    head: true,  };  if (process.env.NODE_ENV !== `production`) {    return null;  }  const setComponents = pluginOptions.head    ? setHeadComponents    : setPostBodyComponents;  return setComponents([    &lt;script      async      type=&amp;quot;text/javascript&amp;quot;      dangerouslySetInnerHTML={{        __html: `      (function(c,l,a,r,i,t,y){        c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};        t=l.createElement(r);t.async=1;t.src=&amp;quot;https://www.clarity.ms/tag/&amp;quot;+i;        y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);    })(window, document, &amp;quot;clarity&amp;quot;, &amp;quot;script&amp;quot;, &amp;quot;&lt;YOUR-CLARITY-PROJECT-ID&gt;&amp;quot;);      `,      }}    /&gt;,  ]);};&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;lt;YOUR-CLARITY-PROJECT-ID&amp;gt;&lt;/code&gt; with your &lt;strong&gt;Clarity&lt;/strong&gt; project ID.
The embedded script you can view at &lt;code&gt;Clarity Project &amp;gt; Settings &amp;gt; Setup &amp;gt; Install tracking code manually&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;onRenderBody&lt;/strong&gt; is a Gatsby SSR API, called after every page Gatsby server renders while building HTML so you can set head and body components to be rendered in your html.js.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://www.gatsbyjs.org/docs/ssr-apis/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=microsoft-clarity-setting-up-with-gatsbyjs-and-first-impressions#onRenderBody&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SSR APIs | GatsbyJS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Build the project (&lt;code&gt;gatsby build&lt;/code&gt;) and see whether the AdSense snippet is present in the build output HTML (&lt;code&gt;gatsby serve&lt;/code&gt;).
You can also refer to the same used in my repo itself.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://github.com/abhith/abhith.net/blob/master/gatsby-ssr.js&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;abhith/abhith.net&lt;/a&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Once you have done the integrations and if the site is live, after a few minutes you will start seeing the metrics getting populated in the &lt;strong&gt;Clarity Dashboard&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&quot;dashboard&quot;&gt;Dashboard&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#dashboard&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It is pretty clean and minimal. And it looks like,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/dashboard.C2oEreSB_Hy1i6.webp&quot; alt=&quot;Dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1838&quot; height=&quot;1451&quot;&gt;&lt;figcaption&gt;Dashboard&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;recordings&quot;&gt;Recordings&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#recordings&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It’s a dope feature. Exactly what each user did, like actual screencast of user interactions on that page with clicks and all. There is a sound indication for mouse clicks as well, Nice.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/recordings.Bl3CYzXL_Z1pl2AF.webp&quot; alt=&quot;Recordings&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1901&quot; height=&quot;936&quot;&gt;&lt;figcaption&gt;Recordings&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;It will help website managers to understand how the user is interacting with each element/section on the web page.&lt;/p&gt;
&lt;p&gt;Also, sensitive data masking and other privacy concern are taken care of by &lt;strong&gt;Clarity&lt;/strong&gt; automatically.&lt;/p&gt;
&lt;h2 id=&quot;heatmaps&quot;&gt;Heatmaps&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#heatmaps&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As the name suggests, most interacted areas will be visualized here.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/click-heatmap.BGzU3iWG_Z1V5fMC.webp&quot; alt=&quot;Heatmaps&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;947&quot;&gt;&lt;figcaption&gt;Heatmaps&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;If you are concerned about the data it collects, privacy, etc, one fact is that it is an opensource project. So you can have a look at it,&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://github.com/microsoft/clarity?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=microsoft-clarity-setting-up-with-gatsbyjs-and-first-impressions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;GitHub-microsoft/clarity&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I’m impressed with &lt;strong&gt;Microsoft Clarity&lt;/strong&gt;. It’s not(yet) a replacement for &lt;strong&gt;Google Analytics&lt;/strong&gt;, but I would recommend you to try it out and see how you can make use of it.&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/clarity/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=microsoft-clarity-setting-up-with-gatsbyjs-and-first-impressions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Clarity Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Microsoft Clarity - I&amp;#39;m impressed&lt;br&gt; &lt;a href=&quot;https://t.co/JqYbcIZlwz&quot;&gt;https://t.co/JqYbcIZlwz&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/Analytics?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#Analytics&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/MicrosoftClarity?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#MicrosoftClarity&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1323728937831305220?ref_src=twsrc%5Etfw&quot;&gt;November 3, 2020&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>analytics</category><author>Abhith Rajan</author></item><item><title>DNS Lookup</title><link>https://www.abhith.net/snippets/linux/dns-lookup/</link><guid isPermaLink="true">https://www.abhith.net/snippets/linux/dns-lookup/</guid><description>Uses curl to get a response from the specified domain. Useful for identifying the intermittent DNS timeout as well.</description><pubDate>Wed, 23 Sep 2020 09:26:00 GMT</pubDate><content:encoded>&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;1..10}&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;do&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-k&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;/dev/null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-s&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-w&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;DNS-Lookup [%{time_namelookup}] Time-Connect [%{time_connect}] Time-PreTransfer [%{time_pretransfer}] Time-StartTransfer [%{time_starttransfer}] Total-Time [%{time_total}] Response-Code [%{http_code}]\n&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;https://www.abhith.net&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;done&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;for i in {1..10}; do curl -k -o /dev/null -s -w &amp;quot;DNS-Lookup [%{time_namelookup}] Time-Connect [%{time_connect}] Time-PreTransfer [%{time_pretransfer}] Time-StartTransfer [%{time_starttransfer}] Total-Time [%{time_total}] Response-Code [%{http_code}]\n&amp;quot; https://www.abhith.net; done&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;sample-output&quot;&gt;Sample Output&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#sample-output&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;root@pod-name-69d96c5494-bd97v:/app#&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;{1..10}&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;do&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-k&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;/dev/null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-s&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-w&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;DNS-Lookup [%{time_namelookup}] Time-Connect [%{time_connect}] Time-PreTransfer [%{time_pretransfer}] Time-StartTransfer [%{time_s&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tarttransfer}] Total-Time [%{time_total}] Response-Code [%{http_code}]\n&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;https://www.abhith.net&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;done&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [5.465393] Time-Connect [5.542967] Time-PreTransfer [5.626041] Time-StartTransfer [6.024135] Total-Time [6.261565] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.458571] Time-Connect [0.536812] Time-PreTransfer [0.619370] Time-StartTransfer [0.960386] Total-Time [1.199219] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.005218] Time-Connect [0.083305] Time-PreTransfer [0.167227] Time-StartTransfer [0.505865] Total-Time [0.745717] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [5.066491] Time-Connect [5.144106] Time-PreTransfer [5.227078] Time-StartTransfer [5.585845] Total-Time [5.825170] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.004125] Time-Connect [0.081587] Time-PreTransfer [0.165687] Time-StartTransfer [0.246201] Total-Time [0.481887] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.005214] Time-Connect [0.083619] Time-PreTransfer [0.168375] Time-StartTransfer [0.510846] Total-Time [0.823167] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.016983] Time-Connect [0.094932] Time-PreTransfer [0.177621] Time-StartTransfer [0.522677] Total-Time [0.758300] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.005210] Time-Connect [0.083526] Time-PreTransfer [0.166203] Time-StartTransfer [0.246943] Total-Time [0.481547] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.010488] Time-Connect [0.088643] Time-PreTransfer [0.172099] Time-StartTransfer [0.517206] Total-Time [0.829188] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DNS-Lookup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [0.005282] Time-Connect [0.083156] Time-PreTransfer [0.167259] Time-StartTransfer [0.499211] Total-Time [0.734148] Response-Code [200]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;root@pod-name-69d96c5494-bd97v:/app#&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;root@pod-name-69d96c5494-bd97v:/app# for i in {1..10}; do curl -k -o /dev/null -s -w &amp;quot;DNS-Lookup [%{time_namelookup}] Time-Connect [%{time_connect}] Time-PreTransfer [%{time_pretransfer}] Time-StartTransfer [%{time_starttransfer}] Total-Time [%{time_total}] Response-Code [%{http_code}]\n&amp;quot; https://www.abhith.net; doneDNS-Lookup [5.465393] Time-Connect [5.542967] Time-PreTransfer [5.626041] Time-StartTransfer [6.024135] Total-Time [6.261565] Response-Code [200]DNS-Lookup [0.458571] Time-Connect [0.536812] Time-PreTransfer [0.619370] Time-StartTransfer [0.960386] Total-Time [1.199219] Response-Code [200]DNS-Lookup [0.005218] Time-Connect [0.083305] Time-PreTransfer [0.167227] Time-StartTransfer [0.505865] Total-Time [0.745717] Response-Code [200]DNS-Lookup [5.066491] Time-Connect [5.144106] Time-PreTransfer [5.227078] Time-StartTransfer [5.585845] Total-Time [5.825170] Response-Code [200]DNS-Lookup [0.004125] Time-Connect [0.081587] Time-PreTransfer [0.165687] Time-StartTransfer [0.246201] Total-Time [0.481887] Response-Code [200]DNS-Lookup [0.005214] Time-Connect [0.083619] Time-PreTransfer [0.168375] Time-StartTransfer [0.510846] Total-Time [0.823167] Response-Code [200]DNS-Lookup [0.016983] Time-Connect [0.094932] Time-PreTransfer [0.177621] Time-StartTransfer [0.522677] Total-Time [0.758300] Response-Code [200]DNS-Lookup [0.005210] Time-Connect [0.083526] Time-PreTransfer [0.166203] Time-StartTransfer [0.246943] Total-Time [0.481547] Response-Code [200]DNS-Lookup [0.010488] Time-Connect [0.088643] Time-PreTransfer [0.172099] Time-StartTransfer [0.517206] Total-Time [0.829188] Response-Code [200]DNS-Lookup [0.005282] Time-Connect [0.083156] Time-PreTransfer [0.167259] Time-StartTransfer [0.499211] Total-Time [0.734148] Response-Code [200]root@pod-name-69d96c5494-bd97v:/app#&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Noticed the 5sec+ responses above?
Explore more about the intermittent delay in Kubernetes in these articles,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/kubernetes/issues/56903?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=snippets&amp;amp;utm_content=dns-lookup&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;DNS intermittent delays of 5s · Issue #56903 · kubernetes/kubernetes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.quentin-machu.fr/2018/06/24/5-15s-dns-lookups-on-kubernetes/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=snippets&amp;amp;utm_content=dns-lookup&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;5 – 15s DNS lookups on Kubernetes? - Quentin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>linux</category><author>Abhith Rajan</author></item><item><title>Azure Application Gateway - List of Failed Requests</title><link>https://www.abhith.net/blog/azure-application-gateway-list-of-failed-requests/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-application-gateway-list-of-failed-requests/</guid><description>Get an insight about the failed requests in the Azure Application Gateway.</description><pubDate>Sat, 19 Sep 2020 15:11:27 GMT</pubDate><content:encoded>&lt;p&gt;Azure application gateway serves an important role in our infrastructure. All the public inbound traffic happening through Application Gateway.&lt;/p&gt;
&lt;p&gt;Part of monitoring, a year ago, I asked the following question in &lt;a href=&quot;https://stackoverflow.com/questions/57369646/list-of-failed-requests-in-azure-application-gateway?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-application-gateway-list-of-failed-requests&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SO&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;“We can see the failed request count in Azure application gateway but how can we see the list of failed requests in the Logs section?
All the logs enabled in Diagnostics settings of Application Gateway.
We need to see at least the requested path (URL) and the response code for the failed requests in the Logs section in the Application Gateway.
Because of the way access log stored in the storage account (folder structure), it is a bit difficult to access the required data through the storage account.”&lt;/p&gt;
&lt;p&gt;At that time there was no good solution for that. But that changed.&lt;/p&gt;
&lt;h2 id=&quot;list-of-failed-requests&quot;&gt;List of failed requests&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#list-of-failed-requests&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;AzureDiagnostics&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; ResourceProvider &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;MICROSOFT.NETWORK&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; Category &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ApplicationGatewayAccessLog&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; httpStatus_d &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;400&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| project httpStatus_d, requestUri_s, TimeGenerated&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;AzureDiagnostics| where ResourceProvider == &amp;quot;MICROSOFT.NETWORK&amp;quot; and Category == &amp;quot;ApplicationGatewayAccessLog&amp;quot;| where httpStatus_d &gt;= 400| project httpStatus_d, requestUri_s, TimeGenerated&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/azure-application-gateway-list-of-failed-requests_censored.mnKnR1Tb_2oLYrb.webp&quot; alt=&quot;List of failed requests&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1009&quot; height=&quot;829&quot;&gt;&lt;figcaption&gt;List of failed requests&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Also, you can include other fields like &lt;code&gt;host_s&lt;/code&gt; in the query which will be useful if you have multiple domains configured in the Application Gateway.&lt;/p&gt;
&lt;p&gt;You can do much more with the data. In our case, we added a widget to our Azure dashboard where it displays the summary of failed requests per hour. And the query for the same given below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;AzureDiagnostics&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; ResourceProvider &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;MICROSOFT.NETWORK&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; Category &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ApplicationGatewayAccessLog&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; httpStatus_d &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;400&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| summarize &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(httpStatus_d) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; httpStatus_d,requestUri_s, bin(TimeGenerated, 1h)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;order by&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; count_httpStatus_d &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;desc&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| project httpStatus_d, requestUri_s, TimeGenerated, count_httpStatus_d&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;AzureDiagnostics| where ResourceProvider == &amp;quot;MICROSOFT.NETWORK&amp;quot; and Category == &amp;quot;ApplicationGatewayAccessLog&amp;quot;| where httpStatus_d &gt;= 400| summarize count(httpStatus_d) by httpStatus_d,requestUri_s, bin(TimeGenerated, 1h)| order by count_httpStatus_d desc| project httpStatus_d, requestUri_s, TimeGenerated, count_httpStatus_d&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And the result looks like (highlighted one),&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/application-gateway-dashboard_censored.BwnChWRg_Z1g0AT7.webp&quot; alt=&quot;Application Gateway Azure Dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1905&quot; height=&quot;1047&quot;&gt;&lt;figcaption&gt;Application Gateway Azure Dashboard&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;In fact, Azure made all this easy. When you navigate to the logs section of application gateway, the example queries by default include a similar query,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/application-gateway-logs.CrY8xNlW_Z4mu5e.webp&quot; alt=&quot;Application Gateway Logs&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1672&quot; height=&quot;725&quot;&gt;&lt;figcaption&gt;Application Gateway Logs&lt;/figcaption&gt;&lt;/figure&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; Errors &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; URI&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;Number&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; of errors &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; URI.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;AzureDiagnostics&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; ResourceType &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;APPLICATIONGATEWAYS&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; OperationName &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ApplicationGatewayAccess&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; httpStatus_d &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;399&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| summarize AggregatedValue &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; requestUri_s&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;| sort &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; AggregatedValue &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;desc&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;// Errors by URI// Number of errors by URI.AzureDiagnostics| where ResourceType == &amp;quot;APPLICATIONGATEWAYS&amp;quot; and OperationName == &amp;quot;ApplicationGatewayAccess&amp;quot; and httpStatus_d &gt; 399| summarize AggregatedValue = count() by requestUri_s| sort by AggregatedValue desc&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;</content:encoded><category>azure-application-gateway</category><category>monitoring</category><author>Abhith Rajan</author></item><item><title>Truncate String Without Word Break</title><link>https://www.abhith.net/snippets/c-sharp/truncate-string-without-word-break/</link><guid isPermaLink="true">https://www.abhith.net/snippets/c-sharp/truncate-string-without-word-break/</guid><description>Truncate string at a word near to the limit specified. Avoid word split.</description><pubDate>Mon, 14 Sep 2020 09:26:00 GMT</pubDate><content:encoded>&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// Truncate string at a word near to the limit specified. Avoid word split.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--2:#5C6565;--2fs:italic&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69;--2fs:italic&quot;&gt;&amp;quot;input&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;string&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--2:#5C6565;--2fs:italic&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69;--2fs:italic&quot;&gt;&amp;quot;length&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--2:#5C6565;--2fs:italic&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69;--2fs:italic&quot;&gt;&amp;quot;appendDots&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;returns&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;returns&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;TruncateAtWord&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;appendDots&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;iNextSpace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;LastIndexOf&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StringComparison&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Ordinal&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;trimmedInput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Format&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;{0}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Substring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;iNextSpace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;iNextSpace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; : &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Trim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;());&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;appendDots&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;trimmedInput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;...&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;trimmedInput&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;/// &lt;summary&gt;/// Truncate string at a word near to the limit specified. Avoid word split./// &lt;/summary&gt;/// &lt;param name=&amp;quot;input&amp;quot;&gt;string&lt;/param&gt;/// &lt;param name=&amp;quot;length&amp;quot;&gt;&lt;/param&gt;/// &lt;param name=&amp;quot;appendDots&amp;quot;&gt;&lt;/param&gt;/// &lt;returns&gt;&lt;/returns&gt;public static string TruncateAtWord(this string input, int length, bool appendDots = false){    if (input == null || input.Length &lt; length)        return input;    var iNextSpace = input.LastIndexOf(&amp;quot; &amp;quot;, length, StringComparison.Ordinal);    var trimmedInput = string.Format(&amp;quot;{0}&amp;quot;, input.Substring(0, (iNextSpace &gt; 0) ? iNextSpace : length).Trim());    if (appendDots)    {        return trimmedInput + &amp;quot;...&amp;quot;;    }    return trimmedInput;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;tests&quot;&gt;Tests&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#tests&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Fact&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;TruncateAtWordTests&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This is a long sentence&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;TruncateAtWord&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Should&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Be&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This is a long sentence&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;TruncateAtWord&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Should&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Be&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;This is&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;[Fact]public void TruncateAtWordTests(){    &amp;quot;This is a long sentence&amp;quot;.TruncateAtWord(6).Should().Be(&amp;quot;This&amp;quot;);    &amp;quot;This is a long sentence&amp;quot;.TruncateAtWord(7).Should().Be(&amp;quot;This is&amp;quot;);}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#reference&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Abhith/Code.Library/blob/master/src/Code.Library/Extensions/StringExtensions.cs/#L511&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Code.Library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>c-sharp</category><author>Abhith Rajan</author></item><item><title>Domain Name From URL</title><link>https://www.abhith.net/snippets/javascript/domain-name-from-url/</link><guid isPermaLink="true">https://www.abhith.net/snippets/javascript/domain-name-from-url/</guid><description>Get domain name from URL using JavaScript</description><pubDate>Sun, 13 Sep 2020 09:26:00 GMT</pubDate><content:encoded>&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;domainFromURL&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;url&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http://&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;www.&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#BD2B28&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;[/?#]&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#BD2B28&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;export const domainFromURL = (url) =&gt; {  return url    .replace(&amp;quot;http://&amp;quot;, &amp;quot;&amp;quot;)    .replace(&amp;quot;https://&amp;quot;, &amp;quot;&amp;quot;)    .replace(&amp;quot;www.&amp;quot;, &amp;quot;&amp;quot;)    .split(/[/?#]/)[0];};&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;</content:encoded><category>javascript</category><author>Abhith Rajan</author></item><item><title>Mask String</title><link>https://www.abhith.net/snippets/c-sharp/mask-string/</link><guid isPermaLink="true">https://www.abhith.net/snippets/c-sharp/mask-string/</guid><description>Mask string, mobile number etc. Usefull while logging sensitive content.</description><pubDate>Sat, 12 Sep 2020 09:26:00 GMT</pubDate><content:encoded>&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// Mask the string.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--2:#5C6565;--2fs:italic&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69;--2fs:italic&quot;&gt;&amp;quot;value&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;String that need to be masked&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--2:#5C6565;--2fs:italic&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69;--2fs:italic&quot;&gt;&amp;quot;startIndex&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;zero index indicating mask start position&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--2:#5C6565;--2fs:italic&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69;--2fs:italic&quot;&gt;&amp;quot;mask&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;mask that need to be applied, eg. ***&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;/// &amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;returns&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;Usage: &amp;quot;123456789&amp;quot;.Mask(3, &amp;quot;****&amp;quot;) =&amp;gt; &amp;quot;123****89&amp;quot;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E;--2fs:italic&quot;&gt;returns&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Mask&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;mask&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;IsNullOrEmpty&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Empty&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;starLength&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;mask&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Insert&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;mask&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;starLength&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;starLength&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;starLength&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;starLength&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;startIndex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;starLength&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;/// &lt;summary&gt;/// Mask the string./// &lt;/summary&gt;/// &lt;param name=&amp;quot;value&amp;quot;&gt;String that need to be masked&lt;/param&gt;/// &lt;param name=&amp;quot;startIndex&amp;quot;&gt;zero index indicating mask start position&lt;/param&gt;/// &lt;param name=&amp;quot;mask&amp;quot;&gt;mask that need to be applied, eg. ***&lt;/param&gt;/// &lt;returns&gt;Usage: &amp;quot;123456789&amp;quot;.Mask(3, &amp;quot;****&amp;quot;) =&gt; &amp;quot;123****89&amp;quot;&lt;/returns&gt;public static string Mask(this string value, int startIndex, string mask){    if (string.IsNullOrEmpty(value))        return string.Empty;    var result = value;    var starLength = mask.Length;    if (value.Length &lt; startIndex) return result;    result = value.Insert(startIndex, mask);    result = result.Length &gt;= (startIndex + (starLength * 2)) ? result.Remove(startIndex + starLength, starLength) : result.Remove(startIndex + starLength, result.Length - (startIndex + starLength));    return result;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;tests&quot;&gt;Tests&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#tests&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;123456789&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Mask&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;****&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Should&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Be&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;123****89&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;123456789&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Mask&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;****---&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Should&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Be&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;123****---&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&amp;quot;123456789&amp;quot;.Mask(3, &amp;quot;****&amp;quot;).Should().Be(&amp;quot;123****89&amp;quot;);&amp;quot;123456789&amp;quot;.Mask(3, &amp;quot;****---&amp;quot;).Should().Be(&amp;quot;123****---&amp;quot;);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#reference&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jinweijie.com/2011/09/30/mask-mobile-number-using-c-4/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=snippets&amp;amp;utm_content=mask-string&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Mask Mobile Number Using C# - JIN Weijie&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>c-sharp</category><author>Abhith Rajan</author></item><item><title>Azure DevOps - CI/CD Pipeline involving Helm 3, ACR &amp; AKS</title><link>https://www.abhith.net/blog/azure-devops-ci-cd-pipeline-involving-helm-3-acr-aks/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-devops-ci-cd-pipeline-involving-helm-3-acr-aks/</guid><description>Setup Continuous Integration in Azure DevOps which push Docker image, Helm 3 chart to ACR, and Continuous Deployment pipeline that deploys the chart to AKS.</description><pubDate>Tue, 18 Aug 2020 15:11:27 GMT</pubDate><content:encoded>&lt;p&gt;Azure is my favorite cloud provider. We use &lt;a href=&quot;https://www.abhith.net/topics/azure/&quot;&gt;Azure&lt;/a&gt; for most of the infra &amp;amp; services.
Our code goes to &lt;a href=&quot;https://www.abhith.net/topics/azure-devops/&quot;&gt;Azure DevOps&lt;/a&gt;, we use &lt;strong&gt;Azure Container Registry (ACR)&lt;/strong&gt; to host our docker container images and our &lt;a href=&quot;https://www.abhith.net/topics/kubernetes/&quot;&gt;Kubernetes&lt;/a&gt; clusters running in &lt;a href=&quot;https://www.abhith.net/topics/aks/&quot;&gt;Azure Kubernetes Service (AKS)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We configured the CI/CD pipelines in Azure DevOps.
In my case, we have a &lt;strong&gt;monorepo&lt;/strong&gt; that contains several &lt;a href=&quot;https://www.abhith.net/topics/aspnet-core/&quot;&gt;ASP.NET Core&lt;/a&gt; &lt;a href=&quot;https://www.abhith.net/topics/microservices/&quot;&gt;microservices&lt;/a&gt; and the folder structure looks like below, which we inherited from &lt;a href=&quot;https://github.com/dotnet-architecture/eShopOnContainers?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-ci-cd-pipeline-involving-helm-3-acr-aks&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;eShopOnContainers&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- build&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- azure-devops&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- common&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- ci-steps-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- ci-vars-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- project-one&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- ci-pipeline.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- project-two&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- deploy&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- azure-devops&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- common&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- cd-steps-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- cd-steps-template-prod.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- cd-vars-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- project-one&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- cd-pipeline.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- project-two&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- k8s&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- helm&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- project-one&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- project-two&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- src&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- Services&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- Project-One&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;- Project-Two&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;- build  - azure-devops    - common      - ci-steps-template.yml      - ci-vars-template.yml    - project-one      - ci-pipeline.yml    - project-two- deploy  - azure-devops    - common      - cd-steps-template.yml      - cd-steps-template-prod.yml      - cd-vars-template.yml    - project-one      - cd-pipeline.yml    - project-two  - k8s    - helm      - project-one      - project-two- src  - Services    - Project-One    - Project-Two&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;One of the great articles that helped me to initial setup the CI/CD is given below.
Its kind of outdated now since it is using &lt;code&gt;az acr helm&lt;/code&gt; commands which were deprecated later.
But it is still worth reading. So definitely check it out.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://cloudblogs.microsoft.com/opensource/2018/11/27/tutorial-azure-devops-setup-cicd-pipeline-kubernetes-docker-helm/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-ci-cd-pipeline-involving-helm-3-acr-aks&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Tutorial: Using Azure DevOps to setup a CI/CD pipeline and deploy to Kubernetes&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;ci-pipeline&quot;&gt;CI Pipeline&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ci-pipeline&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The CI pipeline does the following,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Build a Docker image and push to ACR&lt;/li&gt;
&lt;li&gt;Build Helm chart and push to ACR&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#prerequisites&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.abhith.net/topics/helm/&quot;&gt;Helm&lt;/a&gt; chart for your project. Here my chart directory is located at &lt;code&gt;deploy &amp;gt; k8s &amp;gt; helm&lt;/code&gt;. To create a new chart for your project, refer &lt;a href=&quot;https://helm.sh/docs/helm/helm_create/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-ci-cd-pipeline-involving-helm-3-acr-aks&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Helm Create&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;acr-connection-name&lt;/strong&gt;: ACR service connection in Azure DevOps. You can add it under &lt;code&gt;Azure DevOps &amp;gt; Project &amp;gt; Project Settings &amp;gt; Service Connections&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The ACR credentials I stored in the Azure DevOps &lt;strong&gt;Variable Groups&lt;/strong&gt; (acr-variable-group).&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;registryName&lt;/td&gt;&lt;td&gt;Your ACR name&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;registryLogin&lt;/td&gt;&lt;td&gt;ACR login&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;registryPassword&lt;/td&gt;&lt;td&gt;ACR password&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/azure-devops-library.H3juRHok_sIAJH.webp&quot; alt=&quot;Variable group definition&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1199&quot; height=&quot;716&quot;&gt;&lt;figcaption&gt;Variable group definition&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;common&quot;&gt;Common&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#common&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id=&quot;ci-vars-templateyml&quot;&gt;ci-vars-template.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ci-vars-templateyml&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projectName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerRegistryServiceConnectionName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerfile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;buildContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmVersion&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;3.2.3&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;HELM_EXPERIMENTAL_OCI&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;registryServerName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;$(registryName).azurecr.io&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerRegistryServiceConnectionName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;${{ parameters.dockerRegistryServiceConnectionName }}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerfile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;${{ parameters.dockerfile }}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;buildContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;${{ parameters.buildContext }}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projectName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;${{ parameters.projectName }}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;imageName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;${{ parameters.projectName }}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;imageTag&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(build.sourceBranchName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmChartVersion&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(build.sourceBranchName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmfrom&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(Build.SourcesDirectory)/deploy/k8s/helm&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(Build.ArtifactStagingDirectory)/deploy/k8s/helm&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;parameters:  projectName: &amp;quot;&amp;quot;  dockerRegistryServiceConnectionName: &amp;quot;&amp;quot;  dockerfile: &amp;quot;&amp;quot;  buildContext: &amp;quot;&amp;quot;variables:  helmVersion: 3.2.3  HELM_EXPERIMENTAL_OCI: 1  registryServerName: &amp;quot;$(registryName).azurecr.io&amp;quot;  dockerRegistryServiceConnectionName: ${{ parameters.dockerRegistryServiceConnectionName }}  dockerfile: ${{ parameters.dockerfile }}  buildContext: ${{ parameters.buildContext }}  projectName: ${{ parameters.projectName }}  imageName: ${{ parameters.projectName }}  imageTag: $(build.sourceBranchName)  helmChartVersion: $(build.sourceBranchName)  helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm  helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Few things to note here,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HELM_EXPERIMENTAL_OCI&lt;/code&gt; is to enable OCI support in the Helm 3 client. Currently, this support is experimental.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;build.sourceBranchName&lt;/code&gt; as the image tag and chart version is handy if you are following &lt;strong&gt;Gitflow&lt;/strong&gt; (which we follow) or similar &lt;a href=&quot;https://www.abhith.net/topics/git/&quot;&gt;git&lt;/a&gt; branching convention, so each release (eg, refs/tags/project-one/2.2.6) will generate &lt;a href=&quot;https://www.abhith.net/topics/docker/&quot;&gt;Docker&lt;/a&gt; image and Helm chart with the same version.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;ci-steps-templateyml&quot;&gt;ci-steps-template.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ci-steps-templateyml&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Docker@2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Build and push an image to container registry&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;buildAndPush&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(imageName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerfile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(dockerfile)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;containerRegistry&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(dockerRegistryServiceConnectionName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;buildContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(buildContext)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;tags&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(imageTag)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;HelmInstaller@1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;install helm&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmVersionToInstall&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(helmVersion)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;bash&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;echo $(registryPassword) | helm registry login $(registryName).azurecr.io --username $(registryLogin) --password-stdin&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;cd deploy/k8s/helm/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm chart save $(helm package --app-version $(imageTag) --version $(helmChartVersion) ./$(projectName) | grep -o &amp;#39;/.*.tgz&amp;#39;) $(registryName).azurecr.io/charts/$(projectName):$(imageTag)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm chart push $(registryName).azurecr.io/charts/$(projectName):$(helmChartVersion)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;echo $(jq -n --arg version &amp;quot;$(helmChartVersion)&amp;quot; &amp;#39;{helmChartVersion: $version}&amp;#39;) &amp;gt; $(build.artifactStagingDirectory)/variables.json&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;failOnStderr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;helm package&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;CopyFiles@2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;sourceFolder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(helmfrom)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;targetFolder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(helmto)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;publish&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(build.artifactStagingDirectory)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;artifact&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;build-artifact&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;steps:  - task: Docker@2    displayName: Build and push an image to container registry    inputs:      command: buildAndPush      repository: $(imageName)      dockerfile: $(dockerfile)      containerRegistry: $(dockerRegistryServiceConnectionName)      buildContext: $(buildContext)      tags: |        $(imageTag)  - task: HelmInstaller@1    displayName: &amp;quot;install helm&amp;quot;    inputs:      helmVersionToInstall: $(helmVersion)  - bash: |      echo $(registryPassword) | helm registry login $(registryName).azurecr.io --username $(registryLogin) --password-stdin      cd deploy/k8s/helm/      helm chart save $(helm package --app-version $(imageTag) --version $(helmChartVersion) ./$(projectName) | grep -o &apos;/.*.tgz&apos;) $(registryName).azurecr.io/charts/$(projectName):$(imageTag)      helm chart push $(registryName).azurecr.io/charts/$(projectName):$(helmChartVersion)      echo $(jq -n --arg version &amp;quot;$(helmChartVersion)&amp;quot; &apos;{helmChartVersion: $version}&apos;) &gt; $(build.artifactStagingDirectory)/variables.json    failOnStderr: true    displayName: &amp;quot;helm package&amp;quot;  - task: CopyFiles@2    inputs:      sourceFolder: $(helmfrom)      targetFolder: $(helmto)  - publish: $(build.artifactStagingDirectory)    artifact: build-artifact&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The steps in the CI pipeline we moved to a common template file &lt;code&gt;ci-steps-template.yml&lt;/code&gt; so that we can reuse it on other pipelines as well, and the steps include,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Build and push the docker image&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Installs Helm client&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A series of script which does&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Authenticate to ACR&lt;/li&gt;
&lt;li&gt;Creates and push Helm chart to ACR.&lt;/li&gt;
&lt;li&gt;Creates &lt;code&gt;variables.json&lt;/code&gt; which contain the newly created Helm chart version. Which we will use to fetch the right chart version during CD.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy some additional files to the artifact. Which we can use to override Helm chart values.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;ci-pipelineyml&quot;&gt;ci-pipeline.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ci-pipelineyml&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;trigger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;branches&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;refs/tags/project-one/*&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;paths&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;src/Services/ProjectOne/*&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;none&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pool&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;vmImage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ubuntu-latest&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;acr-variable-group&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;../common/ci-vars-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projectName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;project-one&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerRegistryServiceConnectionName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;acr-connection-name&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerfile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;src/Services/Project-One/Dockerfile&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;buildContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;$(System.DefaultWorkingDirectory)&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;../common/ci-steps-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;trigger:  branches:    include:      - refs/tags/project-one/*  paths:    include:      - src/Services/ProjectOne/*pr: nonepool:  vmImage: &amp;quot;ubuntu-latest&amp;quot;variables:  - group: acr-variable-group  - template: ../common/ci-vars-template.yml    parameters:      projectName: &amp;quot;project-one&amp;quot;      dockerRegistryServiceConnectionName: &amp;quot;acr-connection-name&amp;quot;      dockerfile: &amp;quot;src/Services/Project-One/Dockerfile&amp;quot;      buildContext: &amp;quot;$(System.DefaultWorkingDirectory)&amp;quot;steps:  - template: ../common/ci-steps-template.yml&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;If everything went well, you will have two repositories under your ACR.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;project-one&lt;/strong&gt; which contains the Docker image&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;chart/project-one&lt;/strong&gt; for the Helm chart&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;cd-pipeline&quot;&gt;CD Pipeline&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cd-pipeline&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The CD pipeline will install the Helm chart on AKS.
The CD pipeline stage requires following details,&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;aks&lt;/td&gt;&lt;td&gt;AKS name&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;rg&lt;/td&gt;&lt;td&gt;AKS resource group&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;aksSpTenantId&lt;/td&gt;&lt;td&gt;Subscription tenant id&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;aksSpId&lt;/td&gt;&lt;td&gt;Service principal Id&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;aksSpSecret&lt;/td&gt;&lt;td&gt;Service principal password&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;These credentials I stored in another varible group named &lt;code&gt;aks-variable-group&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;helpful-commands&quot;&gt;Helpful commands&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#helpful-commands&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id=&quot;service-principal-credentials&quot;&gt;Service principal credentials&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#service-principal-credentials&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Create new service principal &lt;code&gt;aks-name-deploy&lt;/code&gt; by&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;az&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ad&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;sp&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;create-for-rbac&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-n&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;aks-name-deploy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--scopes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;aks-resource-id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--role&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Azure Kubernetes Service Cluster User Role&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--query&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tsv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;az ad sp create-for-rbac -n aks-name-deploy --scopes aks-resource-id --role &amp;quot;Azure Kubernetes Service Cluster User Role&amp;quot; --query password -o tsv&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Where &lt;code&gt;aks-resource-id&lt;/code&gt; is,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;shell&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;az&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;aks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-n&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;$aks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-g&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;$rg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--query&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tsv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;az aks show -n $aks -g $rg --query id -o tsv&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The above command will output service principal password &lt;code&gt;aksSpSecret&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To get service principal id &lt;code&gt;aksSpId&lt;/code&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;az&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ad&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;sp&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;http://aks-name-deploy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--query&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;appId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tsv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;az ad sp show --id http://aks-name-deploy --query appId -o tsv&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Also we need to attach ACR with AKS so that AKS can pull our private docker images from our ACR.&lt;/p&gt;
&lt;h4 id=&quot;attach-acr-with-aks&quot;&gt;Attach ACR with AKS&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#attach-acr-with-aks&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;az&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;aks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-g&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;$rg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-n&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;$aks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--attach-acr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;acr-resource-id&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;az aks update -g $rg -n $aks --attach-acr acr-resource-id&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Where &lt;code&gt;acr-resource-id&lt;/code&gt; is the output of,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;az&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;acr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-n&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;$registryName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-g&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;acr-resource-group-name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--query&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tsv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;az acr show -n $registryName -g acr-resource-group-name --query id -o tsv&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h4 id=&quot;get-azure-tenant-id&quot;&gt;Get Azure Tenant Id&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#get-azure-tenant-id&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;To get tenantId &lt;code&gt;aksSpTenantId&lt;/code&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;az&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;account&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--query&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tenantId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;tsv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;az account show --query tenantId -o tsv&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Now lets explore the pipeline YAML files.&lt;/p&gt;
&lt;h3 id=&quot;common-1&quot;&gt;Common&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#common-1&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id=&quot;cd-vars-templateyml&quot;&gt;cd-vars-template.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cd-vars-templateyml&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projectName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmVersion&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;3.2.3&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;HELM_EXPERIMENTAL_OCI&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;registryServerName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;$(registryName).azurecr.io&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projectName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;${{ parameters.projectName }}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;parameters:  projectName: &amp;quot;&amp;quot;variables:  helmVersion: 3.2.3  HELM_EXPERIMENTAL_OCI: 1  registryServerName: &amp;quot;$(registryName).azurecr.io&amp;quot;  projectName: ${{ parameters.projectName }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h4 id=&quot;cd-steps-templateyml&quot;&gt;cd-steps-template.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cd-steps-templateyml&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;checkout&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;none&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;HelmInstaller@1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;install helm&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmVersionToInstall&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(helmVersion)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;download&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ci-pipeline&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;artifact&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;build-artifact&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;bash&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;az login \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--service-principal \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-u $(aksSpId) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-p &amp;#39;$(aksSpSecret)&amp;#39; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--tenant $(aksSpTenantId)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;az aks get-credentials \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-n $(aks) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-g $(rg)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;echo $(registryPassword) | helm registry login $(registryServerName) --username $(registryLogin) --password-stdin&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helmChartVersion=$(jq .helmChartVersion $(pipeline.workspace)/ci-pipeline/build-artifact/variables.json -r)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm chart pull $(registryServerName)/charts/$(projectName):$helmChartVersion&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm chart export $(registryServerName)/charts/$(projectName):$helmChartVersion --destination $(pipeline.workspace)/install&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm upgrade \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--namespace $(k8sNamespace) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--create-namespace \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--install \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--wait \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--version $helmChartVersion \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--set image.repository=$(registryServerName)/$(projectName) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/app.yaml \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/inf.yaml \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(projectName) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(pipeline.workspace)/install/$(projectName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;failOnStderr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;deploy helm chart&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;steps:  - checkout: none  - task: HelmInstaller@1    displayName: &amp;quot;install helm&amp;quot;    inputs:      helmVersionToInstall: $(helmVersion)  - download: ci-pipeline    artifact: build-artifact  - bash: |      az login \           --service-principal \           -u $(aksSpId) \           -p &apos;$(aksSpSecret)&apos; \           --tenant $(aksSpTenantId)       az aks get-credentials \           -n $(aks) \           -g $(rg)       echo $(registryPassword) | helm registry login $(registryServerName) --username $(registryLogin) --password-stdin       helmChartVersion=$(jq .helmChartVersion $(pipeline.workspace)/ci-pipeline/build-artifact/variables.json -r)       helm chart pull $(registryServerName)/charts/$(projectName):$helmChartVersion       helm chart export $(registryServerName)/charts/$(projectName):$helmChartVersion --destination $(pipeline.workspace)/install       helm upgrade \           --namespace $(k8sNamespace) \           --create-namespace \           --install \           --wait \           --version $helmChartVersion \           --set image.repository=$(registryServerName)/$(projectName) \           -f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/app.yaml \           -f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/inf.yaml \           $(projectName) \           $(pipeline.workspace)/install/$(projectName)    failOnStderr: true    displayName: &amp;quot;deploy helm chart&amp;quot;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The common CD steps include a series of script which does,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Authenticate to Azure using the service principal credentials&lt;/li&gt;
&lt;li&gt;Set the specified AKS cluster as the context.&lt;/li&gt;
&lt;li&gt;Authenticate ACR with the ACR credentials (The same credentials we used in CI pipeline defined in the &lt;code&gt;acr-variable-group&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Extract the Helm chart version that need to install&lt;/li&gt;
&lt;li&gt;Pulls the Helm chart and installs (or upgrade) it. Here we are overriding the chart image repository to our ACR repository and some additional common values (app.yaml &amp;amp; inf.yaml).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;cd-pipelineyml&quot;&gt;cd-pipeline.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cd-pipelineyml&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;trigger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;none&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;none&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# define variables: registryName, registryLogin and registryPassword in the Azure pipeline UI definition&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;acr-variable-group&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;../common/cd-vars-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projectName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;project-one&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;k8sNamespace&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;myteam&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;resources&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pipelines&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pipeline&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ci-pipeline&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;project-one-ci&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;trigger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;branches&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;refs/tags/project-one/*&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# define 5 variables: aks, rg, aksSpId, aksSpSecret and aksSpTenantId in the Azure pipeline UI definition&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;stages&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;stage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;test&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;test&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;deployment&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;test&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;aks-variable-group&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;deploy helm chart into AKS&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pool&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;vmImage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;environment&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;test-$(projectName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;strategy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;runOnce&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;deploy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;../common/cd-steps-template.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;stage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;production&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;production&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;deployment&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;production&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;aks-prod-variable-group&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;deploy helm chart into AKS&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pool&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;vmImage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;environment&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;production-$(projectName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;strategy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;runOnce&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;deploy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;../common/cd-steps-template-prod.yml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;trigger: nonepr: none# define variables: registryName, registryLogin and registryPassword in the Azure pipeline UI definitionvariables:  - group: acr-variable-group  - template: ../common/cd-vars-template.yml    parameters:      projectName: &amp;quot;project-one&amp;quot;  - name: k8sNamespace    value: myteamresources:  pipelines:    - pipeline: ci-pipeline      source: &amp;quot;project-one-ci&amp;quot;      trigger:        enabled: true        branches:          include:            - refs/tags/project-one/*# define 5 variables: aks, rg, aksSpId, aksSpSecret and aksSpTenantId in the Azure pipeline UI definitionstages:  - stage: test    displayName: test    jobs:      - deployment: test        variables:          - group: aks-variable-group        displayName: deploy helm chart into AKS        pool:          vmImage: ubuntu-latest        environment: test-$(projectName)        strategy:          runOnce:            deploy:              steps:                - template: ../common/cd-steps-template.yml  - stage: production    displayName: production    jobs:      - deployment: production        variables:          - group: aks-prod-variable-group        displayName: deploy helm chart into AKS        pool:          vmImage: ubuntu-latest        environment: production-$(projectName)        strategy:          runOnce:            deploy:              steps:                - template: ../common/cd-steps-template-prod.yml&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the CD pipeline above, I have defined two stages, one for TEST and one for PROD.
The main difference between them is in the variable group used.
&lt;code&gt;aks-variable-group&lt;/code&gt; has the TEST cluster values and you guessed right, &lt;code&gt;aks-prod-variable-group&lt;/code&gt; has the PROD cluster values.
And the difference between &lt;code&gt;cd-steps-template.yml&lt;/code&gt; and &lt;code&gt;cd-steps-template-prod.yml&lt;/code&gt; is that prod file has some additional chart value overrides with respect to our PRODUCTION environment.&lt;/p&gt;
&lt;h3 id=&quot;cd-steps-template-prodyml&quot;&gt;cd-steps-template-prod.yml&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cd-steps-template-prodyml&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;checkout&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;none&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;HelmInstaller@1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;install helm&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;helmVersionToInstall&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(helmVersion)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;download&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ci-pipeline&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;artifact&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;build-artifact&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;bash&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;az login \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--service-principal \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-u $(aksSpId) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-p &amp;#39;$(aksSpSecret)&amp;#39; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--tenant $(aksSpTenantId)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;az aks get-credentials \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-n $(aks) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-g $(rg)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;echo $(registryPassword) | helm registry login $(registryServerName) --username $(registryLogin) --password-stdin&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helmChartVersion=$(jq .helmChartVersion $(pipeline.workspace)/ci-pipeline/build-artifact/variables.json -r)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm chart pull $(registryServerName)/charts/$(projectName):$helmChartVersion&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm chart export $(registryServerName)/charts/$(projectName):$helmChartVersion --destination $(pipeline.workspace)/install&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;helm upgrade \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--namespace $(k8sNamespace) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--create-namespace \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--install \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--wait \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--version $helmChartVersion \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;--set image.repository=$(registryServerName)/$(projectName) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/app.yaml \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/inf.yaml \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/inf-prod.yaml \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;-f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/$(projectName)/values-prod.yaml \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(projectName) \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$(pipeline.workspace)/install/$(projectName)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;failOnStderr&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;deploy helm chart&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;steps:  - checkout: none  - task: HelmInstaller@1    displayName: &amp;quot;install helm&amp;quot;    inputs:      helmVersionToInstall: $(helmVersion)  - download: ci-pipeline    artifact: build-artifact  - bash: |      az login \           --service-principal \           -u $(aksSpId) \           -p &apos;$(aksSpSecret)&apos; \           --tenant $(aksSpTenantId)       az aks get-credentials \           -n $(aks) \           -g $(rg)       echo $(registryPassword) | helm registry login $(registryServerName) --username $(registryLogin) --password-stdin       helmChartVersion=$(jq .helmChartVersion $(pipeline.workspace)/ci-pipeline/build-artifact/variables.json -r)       helm chart pull $(registryServerName)/charts/$(projectName):$helmChartVersion       helm chart export $(registryServerName)/charts/$(projectName):$helmChartVersion --destination $(pipeline.workspace)/install       helm upgrade \           --namespace $(k8sNamespace) \           --create-namespace \           --install \           --wait \           --version $helmChartVersion \           --set image.repository=$(registryServerName)/$(projectName) \           -f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/app.yaml \           -f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/inf.yaml \           -f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/inf-prod.yaml \           -f $(pipeline.workspace)/ci-pipeline/build-artifact/deploy/k8s/helm/$(projectName)/values-prod.yaml \           $(projectName) \           $(pipeline.workspace)/install/$(projectName)    failOnStderr: true    displayName: &amp;quot;deploy helm chart&amp;quot;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Few more Notes&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CD pipeline is also &lt;strong&gt;YAML&lt;/strong&gt; based (You gonna like it), hence create it like a regular pipeline (Not as RELEASE) in the Azure DevOps, and choose the &lt;code&gt;cd-pipeline.yml&lt;/code&gt; after choosing to create pipeline based on &lt;strong&gt;Existing Azure Pipelines YAML file&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Once you create the CD pipeline, check the &lt;strong&gt;Environments&lt;/strong&gt; under Azure DevOps Pipelines. There will be two environments as per the above example, test-project-one and production-project-one. Inside each, you can configure the approvals and more for the respective CD stages.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A sample reference source code is also pushed to &lt;a href=&quot;https://github.com/abhith/abhith.net/tree/master/samples/azure-devops-ci-cd-pipeline-involving-helm-3-acr-aks&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have any grey area in this article, feel free to shoot it in the comments below 👇, I will try to shed some light on that part.&lt;/p&gt;
&lt;hr/&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Setup Continuous Integration in Azure DevOps which push Docker image, Helm 3 chart to Azure Container Registry(ACR), and Continuous Deployment pipeline that deploys the chart to Azure Kubernetes Service (AKS).&lt;a href=&quot;https://t.co/S96mzQXn4M&quot;&gt;https://t.co/S96mzQXn4M&lt;/a&gt;&lt;a href=&quot;https://x.com/hashtag/AzureDevOps?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#AzureDevOps&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/helm?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#helm&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/Kubernetes?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#Kubernetes&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1296763029850333184?ref_src=twsrc%5Etfw&quot;&gt;August 21, 2020&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;</content:encoded><category>azure-devops</category><category>aks</category><category>helm</category><author>Abhith Rajan</author></item><item><title>Cloudflare and AspNet Boilerplate</title><link>https://www.abhith.net/blog/cloudflare-and-aspnet-boilerplate/</link><guid isPermaLink="true">https://www.abhith.net/blog/cloudflare-and-aspnet-boilerplate/</guid><description>If you are facing any issue which involves cloudflare and request with header contains &quot;dot&quot;, have a look.</description><pubDate>Sat, 18 Jul 2020 11:26:00 GMT</pubDate><content:encoded>&lt;p&gt;I am an early adopter of &lt;a href=&quot;https://aspnetboilerplate.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetboilerplate&lt;/a&gt;. I learned &lt;strong&gt;AngularJS&lt;/strong&gt; as part of developing &lt;a href=&quot;https://aspnetboilerplate.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetboilerplate&lt;/a&gt; project and it all started by reading an awesome blog post &lt;a href=&quot;https://www.codeproject.com/Articles/768664/Introduction-to-ASP-NET-Boilerplate?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Introduction to ASP.NET Boilerplate&lt;/a&gt; by &lt;strong&gt;Halil ibrahim Kalkan&lt;/strong&gt;. Since then I always recommended using the paid &lt;a href=&quot;https://aspnetzero.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetzero&lt;/a&gt; template for all the major projects in my workplace. And I used the free &lt;a href=&quot;https://aspnetboilerplate.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetboilerplate&lt;/a&gt; template for some of the projects including my side project, &lt;a href=&quot;https://github.com/piggyvault/piggyvault?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;piggyvault&lt;/a&gt;, a family finance management app, and its APIs is built on &lt;a href=&quot;https://github.com/aspnetboilerplate/aspnetboilerplate?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetboilerplate&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Similarly, I use &lt;a href=&quot;https://www.cloudflare.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Cloudflare&lt;/a&gt; for most of the hosted websites as a firewall-cum-CDN. Recently after hosting the &lt;a href=&quot;https://aspnetboilerplate.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetboilerplate&lt;/a&gt; project on &lt;a href=&quot;https://www.smarterasp.net/index?r=100571651&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SmarterASP.net&lt;/a&gt;, I started to face a login issue where it was working fine on local (as always 😆). The traffic to the PROD app was routed via &lt;a href=&quot;https://www.cloudflare.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Cloudflare&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Later the troubleshooting journey ended up &lt;a href=&quot;https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers-?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cloudflare strips any header that contains dots (.) from origin web server responses. For example, the origin web server header test.header:data is removed by Cloudflare’s proxy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;By default, ABP uses &lt;code&gt;Abp.TenantId&lt;/code&gt; header as the &lt;code&gt;TenantIdResolveKey&lt;/code&gt;, and &lt;strong&gt;Cloudflare&lt;/strong&gt; strips it resulting in null value always. Thankfully, &lt;a href=&quot;https://aspnetboilerplate.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnetboilerplate&lt;/a&gt; provides an option to change the &lt;code&gt;TenantIdResolveKey&lt;/code&gt;. To change,&lt;/p&gt;
&lt;p&gt;In the &lt;code&gt;CoreModule&lt;/code&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Enable this line to create a multi-tenant application.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;MultiTenancy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;IsEnabled&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;PiggyvaultConsts&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;MultiTenancyEnabled&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;MultiTenancy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;TenantIdResolveKey&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Piggy-TenantId&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// your key without &amp;quot;.&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;// Enable this line to create a multi-tenant application.Configuration.MultiTenancy.IsEnabled = PiggyvaultConsts.MultiTenancyEnabled;Configuration.MultiTenancy.TenantIdResolveKey = &amp;quot;Piggy-TenantId&amp;quot;; // your key without &amp;quot;.&amp;quot;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;It resolved the login issue.&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3275?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Can not get header with name “Abp.TenantId” but “AbpTenantId” on server(windwos / linux).&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4349?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=cloudflare-and-aspnet-boilerplate&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Allow to configure TenantIdResolveKey&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>cloudflare</category><category>abp</category><author>Abhith Rajan</author></item><item><title>ASP.NET Core - Using Mutliple Authentication Schemes</title><link>https://www.abhith.net/blog/aspnet-core-using-multiple-authentication-schemes/</link><guid isPermaLink="true">https://www.abhith.net/blog/aspnet-core-using-multiple-authentication-schemes/</guid><description>One endpoint, authorize using Identity Server or using a custom authentication handler.</description><pubDate>Sat, 11 Jul 2020 19:26:00 GMT</pubDate><content:encoded>&lt;p&gt;In some use cases, you might want your endpoints to be authorized using multiple schemes.
In my case, I had to allow some of the endpoints for authorized clients (using Identity Server) as well as for requests with a custom token which is generated by a custom service for authorized users.&lt;/p&gt;
&lt;p&gt;To achieve this, we need to create the custom &lt;code&gt;AuthenticationScheme&lt;/code&gt; and configure a policy to use our custom scheme as well as &lt;code&gt;JwtBearer&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;custom-authenticationscheme&quot;&gt;Custom AuthenticationScheme&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#custom-authenticationscheme&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Creating a custom authentication scheme will validate the custom token using the &lt;code&gt;[Authorize]&lt;/code&gt; attribute.&lt;/p&gt;
&lt;p&gt;To create a custom authentication scheme, we need to define the following,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CustomAuthenticationDefaults&lt;/li&gt;
&lt;li&gt;CustomAuthenticationHandler&lt;/li&gt;
&lt;li&gt;CustomAuthenticationOptions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s start with the defaults, where we describe the name of the scheme.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Custom&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public static class CustomAuthenticationDefaults{    public const string AuthenticationScheme = &amp;quot;Custom&amp;quot;;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Next &lt;code&gt;AuthenticationSchemeOptions&lt;/code&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AspNetCore&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Authentication&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AuthenticationSchemeOptions&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;UserInfoEndpoint&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using Microsoft.AspNetCore.Authentication;public class CustomAuthOptions : AuthenticationSchemeOptions{    public string UserInfoEndpoint { get; set; }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;To validate the custom token, I need to send an HTTP request to an endpoint and the URL for that endpoint needs to be configurable.
By defining &lt;code&gt;AuthenticationSchemeOptions&lt;/code&gt;, we can pass these values while setting up the scheme in the Startup.&lt;/p&gt;
&lt;p&gt;Let’s move on to &lt;code&gt;AuthenticationHandler&lt;/code&gt;, which validates the token.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Flurl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Http&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AspNetCore&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Authentication&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Extensions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Logging&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Extensions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Collections&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Generic&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Security&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claims&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Encodings&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Web&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Threading&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Tasks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthenticationHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AuthenticationHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CustomAuthenticationHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IOptionsMonitor&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthOptions&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ILoggerFactory&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;UrlEncoder&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;encoder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ISystemClock&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;clock&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;encoder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;clock&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;protected&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;HandleAuthenticateAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Headers&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ContainsKey&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authorization&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Fail&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Unauthorized&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;authorizationHeader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Headers&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authorization&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;IsNullOrEmpty&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;authorizationHeader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;NoResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;authorizationHeader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;StartsWith&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StringComparison&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;OrdinalIgnoreCase&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Fail&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Unauthorized&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;token&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;authorizationHeader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Substring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Trim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;IsNullOrEmpty&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;token&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Fail&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Unauthorized&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;try&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ValidateTokenAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;token&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Exception&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;ex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Fail&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ValidateTokenAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;session&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// getting user info using HTTP request made using Flurl&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;UserInfoEndpoint&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;WithHeader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;some-id&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;session&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetJsonAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Fail&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Unauthorized&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;claims&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;List&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClaimTypes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Surname&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClaimTypes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;GivenName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClaimTypes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Surname&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;surname&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;scope&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;orders:write&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClaimTypes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;NameIdentifier&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Claim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClaimTypes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Role&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;User&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;identity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ClaimsIdentity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;claims&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Scheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;principal&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ClaimsPrincipal&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;identity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;ticket&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AuthenticationTicket&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;principal&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Scheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticateResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Success&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ticket&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using Flurl.Http;using Microsoft.AspNetCore.Authentication;using Microsoft.Extensions.Logging;using Microsoft.Extensions.Options;using System;using System.Collections.Generic;using System.Security.Claims;using System.Text.Encodings.Web;using System.Threading.Tasks;...public class CustomAuthenticationHandler : AuthenticationHandler&lt;CustomAuthOptions&gt;{    public CustomAuthenticationHandler(        IOptionsMonitor&lt;CustomAuthOptions&gt; options,        ILoggerFactory logger,        UrlEncoder encoder,        ISystemClock clock        )        : base(options, logger, encoder, clock)    {    }    protected override async Task&lt;AuthenticateResult&gt; HandleAuthenticateAsync()    {        if (!Request.Headers.ContainsKey(&amp;quot;Authorization&amp;quot;))            return AuthenticateResult.Fail(&amp;quot;Unauthorized&amp;quot;);        string authorizationHeader = Request.Headers[&amp;quot;Authorization&amp;quot;];        if (string.IsNullOrEmpty(authorizationHeader))        {            return AuthenticateResult.NoResult();        }        if (!authorizationHeader.StartsWith(CustomAuthenticationDefaults.AuthenticationScheme, StringComparison.OrdinalIgnoreCase))        {            return AuthenticateResult.Fail(&amp;quot;Unauthorized&amp;quot;);        }        string token = authorizationHeader.Substring(CustomAuthenticationDefaults.AuthenticationScheme.Length).Trim();        if (string.IsNullOrEmpty(token))        {            return AuthenticateResult.Fail(&amp;quot;Unauthorized&amp;quot;);        }        try        {            return await ValidateTokenAsync(token);        }        catch (Exception ex)        {            return AuthenticateResult.Fail(ex.Message);        }    }    private async Task&lt;AuthenticateResult&gt; ValidateTokenAsync(string session)    {        // getting user info using HTTP request made using Flurl        var user = await Options.UserInfoEndpoint            .WithHeader(&amp;quot;some-id&amp;quot;, session)            .GetJsonAsync&lt;User&gt;();        if (user == null)        {            return AuthenticateResult.Fail(&amp;quot;Unauthorized&amp;quot;);        }        var claims = new List&lt;Claim&gt;        {            new Claim(ClaimTypes.Name, $&amp;quot;{user.Name} {user.Surname}&amp;quot;),            new Claim(ClaimTypes.GivenName, $&amp;quot;{user.Name}&amp;quot;),            new Claim(ClaimTypes.Surname, surname),            new Claim(&amp;quot;scope&amp;quot;, &amp;quot;orders:write&amp;quot;),            new Claim(ClaimTypes.NameIdentifier, user.id)            new Claim(ClaimTypes.Role, &amp;quot;User&amp;quot;)        };        var identity = new ClaimsIdentity(claims, Scheme.Name);        var principal = new ClaimsPrincipal(identity);        var ticket = new AuthenticationTicket(principal, Scheme.Name);        return AuthenticateResult.Success(ticket);    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the &lt;code&gt;AuthenticationHandler&lt;/code&gt;, you can use your way to validate your tokens.&lt;/p&gt;
&lt;p&gt;Now we need to configure our project to use the custom authentication, for that, in the &lt;code&gt;ConfigureServices&lt;/code&gt; of &lt;code&gt;startup.cs&lt;/code&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddCustomAuthentication&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;services    .AddCustomAuthentication(Configuration);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IServiceCollection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddCustomAuthentication&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IServiceCollection&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IConfiguration&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Identity Server Configuration&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;identityUrl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication:IdentityServerBaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddAuthentication&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;DefaultAuthenticateScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;JwtBearerDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;DefaultChallengeScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;JwtBearerDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddJwtBearer&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Authority&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;identityUrl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;RequireHttpsMetadata&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Audience&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;your_api&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Custom Authentication configuration&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddAuthentication&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomAuthenticationHandler&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;UserInfoEndpoint&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication:Custom:UserInfoEndpoint&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// we define policies here where we configure which scheme or combinations we need for each of our policies.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddAuthorization&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// authorize using custom auth scheme only&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddPolicy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;UserRole&amp;quot;&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationSchemes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;RequireRole&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;User&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// authorize using custom auth scheme as well as identity server&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddPolicy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;OrdersWrite&amp;quot;&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationSchemes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;JwtBearerDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationSchemes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CustomAuthenticationDefaults&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AuthenticationScheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;RequireClaim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;scope&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;orders:write&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration){    // Identity Server Configuration    var identityUrl = configuration.GetValue&lt;string&gt;(&amp;quot;Authentication:IdentityServerBaseUrl&amp;quot;);    services.AddAuthentication(options =&gt;    {        options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;        options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;    }).AddJwtBearer(options =&gt;    {        options.Authority = identityUrl;        options.RequireHttpsMetadata = false;        options.Audience = &amp;quot;your_api&amp;quot;;    });    // Custom Authentication configuration    services.AddAuthentication(CustomAuthenticationDefaults.AuthenticationScheme)        .AddScheme&lt;CustomAuthOptions, CustomAuthenticationHandler&gt;(CustomAuthenticationDefaults.AuthenticationScheme,        o =&gt; o.UserInfoEndpoint = configuration.GetValue&lt;string&gt;(&amp;quot;Authentication:Custom:UserInfoEndpoint&amp;quot;));    // we define policies here where we configure which scheme or combinations we need for each of our policies.    services.AddAuthorization(options =&gt;    {        // authorize using custom auth scheme only        options.AddPolicy(&amp;quot;UserRole&amp;quot;, policy =&gt;        {            policy.AuthenticationSchemes.Add(CustomAuthenticationDefaults.AuthenticationScheme);            policy.RequireRole(&amp;quot;User&amp;quot;);        });        // authorize using custom auth scheme as well as identity server        options.AddPolicy(&amp;quot;OrdersWrite&amp;quot;, policy =&gt;        {            policy.AuthenticationSchemes.Add(JwtBearerDefaults.AuthenticationScheme);            policy.AuthenticationSchemes.Add(CustomAuthenticationDefaults.AuthenticationScheme);            policy.RequireClaim(&amp;quot;scope&amp;quot;, &amp;quot;orders:write&amp;quot;);        });    });    return services;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;You can have different combinations in the policy defined above like based on scheme, claim, etc.&lt;/p&gt;
&lt;p&gt;The configuration in the &lt;code&gt;appsettings.json&lt;/code&gt; look like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Authentication&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Custom&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UserInfoEndpoint&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://yourcustomauthwebsite.com/user-info-path&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;IdentityServerBaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://url-of-idserver&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&amp;quot;Authentication&amp;quot;: {    &amp;quot;Custom&amp;quot;: {      &amp;quot;UserInfoEndpoint&amp;quot;: &amp;quot;https://yourcustomauthwebsite.com/user-info-path&amp;quot;    },    &amp;quot;IdentityServerBaseUrl&amp;quot;: &amp;quot;https://url-of-idserver&amp;quot;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Done, let’s enable the multi authorization to our endpoint. In the controller action,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Authorize&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Policy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;OrdersWrite&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ActionResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;OrderResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateOrder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;OrderRequest&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;orderRequest&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;clientIdClaim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;HttpContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FindFirst&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;client_id&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// identity server client&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;userIdClaim&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;HttpContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FindFirst&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ClaimTypes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;NameIdentifier&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// user authenticated using custom auth handler.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;[Authorize(Policy = &amp;quot;OrdersWrite&amp;quot;)]public async Task&lt;ActionResult&lt;OrderResult&gt;&gt; CreateOrder(OrderRequest orderRequest){    var clientIdClaim = HttpContext.User.FindFirst(&amp;quot;client_id&amp;quot;); // identity server client    var userIdClaim = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier); // user authenticated using custom auth handler.    ...}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Now we can invoke our create order endpoint with valid &lt;code&gt;bearer&lt;/code&gt; token as well as with our custom token.
The general format for authorization header is,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;Authorization: &amp;lt;type&amp;gt; &amp;lt;credentials&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;Authorization: &lt;type&gt; &lt;credentials&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;So bearer token request header looks like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And our custom token request header looks like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;Authorization: custom abcasdjasdjlaksdjlasjdlasjd&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;Authorization: custom abcasdjasdjlaksdjlasjdlasjd&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://joonasw.net/view/creating-auth-scheme-in-aspnet-core-2?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-using-multiple-authentication-schemes&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Creating an authentication scheme in ASP.NET Core 2.0 - Joonas W’s blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-using-multiple-authentication-schemes&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Authorize with a specific scheme in ASP.NET Core | Microsoft Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-using-multiple-authentication-schemes&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Policy-based authorization in ASP.NET Core | Microsoft Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>aspnet-core</category><author>Abhith Rajan</author></item><item><title>Serilog - Console Sink Themes</title><link>https://www.abhith.net/blog/serilog-console-sink-themes/</link><guid isPermaLink="true">https://www.abhith.net/blog/serilog-console-sink-themes/</guid><description>Curious about how each theme in Serilog.Sinks.Console looks like?
Check them here.</description><pubDate>Sat, 20 Jun 2020 19:17:00 GMT</pubDate><content:encoded>&lt;p&gt;Serilog is my favorite logger. The sinks I was using are ApplicationInsights, File, and Seq (for local). I was not using &lt;strong&gt;Console&lt;/strong&gt; sink but when we switched to &lt;code&gt;docker&lt;/code&gt;, I thought it is nice to have &lt;strong&gt;Console&lt;/strong&gt; too.&lt;/p&gt;
&lt;p&gt;I was checking the colored output for &lt;strong&gt;Console&lt;/strong&gt; and I realized that the &lt;code&gt;serilog-sinks-coloredconsole&lt;/code&gt; is retired and the &lt;code&gt;Serilog.Sinks.Console&lt;/code&gt; by default has the colored output. There were few color themes listed on the &lt;a href=&quot;https://github.com/serilog/serilog-sinks-console?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=serilog-console-sink-themes&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;readme&lt;/a&gt; so I want to see how each looks like, and see it for yourself below.&lt;/p&gt;
&lt;h2 id=&quot;built-in-themes&quot;&gt;Built-in Themes&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#built-in-themes&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;systemconsolethemeliterate-default&quot;&gt;SystemConsoleTheme.Literate (Default)&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#systemconsolethemeliterate-default&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console()&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;OR&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;SystemConsoleTheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Literate&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console(theme: SystemConsoleTheme.Literate)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/SystemConsoleTheme.Literate.C6BOluxk_Z1GfJax.webp&quot; alt=&quot;SystemConsoleTheme.Literate&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1901&quot; height=&quot;233&quot;&gt;&lt;figcaption&gt;SystemConsoleTheme.Literate&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;consolethemenone&quot;&gt;ConsoleTheme.None&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#consolethemenone&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ConsoleTheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;None&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console(theme: ConsoleTheme.None)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/ConsoleTheme.None.BqNVxee4_Zf8v8e.webp&quot; alt=&quot;ConsoleTheme.None&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1900&quot; height=&quot;231&quot;&gt;&lt;figcaption&gt;ConsoleTheme.None&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;systemconsolethemegrayscale&quot;&gt;SystemConsoleTheme.Grayscale&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#systemconsolethemegrayscale&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;SystemConsoleTheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Grayscale&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console(theme: SystemConsoleTheme.Grayscale)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/SystemConsoleTheme.Grayscale.mIKGcG-Z_ZTr5Gz.webp&quot; alt=&quot;SystemConsoleTheme.Grayscale&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1903&quot; height=&quot;224&quot;&gt;&lt;figcaption&gt;SystemConsoleTheme.Grayscale&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;ansiconsolethemeliterate&quot;&gt;AnsiConsoleTheme.Literate&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ansiconsolethemeliterate&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AnsiConsoleTheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Literate&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console(theme: AnsiConsoleTheme.Literate)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/AnsiConsoleTheme.Literate.COSyrLhO_drMmL.webp&quot; alt=&quot;AnsiConsoleTheme.Literate&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1901&quot; height=&quot;230&quot;&gt;&lt;figcaption&gt;AnsiConsoleTheme.Literate&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;ansiconsolethemegrayscale&quot;&gt;AnsiConsoleTheme.Grayscale&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ansiconsolethemegrayscale&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AnsiConsoleTheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Grayscale&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console(theme: AnsiConsoleTheme.Grayscale)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/AnsiConsoleTheme.Grayscale.70hs92ZR_c22RV.webp&quot; alt=&quot;AnsiConsoleTheme.Grayscale&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1902&quot; height=&quot;232&quot;&gt;&lt;figcaption&gt;AnsiConsoleTheme.Grayscale&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id=&quot;ansiconsolethemecode&quot;&gt;AnsiConsoleTheme.Code&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ansiconsolethemecode&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;AnsiConsoleTheme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.WriteTo.Console(theme: AnsiConsoleTheme.Code)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/AnsiConsoleTheme.Code.Dq4Wzsll_1Dvdpl.webp&quot; alt=&quot;AnsiConsoleTheme.Code&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1901&quot; height=&quot;236&quot;&gt;&lt;figcaption&gt;AnsiConsoleTheme.Code&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;final-notes&quot;&gt;Final Notes&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#final-notes&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the above list, my favorite so far is the &lt;code&gt;default&lt;/code&gt; one. I didn’t try any custom themes yet. if you know any good looking custom themes, let me know in the comments 👇&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/serilog/serilog-sinks-console?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=serilog-console-sink-themes&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;serilog/serilog-sinks-console&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>serilog</category><category>aspnet-core</category><category>logging</category><author>Abhith Rajan</author></item><item><title>Best FREE Form Provider for Static Websites</title><link>https://www.abhith.net/blog/best-free-form-provider-for-static-websites/</link><guid isPermaLink="true">https://www.abhith.net/blog/best-free-form-provider-for-static-websites/</guid><description>Planning to create a contact form for your static website?
Check out some of the best FREE services to ease your job.</description><pubDate>Wed, 10 Jun 2020 09:17:00 GMT</pubDate><content:encoded>&lt;p&gt;If you have a static website like a portfolio without a contact form then you are missing so many opportunities.
I realized it after adding a contact form on my website here.&lt;/p&gt;
&lt;p&gt;Now you might be thinking about how difficult it is to add a form to your website, and I can tell you that it is easier than you think. Without any backend codes, we can consume some of the awesome &lt;strong&gt;FORM BACKEND as a Service&lt;/strong&gt; providers. Some of them I explored yet are listed here.&lt;/p&gt;
&lt;h2 id=&quot;services&quot;&gt;Services&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#services&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;aside class=&quot;alert alert--important&quot; role=&quot;note&quot; aria-label=&quot;Important&quot;&gt; &lt;p class=&quot;alert__title&quot;&gt;&lt;span class=&quot;alert__icon&quot; aria-hidden=&quot;true&quot;&gt;!&lt;/span&gt;Important&lt;/p&gt; &lt;div class=&quot;alert__body&quot;&gt;&lt;p&gt;The plan details attached in this article are likely to get outdated soon
since the service providers are likely to change their plans frequently.&lt;/p&gt;&lt;/div&gt; &lt;/aside&gt;
&lt;h3 id=&quot;getform&quot;&gt;Getform&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#getform&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Form backend platform for designers
and developers&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;My current &lt;a href=&quot;https://www.abhith.net/contact/&quot;&gt;contact form&lt;/a&gt; is powered by &lt;a href=&quot;https://getform.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Getform&lt;/a&gt;. Their free plan details given below,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/Getform-pricing.MUkSBQof_1DI0tV.webp&quot; alt=&quot;Getform pricing&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;824&quot; height=&quot;759&quot;&gt;&lt;figcaption&gt;Getform pricing&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;del&gt;It indicates 100 Submissions in the FREE plan which I thought renews every month but the FAQ says it’s not.
That triggered me to search for another provider who offers a better FREE plan.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;The pricing model of &lt;a href=&quot;https://getform.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Getform&lt;/a&gt; changed and I am happy with the change.&lt;/p&gt;
&lt;p&gt;If you want to check how I created the contact form in this Gatsby website using &lt;strong&gt;&lt;a href=&quot;https://getform.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Getform&lt;/a&gt;&lt;/strong&gt;, check my commit &lt;a href=&quot;https://github.com/abhith/abhith.net/commit/ad46ca37cfd5bc76593aff0ca11a75156d1b77fb&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://getform.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Getform.io | Easy form endpoints for your forms&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;kwes-forms&quot;&gt;Kwes forms&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#kwes-forms&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It looks like &lt;a href=&quot;https://kwes.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Kwes&lt;/a&gt; offers more features and a generous 50 submissions per month for FREE.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/kwes-pricing.CHDruvvb_1NpdSg.webp&quot; alt=&quot;Kwes pricing&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1253&quot; height=&quot;538&quot;&gt;&lt;figcaption&gt;Kwes pricing&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://kwes.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Kwes forms | Form Endpoint Service&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;smartforms&quot;&gt;SmartForms&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#smartforms&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://smartforms.dev/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SmartForms&lt;/a&gt; also offers 50 submissions per month for free.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/smartforms-pricing.CzzzBvl-_sBeup.webp&quot; alt=&quot;SmartForms pricing&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1357&quot; height=&quot;804&quot;&gt;&lt;figcaption&gt;SmartForms pricing&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://smartforms.dev/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SmartForms - Powerful and easy to setup form backend that alerts you on E-email, Slack and Telegram!&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;formcarry&quot;&gt;formcarry.&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#formcarry&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If you want more submissions per month for FREE, look for &lt;a href=&quot;https://kwes.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;formcarry&lt;/a&gt;. It offers 100 submissions per month for FREE.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/formcarry-pricing.olfu_sS4_13SfLe.webp&quot; alt=&quot;formcarry pricing&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1182&quot; height=&quot;794&quot;&gt;&lt;figcaption&gt;formcarry pricing&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://formcarry.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Formcarry. | Hassle-Free Form Backend&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;formsubmit&quot;&gt;formsubmit&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#formsubmit&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If you want unlimited submissions for FREE, &lt;strong&gt;&lt;a href=&quot;https://formsubmit.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Formsubmit&lt;/a&gt;&lt;/strong&gt; is the one.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Formsubmit sends all your form submissions to your email without having a need for any coding or a backbend. SignUp (optional) to get additional advantages.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And they don’t even have a pricing page to show 💙&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://formsubmit.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Formsubmit&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#conclusion&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I didn’t switch from &lt;strong&gt;&lt;a href=&quot;https://getform.io/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Getform&lt;/a&gt;&lt;/strong&gt; yet and am still reviewing other services. I will update this article whenever I find better solutions.
If you know any good services in this category, let me know in the comments 👇&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://css-tricks.com/a-comparison-of-static-form-providers/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;A Comparison of Static Form Providers | CSS-Tricks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://serverless.css-tricks.com/services/forms/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Services | Forms - The Power of Serverless for Front-End Developers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.gatsbyjs.org/docs/building-a-contact-form/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-free-form-provider-for-static-websites&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Building a Contact Form | GatsbyJS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>developer-tools</category><category>awesome-list</category><category>gatsby</category><author>Abhith Rajan</author></item><item><title>2020 Pluralsight Free April Month Review</title><link>https://www.abhith.net/blog/2020-pluralsight-free-april-review/</link><guid isPermaLink="true">https://www.abhith.net/blog/2020-pluralsight-free-april-review/</guid><description>Want to know How I spend my FREE April month on Pluralsight, plus how to extend Pluralsight subscription for another one free month.</description><pubDate>Sat, 02 May 2020 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;I completed the #FreeApril of Pluralsight and it was very productive. In this one month, I completed around 16 courses, and they are,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/completed-courses.DoCw8nLs_ZfeeFP.webp&quot; alt=&quot;Completed Courses&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1037&quot; height=&quot;880&quot;&gt;&lt;figcaption&gt;Completed Courses&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And I tested my Skills IQ,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/skills-iq.DR34qQpX_2i80vw.webp&quot; alt=&quot;Skills IQ&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1295&quot; height=&quot;800&quot;&gt;&lt;figcaption&gt;Skills IQ&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And there are many other courses which I started watching but yet not finished,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/history.D1K3hhoa_Z12nmA6.webp&quot; alt=&quot;History&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1920&quot; height=&quot;3035&quot;&gt;&lt;figcaption&gt;History&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Also, you can check my public profile on &lt;strong&gt;Pluralsight&lt;/strong&gt;,&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://app.pluralsight.com/profile/abhith?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=2020-pluralsight-free-april-review&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Abhith Rajan | Pluralsight Profile&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;extending-pluralsight-subscription-for-another-one-free-month&quot;&gt;Extending Pluralsight Subscription For Another One Free Month&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#extending-pluralsight-subscription-for-another-one-free-month&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I extended my &lt;strong&gt;Pluralsight&lt;/strong&gt; subscription for one more month by activating the &lt;strong&gt;Visual Studio Dev Essentials&lt;/strong&gt; benefit, its &lt;strong&gt;FREE&lt;/strong&gt;.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/visual-studio-dev-essentials-benefits.tKRtR4Ys_Z1j1xDx.webp&quot; alt=&quot;Visual Studio Dev Essentials Benefits&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1824&quot; height=&quot;908&quot;&gt;&lt;figcaption&gt;Visual Studio Dev Essentials Benefits&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;If you don’t have an account on &lt;strong&gt;Visual Studio Dev Essentials&lt;/strong&gt;, join on the link below, its also free and have many other benefits like shown above,&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://visualstudio.microsoft.com/dev-essentials/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=2020-pluralsight-free-april-review&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Visual Studio Dev Essentials&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;discounts&quot;&gt;Discounts&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#discounts&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If you have enough budget, you can signup for their paid subscription, and get some &lt;strong&gt;DISCOUNTS&lt;/strong&gt; by using my referral,&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;http://referral.pluralsight.com/mQgi3iP?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=2020-pluralsight-free-april-review&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Pluralsight Referral - Abhith&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-is-the-plan-after-subscription-expiry&quot;&gt;What is the plan, After Subscription Expiry&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#what-is-the-plan-after-subscription-expiry&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After this extra free month of Pluralsight, I plan to start the free month of &lt;strong&gt;LinkedIn Learning&lt;/strong&gt; and will compare the course quality with &lt;strong&gt;Pluralsight&lt;/strong&gt;, then I might switch to a paid plan on either of these two platforms.&lt;/p&gt;
&lt;p&gt;I know many companies provide access to these e-learning platforms to their employees, if you are getting such a benefit from your firm, let me know in the comments 👇&lt;/p&gt;</content:encoded><category>courses</category><author>Abhith Rajan</author></item><item><title>.NET Core - NuGet Packages CI &amp; CD Using GitHub Actions</title><link>https://www.abhith.net/blog/dotnet-core-nuget-packages-ci-cd-using-github-actions/</link><guid isPermaLink="true">https://www.abhith.net/blog/dotnet-core-nuget-packages-ci-cd-using-github-actions/</guid><description>Build and run tests on every commit. Automatically upload NuGet packages on every release. All using GitHub actions for your .NET Core Class Libraries.</description><pubDate>Thu, 02 Apr 2020 00:11:27 GMT</pubDate><content:encoded>&lt;p&gt;I always likes to automate the repeatative part of my work. At work, Azure DevOps taking care of the most of the CI &amp;amp; CD. I do maintain a small Class Library project in GitHub which has some helpers and stuffs you know like we reuse on most projects. And is been published to NuGet so that it can be consumed easily.&lt;/p&gt;
&lt;p&gt;Recently I added one more project to the same repo which has some common stuff for ASP.NET Core projects. Previously I used to manually upload the .nuget pack file to NuGet since the releases were not that frequent. But now, the number of projects doubled, and sometime we need to deploy both packages since the ASP.NET Core project depends on the other library. So I did automated the whole process using GitHub actions. Here is how I did that,&lt;/p&gt;
&lt;p&gt;You can check my repo where you can find the &lt;strong&gt;GitHub Actions&lt;/strong&gt; configuration &lt;code&gt;yml&lt;/code&gt; files under the &lt;code&gt;.github/workflows/&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://github.com/Abhith/Code.Library&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Abhith/Code.Library&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have two actions,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;CI&lt;/li&gt;
&lt;li&gt;Release to NuGet&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;ci&quot;&gt;CI&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ci&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The CI (Continuous Integration) action basically runs on every commit to the &lt;strong&gt;master&lt;/strong&gt; branch as well as for every PR to master.&lt;/p&gt;
&lt;p&gt;And the jobs are pretty self-explanatory,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Setting up dotnet on the Linux&lt;/li&gt;
&lt;li&gt;Builds the solution file&lt;/li&gt;
&lt;li&gt;Run tests&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# This is a basic workflow to help you get started with Actions&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;CI&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Controls when the action will run. Triggers the workflow on push or pull request&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# events but only for the master branch&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;branches&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;master&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pull_request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;branches&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;master&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# A workflow run is made up of one or more jobs that can run sequentially or in parallel&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# This workflow contains a single job called &amp;quot;build&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# The type of runner that the job will run on&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;runs-on&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Steps represent a sequence of tasks that will be executed as part of the job&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;actions/checkout@v2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Setup .NET Core&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;actions/setup-dotnet@v1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dotnet-version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;3.1.101&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Build with dotnet&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;dotnet build --configuration Release&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;working-directory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;./src&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Test&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;dotnet test&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;working-directory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;./src&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;# This is a basic workflow to help you get started with Actionsname: CI# Controls when the action will run. Triggers the workflow on push or pull request# events but only for the master branchon:  push:    branches: [master]  pull_request:    branches: [master]# A workflow run is made up of one or more jobs that can run sequentially or in paralleljobs:  # This workflow contains a single job called &amp;quot;build&amp;quot;  build:    # The type of runner that the job will run on    runs-on: ubuntu-latest    # Steps represent a sequence of tasks that will be executed as part of the job    steps:      - uses: actions/checkout@v2      - name: Setup .NET Core        uses: actions/setup-dotnet@v1        with:          dotnet-version: 3.1.101      - name: Build with dotnet        run: dotnet build --configuration Release        working-directory: ./src      - name: Test        run: dotnet test        working-directory: ./src&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/CI.BUutZqDh_dnUFJ.webp&quot; alt=&quot;Continuous Integration&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;653&quot; height=&quot;506&quot;&gt;&lt;figcaption&gt;Continuous Integration&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;release-to-nuget&quot;&gt;Release to NuGet&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#release-to-nuget&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This action runs on every new release. And the jobs include,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Setting up dotnet on the Linux&lt;/li&gt;
&lt;li&gt;Create the .nupkg files&lt;/li&gt;
&lt;li&gt;Uploads artifacts&lt;/li&gt;
&lt;li&gt;Upload the Nuget packages&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# This is a basic workflow to help you get started with Actions&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Release to NuGet&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Controls when the action will run. Triggers the workflow on push or pull request&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# events but only for the master branch&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;release&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;types&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;published&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# A workflow run is made up of one or more jobs that can run sequentially or in parallel&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# This workflow contains a single job called &amp;quot;build&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# The type of runner that the job will run on&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;runs-on&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Steps represent a sequence of tasks that will be executed as part of the job&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;actions/checkout@v2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Setup .NET Core&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;actions/setup-dotnet@v1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dotnet-version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;3.1.101&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Create NuGet Package&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;dotnet pack -c Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes=&amp;quot;See https://github.com/Abhith/Code.Library/releases/tag/${{ github.event.release.tag_name }}&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;working-directory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;./src&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Archive NuGet Package&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;actions/upload-artifact@v1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Code.Library&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;./src/Code.Library/bin/Release/Code.Library.${{ github.event.release.tag_name }}.nupkg&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Archive NuGet Package&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;actions/upload-artifact@v1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Code.Library.AspNetCore&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;./src/Code.Library.AspNetCore/bin/Release/Code.Library.AspNetCore.${{ github.event.release.tag_name }}.nupkg&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Publish Nuget Package&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;dotnet nuget push **/*.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json --no-symbols true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;# This is a basic workflow to help you get started with Actionsname: Release to NuGet# Controls when the action will run. Triggers the workflow on push or pull request# events but only for the master branchon:  release:    types: [published]# A workflow run is made up of one or more jobs that can run sequentially or in paralleljobs:  # This workflow contains a single job called &amp;quot;build&amp;quot;  build:    # The type of runner that the job will run on    runs-on: ubuntu-latest    # Steps represent a sequence of tasks that will be executed as part of the job    steps:      - uses: actions/checkout@v2      - name: Setup .NET Core        uses: actions/setup-dotnet@v1        with:          dotnet-version: 3.1.101      - name: Create NuGet Package        run: dotnet pack -c Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes=&amp;quot;See https://github.com/Abhith/Code.Library/releases/tag/${{ github.event.release.tag_name }}&amp;quot;        working-directory: ./src      - name: Archive NuGet Package        uses: actions/upload-artifact@v1        with:          name: Code.Library          path: ./src/Code.Library/bin/Release/Code.Library.${{ github.event.release.tag_name }}.nupkg      - name: Archive NuGet Package        uses: actions/upload-artifact@v1        with:          name: Code.Library.AspNetCore          path: ./src/Code.Library.AspNetCore/bin/Release/Code.Library.AspNetCore.${{ github.event.release.tag_name }}.nupkg      - name: Publish Nuget Package        run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json --no-symbols true&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/release.BAHNtSY1_BmGpw.webp&quot; alt=&quot;Release to NuGet&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;635&quot; height=&quot;569&quot;&gt;&lt;figcaption&gt;Release to NuGet&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;You can see that I am pushing 2 NuGet packages and both have the same version number, which is same as my release tag on GitHub.&lt;/p&gt;
&lt;p&gt;During &lt;strong&gt;Create NuGet Package&lt;/strong&gt; stage, initially it was failing with following error&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;.dll&amp;#39; to be packed was not found on disk&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;.dll&apos; to be packed was not found on disk&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This was because, in one of the project, it had following Settings in the .csproj file&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;GeneratePackageOnBuild&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;GeneratePackageOnBuild&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&lt;GeneratePackageOnBuild&gt;true&lt;/GeneratePackageOnBuild&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Once I removed the above, everything went well. You can see a similar issue posted &lt;a href=&quot;https://github.com/dotnet/sdk/issues/10335?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dotnet-core-nuget-packages-ci-cd-using-github-actions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And the “Publish NuGet Package” job requires an API key from NuGet. You can get the API key from NuGet by logging into your NuGet account, create a new API key.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/NuGet-keys.BlaaFSEv_14Oahp.webp&quot; alt=&quot;NuGet API Key&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;284&quot; height=&quot;430&quot;&gt;&lt;figcaption&gt;NuGet API Key&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And I stored the key under my repo secrets.&lt;/p&gt;
&lt;h3 id=&quot;manage-secrets-in-github-repository&quot;&gt;Manage Secrets in GitHub Repository&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#manage-secrets-in-github-repository&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To manage secrets, on your repo go to the “Settings” tab, under that “Secrets”. There I added a secret with name “nuget_api_key” and we can access those secrets inside actions like &lt;code&gt;${{ secrets.nuget_api_key }}&lt;/code&gt;.&lt;/p&gt;</content:encoded><category>dotnet-core</category><category>devops</category><category>github</category><author>Abhith Rajan</author></item><item><title>Best Visual Studio Extensions</title><link>https://www.abhith.net/blog/best-visual-studio-extensions/</link><guid isPermaLink="true">https://www.abhith.net/blog/best-visual-studio-extensions/</guid><description>My favorite extensions for Visual Studio 2022</description><pubDate>Tue, 17 Mar 2020 17:50:10 GMT</pubDate><content:encoded>&lt;p&gt;During my work, I spend the most time with Visual Studio.
Now because of &lt;strong&gt;VSCode&lt;/strong&gt;, Visual Studio is getting little more free time.
There was a time when I just thought that I couldn’t be productive without &lt;strong&gt;ReSharper&lt;/strong&gt; for Visual Studio.
But those times changed since Visual Studio is getting better with every new release. The number of extensions in the marketplace also helps.
The following are my favorite tools and extensions for Visual Studio 2022.&lt;/p&gt;
&lt;aside class=&quot;alert alert--info&quot; role=&quot;note&quot; aria-label=&quot;Info&quot;&gt; &lt;p class=&quot;alert__title&quot;&gt;&lt;span class=&quot;alert__icon&quot; aria-hidden=&quot;true&quot;&gt;ℹ&lt;/span&gt;Info&lt;/p&gt; &lt;div class=&quot;alert__body&quot;&gt;&lt;p&gt;Some of the below items are extension packs, which contain several extensions.&lt;/p&gt;&lt;/div&gt; &lt;/aside&gt;
&lt;h2 id=&quot;free-tools&quot;&gt;Free Tools&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#free-tools&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;codemaid-vs2022&quot;&gt;CodeMaid VS2022&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#codemaid-vs2022&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaidVS2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/SteveCadwallader.CodeMaidVS2022.svg&quot; alt=&quot;CodeMaid VS2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/SteveCadwallader.CodeMaidVS2022.svg&quot; alt=&quot;CodeMaid VS2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/SteveCadwallader.CodeMaidVS2022.svg&quot; alt=&quot;CodeMaid VS2022&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaidVS2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;CodeMaid VS2022&lt;/a&gt; is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.&lt;/p&gt;
&lt;h3 id=&quot;ef-core-power-tools&quot;&gt;EF Core Power Tools&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ef-core-power-tools&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/ErikEJ.EFCorePowerTools.svg&quot; alt=&quot;EF Core Power Tools&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/ErikEJ.EFCorePowerTools.svg&quot; alt=&quot;EF Core Power Tools&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/ErikEJ.EFCorePowerTools.svg&quot; alt=&quot;EF Core Power Tools&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;EF Core Power Tools&lt;/a&gt; adds useful design-time DbContext features to the Visual Studio Solution Explorer context menu.&lt;/p&gt;
&lt;h3 id=&quot;productivity-power-tools-2022&quot;&gt;Productivity Power Tools 2022&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#productivity-power-tools-2022&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.ProductivityPowerPack2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/VisualStudioPlatformTeam.ProductivityPowerPack2022.svg&quot; alt=&quot;Productivity Power Tools 2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/VisualStudioPlatformTeam.ProductivityPowerPack2022.svg&quot; alt=&quot;Productivity Power Tools 2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/VisualStudioPlatformTeam.ProductivityPowerPack2022.svg&quot; alt=&quot;Productivity Power Tools 2022&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.ProductivityPowerPack2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Productivity Power Tools 2022&lt;/a&gt; installs the individual extensions of Productivity Power Tools 2022&lt;/p&gt;
&lt;p&gt;This is an extension pack installer will install each of the individual components of Productivity Power Tools for Visual Studio 2022.&lt;/p&gt;
&lt;p&gt;The following components will be installed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Align Assignments 2022&lt;/li&gt;
&lt;li&gt;Double-Click Maximize 2022&lt;/li&gt;
&lt;li&gt;Copy As Html 2022&lt;/li&gt;
&lt;li&gt;Fix Mixed Tabs 2022&lt;/li&gt;
&lt;li&gt;Match Margin 2022&lt;/li&gt;
&lt;li&gt;Middle-Click Scroll 2022&lt;/li&gt;
&lt;li&gt;Peek Help 2022&lt;/li&gt;
&lt;li&gt;Shrink Empty Lines 2022&lt;/li&gt;
&lt;li&gt;Solution Error Visualizer 2022&lt;/li&gt;
&lt;li&gt;Time Stamp Margin 2022&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;tweaks-2022&quot;&gt;Tweaks 2022&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#tweaks-2022&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.Tweaks2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/MadsKristensen.Tweaks2022.svg&quot; alt=&quot;Tweaks 2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/MadsKristensen.Tweaks2022.svg&quot; alt=&quot;Tweaks 2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/MadsKristensen.Tweaks2022.svg&quot; alt=&quot;Tweaks 2022&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.Tweaks2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Tweaks 2022&lt;/a&gt; contains collection of minor fixes and tweaks for Visual Studio to reduce the paper cuts and make you a happier developer.&lt;/p&gt;
&lt;h3 id=&quot;wakatime-for-vs2022-preview&quot;&gt;WakaTime (For VS2022 Preview)&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#wakatime-for-vs2022-preview&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=WakaTime.WakaTime-2022-preview&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/WakaTime.WakaTime-2022-preview.svg&quot; alt=&quot;WakaTime&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/WakaTime.WakaTime-2022-preview.svg&quot; alt=&quot;WakaTime&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/WakaTime.WakaTime-2022-preview.svg&quot; alt=&quot;WakaTime&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=WakaTime.WakaTime-2022-preview&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;WakaTime&lt;/a&gt; does metrics, insights, and time tracking automatically generated from your programming activity. This extension will be replaced by WakaTime when VS 2022 is officially released.&lt;/p&gt;
&lt;h3 id=&quot;xunitnettestgenerator2022&quot;&gt;xUnit.net.TestGenerator2022&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#xunitnettestgenerator2022&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=YowkoTsai.xunitnettestgenerator2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/YowkoTsai.xunitnettestgenerator2022.svg&quot; alt=&quot;xUnit.net.TestGenerator2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/YowkoTsai.xunitnettestgenerator2022.svg&quot; alt=&quot;xUnit.net.TestGenerator2022&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/YowkoTsai.xunitnettestgenerator2022.svg&quot; alt=&quot;xUnit.net.TestGenerator2022&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=YowkoTsai.xunitnettestgenerator2022&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;xUnit.net.TestGenerator2022&lt;/a&gt; adds xUnit.net Test Generator extensions for Visual Studio 2022. Creates Unit tests with xUnit.net 2.0 framework. Works on Visual Studio 2022.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;visual-studio-2019&quot;&gt;Visual Studio 2019&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#visual-studio-2019&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Following are the ones which I previously used with Visual Studio 2019.
Those are not brought to the upper list due to any of the following reasons,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Incompatibility with VS 2022&lt;/li&gt;
&lt;li&gt;Not tried myself in VS 2022 (Especially the paid ones)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;free-tools-1&quot;&gt;Free Tools&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#free-tools-1&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id=&quot;better-comments&quot;&gt;Better Comments&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#better-comments&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=OmarRwemi.BetterComments&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/OmarRwemi.BetterComments.svg&quot; alt=&quot;Better Comments&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/OmarRwemi.BetterComments.svg&quot; alt=&quot;Better Comments&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/OmarRwemi.BetterComments.svg&quot; alt=&quot;Better Comments&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=OmarRwemi.BetterComments&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Better Comments&lt;/a&gt; is a Visual Studio extension that gives you the ability to customize the font and opacity of your comments independently of the editor’s font settings. It also adds four additional comment classifications, each classification with its own customizable foreground.&lt;/p&gt;
&lt;h4 id=&quot;buildvision&quot;&gt;BuildVision&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#buildvision&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=stefankert.BuildVision&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/stefankert.BuildVision.svg&quot; alt=&quot;BuildVision&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/stefankert.BuildVision.svg&quot; alt=&quot;BuildVision&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/stefankert.BuildVision.svg&quot; alt=&quot;BuildVision&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=stefankert.BuildVision&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;BuildVision&lt;/a&gt; visualize the building process in a table format.&lt;/p&gt;
&lt;h4 id=&quot;open-in-visual-studio-code&quot;&gt;Open in Visual Studio Code&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#open-in-visual-studio-code&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpeninVisualStudioCode&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/MadsKristensen.OpeninVisualStudioCode.svg&quot; alt=&quot;Open in Visual Studio Code&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/MadsKristensen.OpeninVisualStudioCode.svg&quot; alt=&quot;Open in Visual Studio Code&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/MadsKristensen.OpeninVisualStudioCode.svg&quot; alt=&quot;Open in Visual Studio Code&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpeninVisualStudioCode&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Open in Visual Studio Code&lt;/a&gt; adds a menu command that lets you open any solution, project, folder and file in Visual Studio Code.&lt;/p&gt;
&lt;h4 id=&quot;roslynator-2019&quot;&gt;Roslynator 2019&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#roslynator-2019&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=josefpihrt.Roslynator2019&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/josefpihrt.Roslynator2019.svg&quot; alt=&quot;Roslynator 2019&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/josefpihrt.Roslynator2019.svg&quot; alt=&quot;Roslynator 2019&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/josefpihrt.Roslynator2019.svg&quot; alt=&quot;Roslynator 2019&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=josefpihrt.Roslynator2019&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Roslynator 2019&lt;/a&gt; is a collection of 500+ analyzers, refactorings and fixes for C#, powered by Roslyn.&lt;/p&gt;
&lt;h4 id=&quot;the-essentials&quot;&gt;The Essentials&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#the-essentials&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BasicEssentials&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/MadsKristensen.BasicEssentials.svg&quot; alt=&quot;The Essentials&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/MadsKristensen.BasicEssentials.svg&quot; alt=&quot;The Essentials&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/MadsKristensen.BasicEssentials.svg&quot; alt=&quot;The Essentials&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BasicEssentials&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;The Essentials&lt;/a&gt; is an extension pack for Visual Studio 2019 containing extensions no developer should be without. These extensions will add important functionality that will make you more productive and a happier developer.&lt;/p&gt;
&lt;h5 id=&quot;extensions&quot;&gt;Extensions&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#extensions&quot;&gt;#&lt;/a&gt;&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.AddNewFile&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Add New File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.EditorEnhancements&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Editor Enhancements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.EditorConfig&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;EditorConfig Language Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.DeveloperNews&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Developer News&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.FileIcons&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;File Icons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.insertguid&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Insert GUID&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.LearntheShortcut&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Learn the Shortcut&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Markdown Editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=NikolayBalakin.Outputenhancer&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Output Enhancer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.Tweaks&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Tweaks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;trailing-whitespace-visualizer&quot;&gt;Trailing Whitespace Visualizer&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#trailing-whitespace-visualizer&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/MadsKristensen.TrailingWhitespaceVisualizer.svg&quot; alt=&quot;Trailing Whitespace Visualizer&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/MadsKristensen.TrailingWhitespaceVisualizer.svg&quot; alt=&quot;Trailing Whitespace Visualizer&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/MadsKristensen.TrailingWhitespaceVisualizer.svg&quot; alt=&quot;Trailing Whitespace Visualizer&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Trailing Whitespace Visualizer&lt;/a&gt; keeps your code files clean by making it easier than ever to identify and remove any trailing whitespace.&lt;/p&gt;
&lt;h4 id=&quot;visual-studio-intellicode&quot;&gt;Visual Studio IntelliCode&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#visual-studio-intellicode&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.VSIntelliCode&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/VisualStudioExptTeam.VSIntelliCode.svg&quot; alt=&quot;Visual Studio IntelliCode&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/VisualStudioExptTeam.VSIntelliCode.svg&quot; alt=&quot;Visual Studio IntelliCode&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/VisualStudioExptTeam.VSIntelliCode.svg&quot; alt=&quot;Visual Studio IntelliCode&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.VSIntelliCode&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Visual Studio IntelliCode&lt;/a&gt;(IntelliCode) is a set of AI-assisted capabilities that improve developer productivity with features like contextual IntelliSense, argument completion, code formatting, and style rule inference.&lt;/p&gt;
&lt;p&gt;IntelliCode augments existing developer workflows with machine-learning services that provide an understanding of code and its context. It’s applicable for C#, C++ (in preview), JavaScript/TypeScript (in preview), and XAML code today, and will be updated in the future to support more languages.&lt;/p&gt;
&lt;h4 id=&quot;visual-studio-spell-checker-vs2017-and-later&quot;&gt;Visual Studio Spell Checker (VS2017 and Later)&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#visual-studio-spell-checker-vs2017-and-later&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/EWoodruff.VisualStudioSpellCheckerVS2017andLater.svg&quot; alt=&quot;Visual Studio Spell Checker (VS2017 and Later)&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/EWoodruff.VisualStudioSpellCheckerVS2017andLater.svg&quot; alt=&quot;Visual Studio Spell Checker (VS2017 and Later)&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/EWoodruff.VisualStudioSpellCheckerVS2017andLater.svg&quot; alt=&quot;Visual Studio Spell Checker (VS2017 and Later)&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Visual Studio Spell Checker (VS2017 and Later)&lt;/a&gt; is an editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. It can also spell check an entire solution, project, or selected items. Options are available to define multiple languages to spell check agains…&lt;/p&gt;
&lt;h4 id=&quot;web-essentials-2019&quot;&gt;Web Essentials 2019&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#web-essentials-2019&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebEssentials2019&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/MadsKristensen.WebEssentials2019.svg&quot; alt=&quot;Web Essentials 2019&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/MadsKristensen.WebEssentials2019.svg&quot; alt=&quot;Web Essentials 2019&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/MadsKristensen.WebEssentials2019.svg&quot; alt=&quot;Web Essentials 2019&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebEssentials2019&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Web Essentials 2019&lt;/a&gt; is the easiest way to set up Visual Studio for the ultimate web development experience.&lt;/p&gt;
&lt;h5 id=&quot;extensions-1&quot;&gt;Extensions&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#extensions-1&quot;&gt;#&lt;/a&gt;&lt;/h5&gt;
&lt;p&gt;After installing the Web Essentials and restarting
Visual Studio, the following extensions will be installed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/3f820e99-6c0d-41db-aa74-a18d9623b1f3?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Add New File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/46eef4d9-045b-4596-bd7f-eee980bb5450?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Browser Reload on Save&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/5741a548-5179-4a77-ad96-fca71535774d?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Browser Sync&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Bundler &amp;amp; Minifier&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CssTools2019&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;CSS Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/4f64e542-3772-4136-8f87-0113441c7aa1?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Editor Enhancements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/5e1762e8-a88b-417c-8467-6a65d771cc4e?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;File Icons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/3ebde8fb-26d8-4374-a0eb-1e4e2665070c?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;File Nesting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=RionWilliams.Glyphfriend2019&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Glyphfriend&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/8bb845e9-5717-4eae-aed3-1fdf6fe5819a?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Image Sprites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/a56eddd3-d79b-48ac-8c8f-2db06ade77c3?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Image Optimizer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/eaab33c3-437b-4918-8354-872dfe5d1bfe?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Markdown Editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/4e84e2cf-2d6b-472a-b1e2-b84932511379?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Open Command Line&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/753b9720-1638-4f9a-ad8d-2c45a410fd74?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Package Installer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.PackageSecurityAlerts&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Package Security Alerts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.SvgViewer&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SVG Viewer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/3aabefab-1681-4fea-8f95-6a62e2f0f1ec?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Web Accessibility Checker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/3b329021-cd7a-4a01-86fc-714c2d05bb6c?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Web Compiler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ZenCoding&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;ZenCoding&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h3 id=&quot;paid&quot;&gt;Paid&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#paid&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id=&quot;ndepend&quot;&gt;NDepend&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ndepend&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=PatrickSmacchia.NDepend&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/PatrickSmacchia.NDepend.svg&quot; alt=&quot;NDepend&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/PatrickSmacchia.NDepend.svg&quot; alt=&quot;NDepend&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/PatrickSmacchia.NDepend.svg&quot; alt=&quot;NDepend&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.ndepend.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NDepend&lt;/a&gt; is a Visual Studio and Azure DevOps/TFS extension that makes it easy to manage Code Quality on large and complex .NET code base&lt;/p&gt;
&lt;h4 id=&quot;ncrunch-for-visual-studio&quot;&gt;NCrunch for Visual Studio&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ncrunch-for-visual-studio&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=NCrunch.NCrunchforVisualStudio&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/NCrunch.NCrunchforVisualStudio.svg&quot; alt=&quot;NCrunch for Visual Studio&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/NCrunch.NCrunchforVisualStudio.svg&quot; alt=&quot;NCrunch for Visual Studio&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/NCrunch.NCrunchforVisualStudio.svg&quot; alt=&quot;NCrunch for Visual Studio&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=NCrunch.NCrunchforVisualStudio&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;NCrunch for Visual Studio&lt;/a&gt; is Distributed continuous build and test runner. Persistent Inline Code Coverage, Performance Metrics. Navigation + more!&lt;/p&gt;
&lt;h4 id=&quot;ozcode&quot;&gt;OzCode&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ozcode&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=CodeValueLtd.OzCode&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/CodeValueLtd.OzCode.svg&quot; alt=&quot;OzCode&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/CodeValueLtd.OzCode.svg&quot; alt=&quot;OzCode&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/CodeValueLtd.OzCode.svg&quot; alt=&quot;OzCode&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=CodeValueLtd.OzCode&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;OzCode&lt;/a&gt; is a revolutionary debugging extension which complements Visual Studio and supercharges the C# debugging experience!.&lt;/p&gt;
&lt;h4 id=&quot;resharper&quot;&gt;ReSharper&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#resharper&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=JetBrains.ReSharper&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/version-short/JetBrains.ReSharper.svg&quot; alt=&quot;ReSharper&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/installs-short/JetBrains.ReSharper.svg&quot; alt=&quot;ReSharper&quot;/&gt;&lt;img src=&quot;https://vsmarketplacebadge.apphb.com/rating-short/JetBrains.ReSharper.svg&quot; alt=&quot;ReSharper&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=JetBrains.ReSharper&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-visual-studio-extensions&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;ReSharper&lt;/a&gt; is a legendary .NET productivity tool: find and fix errors and code smells; navigate and refactor; run unit tests and write quality code faster.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;older-visual-studio-extensions-list&quot;&gt;Older Visual Studio Extensions List&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#older-visual-studio-extensions-list&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.abhith.net/blog/the-best-extensions-for-visual-studio-2010/&quot;&gt;Visual Studio 2010&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Did I miss something? If you think so, drop a line with the extension name in the comments below 👇.
I will be updating this post whenever I find a good extension for Visual Studio.&lt;/p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#changelog&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;2022-01-16&quot;&gt;2022-01-16&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2022-01-16&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;VS 2022 extensions added&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2020-11-14&quot;&gt;2020-11-14&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-11-14&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added EF Core Power Tools&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2020-08-20&quot;&gt;2020-08-20&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-08-20&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added The Essentials&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2020-08-09&quot;&gt;2020-08-09&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-08-09&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added Open in Visual Studio Code&lt;/li&gt;
&lt;li&gt;Moved NDepend to Paid&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2020-04-08&quot;&gt;2020-04-08&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-04-08&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added xUnit.net.TestGenerator&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2020-03-20&quot;&gt;2020-03-20&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-03-20&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added Roslynator 2019.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2020-03-18&quot;&gt;2020-03-18&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-03-18&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added Better Comments.&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>visual-studio</category><category>ide</category><category>awesome-list</category><author>Abhith Rajan</author></item><item><title>Style Guide - SQL Server Auditing Column Names</title><link>https://www.abhith.net/blog/style-guide-sql-server-auditing-column-names/</link><guid isPermaLink="true">https://www.abhith.net/blog/style-guide-sql-server-auditing-column-names/</guid><description>Naming convention for auditing fields in a SQL server table.</description><pubDate>Wed, 05 Feb 2020 08:26:00 GMT</pubDate><content:encoded>&lt;p&gt;For most of the tables in our DB will have some kind of auditing fields.
Following are the column names I used to use for those auditing fields.&lt;/p&gt;
&lt;h2 id=&quot;creation-audited&quot;&gt;Creation Audited&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#creation-audited&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Column Name&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Nullable&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;CreationTime&lt;/td&gt;&lt;td&gt;datetime2(7)&lt;/td&gt;&lt;td&gt;NOT NULL&lt;/td&gt;&lt;td&gt;eg. 2019-09-15 13:56:13.8955178&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CreatorUserId&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;modification-audited&quot;&gt;Modification Audited&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#modification-audited&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Column Name&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Nullable&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;LastModificationTime&lt;/td&gt;&lt;td&gt;datetime2(7)&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LastModifierUserId&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;soft-delete&quot;&gt;Soft Delete&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#soft-delete&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Column Name&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Nullable&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;IsDeleted&lt;/td&gt;&lt;td&gt;bit&lt;/td&gt;&lt;td&gt;NOT NULL&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeleterUserId&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeletionTime&lt;/td&gt;&lt;td&gt;datetime2(7)&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;If you have worked with &lt;a href=&quot;https://aspnetboilerplate.com/Pages/Documents/Entities?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=style-guide-sql-server-auditing-column-names#auditing&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;ABP&lt;/a&gt; before, you know from where I adopted the naming convention.&lt;/p&gt;
&lt;p&gt;When I work on a non-ABP project, I used to follow the same column names.&lt;/p&gt;
&lt;p&gt;Let me know what you used to name for auditing columns in the comments. 👇&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime2-transact-sql?view=sql-server-ver15&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=style-guide-sql-server-auditing-column-names&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;datetime2 (Transact-SQL) - SQL Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>sql-server</category><category>style-guide</category><author>Abhith Rajan</author></item><item><title>Azure DevOps - GatsbyJs Build Pipeline</title><link>https://www.abhith.net/blog/azure-devops-gatsbyjs-build-pipeline/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-devops-gatsbyjs-build-pipeline/</guid><description>Continuous Integration &amp; Continuous Deployment for your GatsbyJS website using Azure Pipelines.</description><pubDate>Tue, 04 Feb 2020 15:11:27 GMT</pubDate><content:encoded>&lt;p&gt;For long I was using &lt;strong&gt;Netlify&lt;/strong&gt; to do &lt;strong&gt;CI/CD&lt;/strong&gt; for &lt;code&gt;this&lt;/code&gt; website and was using their free plan. But when they introduced the build minutes limit, I had to switch to another option.&lt;/p&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Bad news 📰 in the morning&lt;br&gt;New limit on &lt;a href=&quot;https://x.com/hashtag/netlify?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#netlify&lt;/a&gt; build minutes.&lt;br&gt;Looking for alternative options! &lt;a href=&quot;https://t.co/W12MwlyOcn&quot;&gt;pic.twitter.com/W12MwlyOcn&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1206789696950611969?ref_src=twsrc%5Etfw&quot;&gt;December 17, 2019&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;
&lt;p&gt;I already have a paid account with &lt;a href=&quot;https://www.smarterasp.net/index?r=100571651&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-gatsbyjs-build-pipeline&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SmarterASP.NET&lt;/a&gt; where I host &lt;a href=&quot;https://github.com/piggyvault/piggyvault?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-gatsbyjs-build-pipeline&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Piggy&lt;/a&gt; and is very much suitable for personal side projects since it is very cheap. So I thought of moving back to &lt;a href=&quot;https://www.smarterasp.net/index?r=100571651&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-gatsbyjs-build-pipeline&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SmarterASP.NET&lt;/a&gt; and for CI/CD &lt;strong&gt;Azure DevOps Build &amp;amp; Release Pipelines&lt;/strong&gt; since am using the same at work.&lt;/p&gt;
&lt;h2 id=&quot;build-pipeline&quot;&gt;Build Pipeline&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#build-pipeline&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We used the YAML based pipeline and steps are self-explanatory.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;trigger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;master&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pool&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;vmImage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;ubuntu-latest&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;NodeTool@0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;versionSpec&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;10.x&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Install Node.js&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;npm install -g gatsby-cli&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Install gatsby-cli&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;yarn install&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Install dependencies&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;yarn build&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Gatsby build&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;CopyFiles@2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;sourceFolder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;public&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;contents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;**&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;targetFolder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;$(Build.ArtifactStagingDirectory)&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;cleanTargetFolder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Copy built site&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;condition&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;and(succeeded(), ne(variables[&amp;#39;Build.Reason&amp;#39;], &amp;#39;PullRequest&amp;#39;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;PublishBuildArtifacts@1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PathtoPublish&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;$(Build.ArtifactStagingDirectory)&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;ArtifactName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;drop&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;publishLocation&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;condition&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;and(succeeded(), ne(variables[&amp;#39;Build.Reason&amp;#39;], &amp;#39;PullRequest&amp;#39;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Publish Build Artifacts&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;trigger:  - masterpool:  vmImage: &amp;quot;ubuntu-latest&amp;quot;steps:  - task: NodeTool@0    inputs:      versionSpec: &amp;quot;10.x&amp;quot;    displayName: &amp;quot;Install Node.js&amp;quot;  - script: |      npm install -g gatsby-cli    displayName: &amp;quot;Install gatsby-cli&amp;quot;  - script: |      yarn install    displayName: &amp;quot;Install dependencies&amp;quot;  - script: |      yarn build    displayName: &amp;quot;Gatsby build&amp;quot;  - task: CopyFiles@2    inputs:      sourceFolder: &amp;quot;public&amp;quot;      contents: &amp;quot;**&amp;quot;      targetFolder: &amp;quot;$(Build.ArtifactStagingDirectory)&amp;quot;      cleanTargetFolder: true    displayName: &amp;quot;Copy built site&amp;quot;    condition: and(succeeded(), ne(variables[&apos;Build.Reason&apos;], &apos;PullRequest&apos;))  - task: PublishBuildArtifacts@1    inputs:      PathtoPublish: &amp;quot;$(Build.ArtifactStagingDirectory)&amp;quot;      ArtifactName: &amp;quot;drop&amp;quot;      publishLocation: &amp;quot;Container&amp;quot;    condition: and(succeeded(), ne(variables[&apos;Build.Reason&apos;], &apos;PullRequest&apos;))    displayName: &amp;quot;Publish Build Artifacts&amp;quot;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This pipeline will run for pull request as well. In those cases we don’t need to build the artifacts. That’s why we put the below condition for &lt;strong&gt;CopyFiles@2&lt;/strong&gt; and &lt;strong&gt;PublishBuildArtifacts@1&lt;/strong&gt; tasks.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;condition&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;and(succeeded(), ne(variables[&amp;#39;Build.Reason&amp;#39;], &amp;#39;PullRequest&amp;#39;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;condition: and(succeeded(), ne(variables[&apos;Build.Reason&apos;], &apos;PullRequest&apos;))&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And a successfull build looks like,&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/gatsby-build.sH1vvMVn_Z2fxkFE.webp&quot; alt=&quot;Azure DevOps Build Pipeline for Gatsby&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;905&quot; height=&quot;629&quot;&gt;&lt;figcaption&gt;Azure DevOps Build Pipeline for Gatsby&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;release-pipeline&quot;&gt;Release Pipeline&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#release-pipeline&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Once we configured our build pipeline, created a release pipeline.&lt;/p&gt;
&lt;h3 id=&quot;build-pipeline-vs-release-pipeline&quot;&gt;Build pipeline vs Release pipeline&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#build-pipeline-vs-release-pipeline&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;A build is a pipeline that has no side-effects, it only takes in code and puts out compiled “artifacts”. A release is a pipeline that has side-effects, it takes in artifacts and publishes or deploys them to environments.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For the release pipeline, in case of &lt;a href=&quot;https://www.smarterasp.net/index?r=100571651&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-gatsbyjs-build-pipeline&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SmarterASP.NET&lt;/a&gt;, the stage contain one job and it has only one task, the &lt;strong&gt;FTP Upload&lt;/strong&gt;.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/release-pipeline.jpAHv85v_12L54g.webp&quot; alt=&quot;Release Pipeline for Gatsby&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1651&quot; height=&quot;666&quot;&gt;&lt;figcaption&gt;Release Pipeline for Gatsby&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And the yml for the same look like below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;FtpUpload@2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;FTP Upload to SmarterASP.NET&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;credentialsOption&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;inputs&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;serverUrl&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;$(FTP.ServerUrl)&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;username&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;$(FTP.Username)&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;$(FTP.Password)&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;rootDirectory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;$(System.DefaultWorkingDirectory)/_Abhith.abhith.net/drop&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;remoteDirectory&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;/sitefolder/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;preservePaths&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;trustSSL&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;condition&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;and(succeeded(), ne(variables[&amp;#39;Build.Reason&amp;#39;], &amp;#39;PullRequest&amp;#39;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;``&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;steps:- task: FtpUpload@2  displayName: &apos;FTP Upload to SmarterASP.NET&apos;  inputs:    credentialsOption: inputs    serverUrl: &apos;$(FTP.ServerUrl)&apos;    username: &apos;$(FTP.Username)&apos;    password: &apos;$(FTP.Password)&apos;    rootDirectory: &apos;$(System.DefaultWorkingDirectory)/_Abhith.abhith.net/drop&apos;    remoteDirectory: /sitefolder/    preservePaths: true    trustSSL: true  condition: and(succeeded(), ne(variables[&apos;Build.Reason&apos;], &apos;PullRequest&apos;))``&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#notes&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;All the &lt;strong&gt;$(---)&lt;/strong&gt; are pipeline variables&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;rootDirectory&lt;/strong&gt; can be browsed through the &lt;strong&gt;…&lt;/strong&gt; button near to the &lt;strong&gt;Root folder&lt;/strong&gt; text input (check the comments below)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though I have successfully configured the CI/CD. But the time it took to complete the deployment was too long since the artifact size was high. The &lt;strong&gt;gatsby-images&lt;/strong&gt; generate so many versions of the image files resulting increase in the artifact size. So the FTP upload takes so much time to finish.&lt;/p&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Tried &lt;a href=&quot;https://x.com/hashtag/AzureDevOps?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#AzureDevOps&lt;/a&gt; to do the build and FTP upload task to push the artifact to &lt;a href=&quot;https://x.com/smarterasp?ref_src=twsrc%5Etfw&quot;&gt;@smarterasp&lt;/a&gt;, it worked fine but the time took to complete the release is almost 2 hrs. (artifact is around 500 MB in size &amp;amp; number of files 📂 around 3k). &lt;a href=&quot;https://t.co/wcltxbObRj&quot;&gt;pic.twitter.com/wcltxbObRj&lt;/a&gt;&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1210656334338764802?ref_src=twsrc%5Etfw&quot;&gt;December 27, 2019&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;
&lt;p&gt;Because of this, I searched for another hosting provider and found out &lt;a href=&quot;https://render.com/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-devops-gatsbyjs-build-pipeline&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Render&lt;/a&gt;. They have a free plan for static sites and offers almost similar experience when comparing to Netlify.&lt;/p&gt;
&lt;p&gt;If you know any better hosting solution for GatsbyJs website, let me know in the comments. 👇&lt;/p&gt;</content:encoded><category>azure-devops</category><category>gatsby</category><category>hosting</category><author>Abhith Rajan</author></item><item><title>Azure DevOps Build - Could not locate the assembly</title><link>https://www.abhith.net/blog/azure-devops-build-could-not-locate-the-assembly/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-devops-build-could-not-locate-the-assembly/</guid><description>.NET Core build failing for Azure DevOps?  Check if there is any assembly reference and replace it with proper NuGet package.</description><pubDate>Thu, 23 Jan 2020 06:59:27 GMT</pubDate><content:encoded>&lt;p&gt;We were configuring CI/CD for one of our &lt;strong&gt;.NET Core 3.1&lt;/strong&gt; API project in the Azure DevOps. When trying &lt;code&gt;dotnet build&lt;/code&gt; from our local workstation, it was successfull but when CI triggered the build on the &lt;strong&gt;Azure DevOps&lt;/strong&gt;, it was failing.&lt;/p&gt;
&lt;p&gt;The Azure Pipeline yml looks like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;pool&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;vmImage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;windows-latest&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;variables&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;buildConfiguration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Release&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;DotNetCoreCLI@2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;displayName&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;dotnet build $(buildConfiguration)&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;build&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;projects&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;|&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;path/to/project/*.csproj&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;arguments&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;--configuration $(buildConfiguration)&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;pool:  vmImage: &amp;quot;windows-latest&amp;quot;variables:  buildConfiguration: &amp;quot;Release&amp;quot;steps:  - task: DotNetCoreCLI@2    displayName: &amp;quot;dotnet build $(buildConfiguration)&amp;quot;    inputs:      command: &amp;quot;build&amp;quot;      projects: |        path/to/project/*.csproj      arguments: &amp;quot;--configuration $(buildConfiguration)&amp;quot;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The build step successfully restored the NuGet packages which we can see in the logs,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;txt&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;Restore completed in 14.41 sec for d:\a\1\s\path\to\project\Project.Name.csproj.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;Restore completed in 14.41 sec for d:\a\1\s\path\to\project\Project.Name.csproj.&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;But the step was failing with the following reference missing error.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;C:\Program Files\dotnet\sdk\3.1.100\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly “System.ComponentModel.Annotations”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\path\to\project\Project.Name.csproj]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/azure-dev-ops-error.bgGh1zv7_ZNt3bk.webp&quot; alt=&quot;Azure DevOps Build Error&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1198&quot; height=&quot;474&quot;&gt;&lt;figcaption&gt;Azure DevOps Build Error&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;When checked the project reference, found out that the reference to &lt;code&gt;System.ComponentModel.Annotations&lt;/code&gt; was added from &lt;strong&gt;assembly&lt;/strong&gt; instead of Nuget. Fixed it by removing the assembly reference and adding the NuGet package of &lt;code&gt;System.ComponentModel.Annotations&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/azure-dev-ops-fix.BAROy18k_Z1irRQf.webp&quot; alt=&quot;DotNet Core Reference Fix&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1765&quot; height=&quot;645&quot;&gt;&lt;figcaption&gt;DotNet Core Reference Fix&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Commited the changes and initiated a hotfix release. Tada, the build succeeded.&lt;/p&gt;</content:encoded><category>azure-devops</category><category>aspnet-core</category><category>dotnet-core</category><author>Abhith Rajan</author></item><item><title>GatsbyJS - Add Google AdSense</title><link>https://www.abhith.net/blog/gatsbyjs-add-google-adsense/</link><guid isPermaLink="true">https://www.abhith.net/blog/gatsbyjs-add-google-adsense/</guid><description>Make use of GatsbyJS SSR APIs to integrate Google Adsense</description><pubDate>Sun, 05 Jan 2020 17:00:00 GMT</pubDate><content:encoded>&lt;p&gt;One of the major strengths of &lt;strong&gt;Gatsby&lt;/strong&gt; is its evolving plugins catalog.
And there are a couple of plugins found for &lt;strong&gt;Google AdSense&lt;/strong&gt; integration but don’t seem to be maintained for so long.
But peeking into the source code of the one pave the path to do the same without any plugins.&lt;/p&gt;
&lt;p&gt;All you have to do is, update your &lt;code&gt;gatsby-ssr.js&lt;/code&gt; with the below code (if there is no &lt;code&gt;gatsby-ssr.js&lt;/code&gt; file on your project directory then create one at the root).&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;React&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;react&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;onRenderBody&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; ({ &lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70&quot;&gt;setHeadComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70&quot;&gt;setPostBodyComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; }) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;pluginOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;googleAdClientId: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`ca-pub-XXXXXXXXXXXXXX`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//TODO: Replace with your client-Id&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;head: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Set to false if you prefer to have your adsense script loaded at the end of body instead of head.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;process&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;env&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;NODE_ENV&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`production`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;pluginOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;googleAdClientId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;setComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;pluginOptions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;head&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;setHeadComponents&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;setPostBodyComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;setComponents&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;([&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;script&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;async&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;script&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`gatsby-plugin-google-adsense`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;__html: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;(adsbygoogle = window.adsbygoogle || []).push({&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;google_ad_client: &amp;quot;${&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;pluginOptions&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;googleAdClientId&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;}&amp;quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;enable_page_level_ads: true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;import React from &amp;quot;react&amp;quot;;export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) =&gt; {  const pluginOptions = {    googleAdClientId: `ca-pub-XXXXXXXXXXXXXX`, //TODO: Replace with your client-Id    head: true, // Set to false if you prefer to have your adsense script loaded at the end of body instead of head.  };  if (process.env.NODE_ENV !== `production`) {    return null;  }  if (pluginOptions.googleAdClientId === undefined) {    return null;  }  const setComponents = pluginOptions.head    ? setHeadComponents    : setPostBodyComponents;  return setComponents([    &lt;script      async      type=&amp;quot;text/javascript&amp;quot;      src=&amp;quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&amp;quot;    /&gt;,    &lt;script      key={`gatsby-plugin-google-adsense`}      dangerouslySetInnerHTML={{        __html: `        (adsbygoogle = window.adsbygoogle || []).push({            google_ad_client: &amp;quot;${pluginOptions.googleAdClientId}&amp;quot;,            enable_page_level_ads: true        });        `,      }}    /&gt;,  ]);};&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;onRenderBody&lt;/strong&gt; is a Gatsby SSR API, called after every page Gatsby server renders while building HTML so you can set head and body components to be rendered in your html.js.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://www.gatsbyjs.org/docs/ssr-apis/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=gatsbyjs-add-google-adsense#onRenderBody&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;SSR APIs | GatsbyJS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Build the project (&lt;code&gt;gatsby build&lt;/code&gt;) and see whether the AdSense snippet is present in the build output HTML.&lt;/p&gt;
&lt;p&gt;You can also refer the same used in my repo itself.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://github.com/abhith/abhith.net/blob/master/gatsby-ssr.js&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;abhith/abhith.net: Personal website running on Gatsby&lt;/a&gt;&lt;/p&gt;</content:encoded><category>gatsby</category><author>Abhith Rajan</author></item><item><title>.NET Core API Gateway Ocelot - Logging HTTP Requests &amp; Response Including Headers &amp; Body</title><link>https://www.abhith.net/blog/dotnet-core-api-gateway-ocelot-logging-http-requests-response-including-headers-body/</link><guid isPermaLink="true">https://www.abhith.net/blog/dotnet-core-api-gateway-ocelot-logging-http-requests-response-including-headers-body/</guid><description>Setup Ocelot API Gateway in ASP.NET Core and configure HTTP request and response logging including headers and body.</description><pubDate>Thu, 26 Dec 2019 17:11:27 GMT</pubDate><content:encoded>&lt;p&gt;We have many microservices running under one umbrella on production which is Azure Application Gateway and has only one endpoint for all. We are using path-based rules to route to each service.&lt;/p&gt;
&lt;p&gt;During development, we may need to simulate the same experience, i.e one endpoint instead of we referring separate URL endpoint for each service.&lt;/p&gt;
&lt;p&gt;For the microservices, I used to refer &lt;a href=&quot;https://github.com/dotnet-architecture/eShopOnContainers?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dotnet-core-api-gateway-ocelot-logging-http-requests-response-including-headers-body&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;dotnet-architecture/eShopOnContainers&lt;/a&gt;. And I read about the Ocelot API gateway from there. So I set up a local API gateway using Ocelot, for that&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Created a new &lt;strong&gt;ASP.NET Core 3.1&lt;/strong&gt; web application and choose the Empty template.&lt;/li&gt;
&lt;li&gt;Added the following NuGet packages&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PackageReference&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Ocelot&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;13.8.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PackageReference&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Serilog&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;2.9.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PackageReference&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Serilog.AspNetCore&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;3.2.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;PackageReference&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Serilog.Sinks.File&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;Version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;4.1.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&lt;PackageReference Include=&amp;quot;Ocelot&amp;quot; Version=&amp;quot;13.8.0&amp;quot; /&gt;&lt;PackageReference Include=&amp;quot;Serilog&amp;quot; Version=&amp;quot;2.9.0&amp;quot; /&gt;&lt;PackageReference Include=&amp;quot;Serilog.AspNetCore&amp;quot; Version=&amp;quot;3.2.0&amp;quot; /&gt;&lt;PackageReference Include=&amp;quot;Serilog.Sinks.File&amp;quot; Version=&amp;quot;4.1.0&amp;quot; /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Updated the Program.cs&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IO&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AspNetCore&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AspNetCore&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Hosting&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Extensions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Extensions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Hosting&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Extensions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DependencyInjection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Serilog&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Serilog&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Events&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Ocelot&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DependencyInjection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Ocelot&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Middleware&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AspNetCore&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;OcelotApiGw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Middlewares&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;OcelotApiGw&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Program&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IWebHost&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;BuildWebHost&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WebHost&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateDefaultBuilder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Ocelot configuration file&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ConfigureAppConfiguration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;ic&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ic&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddJsonFile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Combine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;configuration&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;                                                            &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;configuration.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ConfigureServices&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddSingleton&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddOcelot&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;UseStartup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Startup&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;UseSerilog&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;_&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;config&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;MinimumLevel&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Information&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;MinimumLevel&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Override&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Microsoft&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;LogEventLevel&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Enrich&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FromLogContext&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;WriteTo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;@&amp;quot;Logs\log.txt&amp;quot;&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;rollingInterval&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;RollingInterval&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Day&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Configure&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;UseMiddleware&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RequestResponseLoggingMiddleware&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;UseOcelot&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Wait&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;host&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Build&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;host&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Main&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;BuildWebHost&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Run&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using System.IO;using Microsoft.AspNetCore;using Microsoft.AspNetCore.Hosting;using Microsoft.Extensions.Configuration;using Microsoft.Extensions.Hosting;using Microsoft.Extensions.DependencyInjection;using Serilog;using Serilog.Events;using Ocelot.DependencyInjection;using Ocelot.Middleware;using Microsoft.AspNetCore.Builder;using OcelotApiGw.Middlewares;namespace OcelotApiGw{    public class Program    {        public static IWebHost BuildWebHost(string[] args)        {            var builder = WebHost.CreateDefaultBuilder(args);            // Ocelot configuration file            builder.ConfigureAppConfiguration(                          ic =&gt; ic.AddJsonFile(Path.Combine(&amp;quot;configuration&amp;quot;,                                                            &amp;quot;configuration.json&amp;quot;)))                    .ConfigureServices(s =&gt;                    {                        s.AddSingleton(builder);                        s.AddOcelot();                    })                    .UseStartup&lt;Startup&gt;()                    .UseSerilog((_, config) =&gt;                    {                        config                            .MinimumLevel.Information()                            .MinimumLevel.Override(&amp;quot;Microsoft&amp;quot;, LogEventLevel.Warning)                            .Enrich.FromLogContext()                            .WriteTo.File(@&amp;quot;Logs\log.txt&amp;quot;, rollingInterval: RollingInterval.Day);                    })                    .Configure(app =&gt;                    {                        app.UseMiddleware&lt;RequestResponseLoggingMiddleware&gt;();                        app.UseOcelot().Wait();                    });            var host = builder.Build();            return host;        }        public static void Main(string[] args)        {            BuildWebHost(args).Run();        }    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Here we are configuring the Ocelot middleware as well as Serilog for logging.
The Ocelot configuration file is added under “configuration” folder in the root directory.&lt;/p&gt;
&lt;p&gt;A sample Ocelot configuration file looks like this.&lt;/p&gt;
&lt;h2 id=&quot;configurationjson&quot;&gt;configuration.json&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#configurationjson&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;ReRoutes&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamPathTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/{version}/{everything}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamScheme&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamHostAndPorts&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Host&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Port&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;5010&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UpstreamPathTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/d/{version}/{everything}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UpstreamHttpMethod&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;POST&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;PUT&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamPathTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/b/{everything}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamScheme&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamHostAndPorts&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Host&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Port&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;5011&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UpstreamPathTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/a/b/{everything}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UpstreamHttpMethod&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;POST&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;PUT&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamPathTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/{everything}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamScheme&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;http&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;DownstreamHostAndPorts&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Host&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;Port&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;5013&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UpstreamPathTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;/c/{everything}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;UpstreamHttpMethod&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;POST&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;PUT&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;OPTIONS&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;GlobalConfiguration&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;BaseUrl&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;https://localhost:44390&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{  &amp;quot;ReRoutes&amp;quot;: [    {      &amp;quot;DownstreamPathTemplate&amp;quot;: &amp;quot;/{version}/{everything}&amp;quot;,      &amp;quot;DownstreamScheme&amp;quot;: &amp;quot;http&amp;quot;,      &amp;quot;DownstreamHostAndPorts&amp;quot;: [        {          &amp;quot;Host&amp;quot;: &amp;quot;localhost&amp;quot;,          &amp;quot;Port&amp;quot;: 5010        }      ],      &amp;quot;UpstreamPathTemplate&amp;quot;: &amp;quot;/d/{version}/{everything}&amp;quot;,      &amp;quot;UpstreamHttpMethod&amp;quot;: [&amp;quot;POST&amp;quot;, &amp;quot;PUT&amp;quot;, &amp;quot;GET&amp;quot;]    },    {      &amp;quot;DownstreamPathTemplate&amp;quot;: &amp;quot;/b/{everything}&amp;quot;,      &amp;quot;DownstreamScheme&amp;quot;: &amp;quot;http&amp;quot;,      &amp;quot;DownstreamHostAndPorts&amp;quot;: [        {          &amp;quot;Host&amp;quot;: &amp;quot;localhost&amp;quot;,          &amp;quot;Port&amp;quot;: 5011        }      ],      &amp;quot;UpstreamPathTemplate&amp;quot;: &amp;quot;/a/b/{everything}&amp;quot;,      &amp;quot;UpstreamHttpMethod&amp;quot;: [&amp;quot;POST&amp;quot;, &amp;quot;PUT&amp;quot;, &amp;quot;GET&amp;quot;]    },    {      &amp;quot;DownstreamPathTemplate&amp;quot;: &amp;quot;/{everything}&amp;quot;,      &amp;quot;DownstreamScheme&amp;quot;: &amp;quot;http&amp;quot;,      &amp;quot;DownstreamHostAndPorts&amp;quot;: [        {          &amp;quot;Host&amp;quot;: &amp;quot;localhost&amp;quot;,          &amp;quot;Port&amp;quot;: 5013        }      ],      &amp;quot;UpstreamPathTemplate&amp;quot;: &amp;quot;/c/{everything}&amp;quot;,      &amp;quot;UpstreamHttpMethod&amp;quot;: [&amp;quot;POST&amp;quot;, &amp;quot;PUT&amp;quot;, &amp;quot;GET&amp;quot;, &amp;quot;OPTIONS&amp;quot;]    }  ],  &amp;quot;GlobalConfiguration&amp;quot;: {    &amp;quot;BaseUrl&amp;quot;: &amp;quot;https://localhost:44390&amp;quot;  }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Apart from that, we are also adding one custom middleware &lt;code&gt;RequestResponseLoggingMiddleware&lt;/code&gt; and its purpose is clear from its name, log request and response.&lt;/p&gt;
&lt;h2 id=&quot;the-logging-middleware&quot;&gt;The Logging Middleware&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#the-logging-middleware&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is a slightly modified version of middleware mentioned in the article, &lt;a href=&quot;https://exceptionnotfound.net/using-middleware-to-log-requests-and-responses-in-asp-net-core/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dotnet-core-api-gateway-ocelot-logging-http-requests-response-including-headers-body&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Using Middleware in ASP.NET Core to Log Requests and Responses&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AspNetCore&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Http&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Microsoft&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Extensions&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Logging&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IO&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Threading&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Tasks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;OcelotApiGw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Middlewares&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RequestResponseLoggingMiddleware&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;readonly&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ILogger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RequestResponseLoggingMiddleware&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;_logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;readonly&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RequestDelegate&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;_next&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;RequestResponseLoggingMiddleware&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RequestDelegate&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ILogger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;RequestResponseLoggingMiddleware&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_next&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;InvokeAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;HttpContext&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;EnableBuffering&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;StringBuilder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FormatRequest&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Append&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Request: &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AppendLine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AppendLine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Request headers:&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Headers&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Append&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Append&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AppendLine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Copy a pointer to the original response body stream&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;originalBodyStream&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Create a new memory stream...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;responseBody&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;MemoryStream&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//...and use that for the temporary response body&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;responseBody&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Continue down the Middleware pipeline, eventually returning to this class&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;_next&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Format the response from the server&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FormatResponse&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Append&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Response: &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AppendLine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AppendLine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Response headers: &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Headers&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Append&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Append&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AppendLine&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Save log to chosen datastore&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;LogInformation&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;());&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Copy the contents of the new memory stream (which contains the response) to the original stream, which is then returned to the client.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;responseBody&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CopyToAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;originalBodyStream&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FormatRequest&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;HttpRequest&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Leave the body open so the next middleware can read it.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;reader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;StreamReader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Encoding&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;UTF8&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;detectEncodingFromByteOrderMarks&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;leaveOpen&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;reader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ReadToEndAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Do some processing with body…&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;formattedRequest&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Scheme&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Host&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;QueryString&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// Reset the request body stream position so the next middleware can read it&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Position&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;formattedRequest&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FormatResponse&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;HttpResponse&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//We need to read the response stream from the beginning...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Seek&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;SeekOrigin&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//...and copy it into a string&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;StreamReader&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ReadToEndAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//We need to reset the reader for the response so that the client can read it.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Body&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Seek&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;SeekOrigin&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;//Return the string for the response, including the status code (e.g. 200, 404, 401, etc.)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StatusCode&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using Microsoft.AspNetCore.Http;using Microsoft.Extensions.Logging;using System.IO;using System.Text;using System.Threading.Tasks;namespace OcelotApiGw.Middlewares{    public class RequestResponseLoggingMiddleware    {        private readonly ILogger&lt;RequestResponseLoggingMiddleware&gt; _logger;        private readonly RequestDelegate _next;        public RequestResponseLoggingMiddleware(RequestDelegate next, ILogger&lt;RequestResponseLoggingMiddleware&gt; logger)        {            _next = next;            _logger = logger;        }        public async Task InvokeAsync(HttpContext context)        {            context.Request.EnableBuffering();            var builder = new StringBuilder();            var request = await FormatRequest(context.Request);            builder.Append(&amp;quot;Request: &amp;quot;).AppendLine(request);            builder.AppendLine(&amp;quot;Request headers:&amp;quot;);            foreach (var header in context.Request.Headers)            {                builder.Append(header.Key).Append(&apos;:&apos;).AppendLine(header.Value);            }            //Copy a pointer to the original response body stream            var originalBodyStream = context.Response.Body;            //Create a new memory stream...            using var responseBody = new MemoryStream();            //...and use that for the temporary response body            context.Response.Body = responseBody;            //Continue down the Middleware pipeline, eventually returning to this class            await _next(context);            //Format the response from the server            var response = await FormatResponse(context.Response);            builder.Append(&amp;quot;Response: &amp;quot;).AppendLine(response);            builder.AppendLine(&amp;quot;Response headers: &amp;quot;);            foreach (var header in context.Response.Headers)            {                builder.Append(header.Key).Append(&apos;:&apos;).AppendLine(header.Value);            }            //Save log to chosen datastore            _logger.LogInformation(builder.ToString());            //Copy the contents of the new memory stream (which contains the response) to the original stream, which is then returned to the client.            await responseBody.CopyToAsync(originalBodyStream);        }        private async Task&lt;string&gt; FormatRequest(HttpRequest request)        {            // Leave the body open so the next middleware can read it.            using var reader = new StreamReader(                request.Body,                encoding: Encoding.UTF8,                detectEncodingFromByteOrderMarks: false,                leaveOpen: true);            var body = await reader.ReadToEndAsync();            // Do some processing with body…            var formattedRequest = $&amp;quot;{request.Scheme} {request.Host}{request.Path} {request.QueryString} {body}&amp;quot;;            // Reset the request body stream position so the next middleware can read it            request.Body.Position = 0;            return formattedRequest;        }        private async Task&lt;string&gt; FormatResponse(HttpResponse response)        {            //We need to read the response stream from the beginning...            response.Body.Seek(0, SeekOrigin.Begin);            //...and copy it into a string            string text = await new StreamReader(response.Body).ReadToEndAsync();            //We need to reset the reader for the response so that the client can read it.            response.Body.Seek(0, SeekOrigin.Begin);            //Return the string for the response, including the status code (e.g. 200, 404, 401, etc.)            return $&amp;quot;{response.StatusCode}: {text}&amp;quot;;        }    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Usually, the request body can be read only once. Here we are making use of the new &lt;code&gt;EnableBuffering&lt;/code&gt; extension method to read the request body multiple times.
You can read more about the feature here, &lt;a href=&quot;https://devblogs.microsoft.com/aspnet/re-reading-asp-net-core-request-bodies-with-enablebuffering/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dotnet-core-api-gateway-ocelot-logging-http-requests-response-including-headers-body&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Re-reading ASP.Net Core request bodies with EnableBuffering()&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That’s it, run your projects, make some requests and then check the logs directory.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This logging middleware can be used in any other &lt;strong&gt;ASP.NET Core&lt;/strong&gt; project.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here we used in the Ocelot API Gateway so that we don’t need to check the logs of each microservices.&lt;/p&gt;
&lt;h2 id=&quot;bonus&quot;&gt;Bonus&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#bonus&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I am using a free tool &lt;a href=&quot;https://kittyfisto.github.io/Tailviewer/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dotnet-core-api-gateway-ocelot-logging-http-requests-response-including-headers-body&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Tailviewer&lt;/a&gt; to go through my logs. Check it out, it is small in size also an opensource project.&lt;/p&gt;</content:encoded><category>aspnet-core</category><category>api</category><category>api-management</category><author>Abhith Rajan</author></item><item><title>SQL Server - Delete Duplicate Rows</title><link>https://www.abhith.net/blog/sql-server-delete-duplicate-rows/</link><guid isPermaLink="true">https://www.abhith.net/blog/sql-server-delete-duplicate-rows/</guid><description>Delete duplicate records from a SQL server table without primary keys or any unique columns.</description><pubDate>Wed, 04 Dec 2019 20:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Deleting rows from a &lt;strong&gt;SQL Server&lt;/strong&gt; table is no big deal. But it becomes a little complicated when we are in a situation like a table with no primary keys or unique column and it has duplicate records which we need to delete.&lt;/p&gt;
&lt;p&gt;When tried to delete rows using the context menu in the &lt;strong&gt;Microsoft SQL Server Management Studio&lt;/strong&gt;, it failed with an error message indicating the action affects multiple records.
But if you try &lt;strong&gt;Azure Data Studio&lt;/strong&gt; to do the same, it will delete all the similar rows, not just the one you choose to delete.&lt;/p&gt;
&lt;p&gt;So, in this case, we can use a query like below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; CTE &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [Col1]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,[Col2]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;ROW_NUMBER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;OVER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;PARTITION&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [Col1] &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ORDER BY&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [Col1]) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; RN&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [dbo].[Table]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; CTE&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot; WITH CTE AS(   SELECT [Col1]      ,[Col2]      ,...      ,ROW_NUMBER() OVER(PARTITION BY [Col1] ORDER BY [Col1]) AS RN   FROM [dbo].[Table])SELECT * FROM CTE&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the above query, we are using a CTE to list the data along with an additional column &lt;em&gt;RN&lt;/em&gt; which will have a value higher than 1 for the duplicate entries.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It is always a good idea to “SELECT” and double-check the data before doing a hard “DELETE”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So first run the above query and inspect the rows with &lt;code&gt;RN&amp;gt;1&lt;/code&gt;,
Once you are okay with the results, execute the delete.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; CTE &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [Col1]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,[Col2]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;ROW_NUMBER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;OVER&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;PARTITION&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [Col1] &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;ORDER BY&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [Col1]) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; RN&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [dbo].[Table]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;DELETE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; CTE &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; RN &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot; WITH CTE AS(   SELECT [Col1]      ,[Col2]      ,...      ,ROW_NUMBER() OVER(PARTITION BY [Col1] ORDER BY [Col1]) AS RN   FROM [dbo].[Table])DELETE FROM CTE WHERE RN &gt; 1&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;see-also&quot;&gt;See Also&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#see-also&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql?view=sql-server-ver15&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=sql-server-delete-duplicate-rows&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;WITH common_table_expression (Transact-SQL) - SQL Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>sql-server</category><author>Abhith Rajan</author></item><item><title>Angular - Add Custom Font</title><link>https://www.abhith.net/blog/angular-add-custom-font/</link><guid isPermaLink="true">https://www.abhith.net/blog/angular-add-custom-font/</guid><description>A short article about how to add custom font files to your Angular projects.</description><pubDate>Tue, 12 Nov 2019 12:59:27 GMT</pubDate><content:encoded>&lt;p&gt;To add custom fonts to your &lt;strong&gt;Angular&lt;/strong&gt; project, put the font files under &lt;code&gt;src&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Here I am following the folder pattern which I found on ABP Zero boilerplate.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In my case &lt;code&gt;src &amp;gt; assets &amp;gt; fonts &amp;gt; fontname &amp;gt; font-files (.woff)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then create a &lt;strong&gt;CSS&lt;/strong&gt; file, &lt;code&gt;src &amp;gt; assets &amp;gt; fonts &amp;gt; fonts-fontname.css&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;And on the CSS, add the &lt;code&gt;font-face&lt;/code&gt; referring to our new font-flies, an example is given below.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;css&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;@font-face&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;font-family&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;fontname&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;./fontname/fontname.woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;@font-face&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;font-family&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;fontname-Medium&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;./fontname/fontname-medium.woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;@font-face&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;font-family&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;fontname-Light&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;./fontname/fontname-light.woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;@font-face {  font-family: &amp;quot;fontname&amp;quot;;  src: url(&amp;quot;./fontname/fontname.woff&amp;quot;);}@font-face {  font-family: &amp;quot;fontname-Medium&amp;quot;;  src: url(&amp;quot;./fontname/fontname-medium.woff&amp;quot;);}@font-face {  font-family: &amp;quot;fontname-Light&amp;quot;;  src: url(&amp;quot;./fontname/fontname-light.woff&amp;quot;);}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Once the CSS file is ready, now we have to include that too in the angular build.
To do that, update the &lt;code&gt;angular.json&lt;/code&gt; to have references to our new CSS file like in below example,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;projects&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;project-name&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;architect&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;build&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;options&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;styles&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;src/assets/fonts/fonts-fontname.css&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;options&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;&amp;quot;styles&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;src/assets/fonts/fonts-fontname.css&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#B31D28;--0fs:italic;--1:#FDAEB7;--1fs:italic;--2:#BD2B28&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{ ...  &amp;quot;projects&amp;quot;: {    &amp;quot;project-name&amp;quot;: {     ...      &amp;quot;architect&amp;quot;: {        &amp;quot;build&amp;quot;: {          ...          &amp;quot;options&amp;quot;: {            ...            &amp;quot;styles&amp;quot;: [              ...              &amp;quot;src/assets/fonts/fonts-fontname.css&amp;quot;,              ...            ],            ...          },          ...        },        ...,        &amp;quot;test&amp;quot;: {          ...          &amp;quot;options&amp;quot;: {            ...            &amp;quot;styles&amp;quot;: [              ...              &amp;quot;src/assets/fonts/fonts-fontname.css&amp;quot;,              ...            ],            ...          }        },        ...      }    },}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: the above code is tried and tested on &lt;strong&gt;Angular 8&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Once we updated the &lt;code&gt;angular.json&lt;/code&gt;, start a new build and see the new font applied in the places where it is used.&lt;/p&gt;</content:encoded><category>angular</category><author>Abhith Rajan</author></item><item><title>C# - Convert DateTime to Long and Vice Versa</title><link>https://www.abhith.net/blog/c-sharp-convert-datetime-to-long-and-vice-versa/</link><guid isPermaLink="true">https://www.abhith.net/blog/c-sharp-convert-datetime-to-long-and-vice-versa/</guid><description>Transform datetime to long or long to datetime in C#.</description><pubDate>Tue, 29 Oct 2019 18:26:00 GMT</pubDate><content:encoded>&lt;p&gt;Story behind this post is when I started working with an existing MSSQL DB, I had to convert the DateTime to long since action auditing fields such as CreationTime, LastUpdated etc was stored as numeric.&lt;/p&gt;
&lt;p&gt;eg, 20191028091320.&lt;/p&gt;
&lt;p&gt;First of all, I don’t like storing DateTime in numeric format like above, which brings so much overhead during dealing with the same field, like querying based on date, formatting for displaying etc.&lt;/p&gt;
&lt;p&gt;The way I handled these conversions given below,&lt;/p&gt;
&lt;h3 id=&quot;datetime-to-long&quot;&gt;DateTime to Long&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#datetime-to-long&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;long&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Parse&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;UtcNow&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;yyyyMMddHHmmss&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;long.Parse(DateTime.UtcNow.ToString(&amp;quot;yyyyMMddHHmmss&amp;quot;))&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;long-to-datetime&quot;&gt;Long to DateTime&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#long-to-datetime&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The below code can handle 14 digits (eg. 20191028091320), 16 digits (eg. 2019102809132000 ) and 8 digits (eg. 20191028).&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;? &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetDateTimeFromInt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;long&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;? &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dateAsLong&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;hasTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dateAsLong&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;HasValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dateAsLong&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;hasTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// sometimes input is 14 digit and sometimes 16&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;numberOfDigits&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Floor&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Log10&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dateAsLong&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;numberOfDigits&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;14&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dateAsLong&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;/=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Pow&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;numberOfDigits&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;14&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;TryParseExact&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dateAsLong&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;hasTime&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;yyyyMMddHHmmss&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;yyyyMMdd&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                                  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CultureInfo&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;InvariantCulture&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;                                  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;DateTimeStyles&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;None&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;private static DateTime? GetDateTimeFromInt(long? dateAsLong, bool hasTime = true){    if (dateAsLong.HasValue &amp;amp;&amp;amp; dateAsLong &gt; 0)    {        if (hasTime)        {            // sometimes input is 14 digit and sometimes 16            var numberOfDigits = (int)Math.Floor(Math.Log10(dateAsLong.Value) + 1);            if (numberOfDigits &gt; 14)            {                dateAsLong /= (int)Math.Pow(10, (numberOfDigits - 14));            }        }        if (DateTime.TryParseExact(dateAsLong.ToString(), hasTime ? &amp;quot;yyyyMMddHHmmss&amp;quot; : &amp;quot;yyyyMMdd&amp;quot;,                                  CultureInfo.InvariantCulture,                                  DateTimeStyles.None, out DateTime dt))        {            return dt;        }    }    return null;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;</content:encoded><category>c-sharp</category><author>Abhith Rajan</author></item><item><title>Gatsby - See All Generated Pages</title><link>https://www.abhith.net/blog/gatsby-see-all-generated-pages/</link><guid isPermaLink="true">https://www.abhith.net/blog/gatsby-see-all-generated-pages/</guid><description>See all the pages generated by Gatsby.</description><pubDate>Sat, 05 Oct 2019 20:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you want to see the list of pages generated by Gatsby, you can use the GraphiQL playground part of the Gatsby Dev (usually served on &lt;a href=&quot;http://localhost:8000/___graphql?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=gatsby-see-all-generated-pages&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;http://localhost:8000/___graphql&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Run the below query and you will be presented with the list of pages,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;graphql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;MyQuery&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70;--2:#54666C&quot;&gt;allSitePage&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70;--2:#54666C&quot;&gt;edges&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70;--2:#54666C&quot;&gt;node&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#AE4B07;--1:#FFAB70;--2:#54666C&quot;&gt;path&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;query MyQuery {  allSitePage {    edges {      node {        path      }    }  }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;</content:encoded><category>gatsby</category><author>Abhith Rajan</author></item><item><title>Azure - Configuring End-to-End SSL for IIS Website by using Application Gateway</title><link>https://www.abhith.net/blog/azure-configuring-end-to-end-ssl-for-iis-website-by-using-application-gateway/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-configuring-end-to-end-ssl-for-iis-website-by-using-application-gateway/</guid><description>This article brief about the steps involved in making an end to end HTTPS website which hosted in a VM IIS, in Azure and the traffic need to be routed via Application Gateway.</description><pubDate>Tue, 24 Sep 2019 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;For most cases we do SSL offloading at the Application Gateway end. i.e, HTTPS traffic between public and application gateway, HTTP traffic between application gateway and websites hosted under it. But in some cases we need end to end SSL. In our case, it was for the Identity Server.&lt;/p&gt;
&lt;p&gt;So lets start, We pointed the domain to the Application Gateway Public IP and We assume you purchased the SSL for your domain and we need the SSL certificate in two formats.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;PFX&lt;/strong&gt; format for application gateway HTTPS listener.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CER&lt;/strong&gt; format for application gateway HTTP Settings.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now we need to do the following,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add an HTTPS listener for that domain with the Certificate.&lt;/li&gt;
&lt;li&gt;Create a backend pool with the VM where we will publish the website in the IIS.&lt;/li&gt;
&lt;li&gt;Add an HTTP Settings with the Certificate as shown in the picture.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/application-gateway-http-settings.pCpvYfI0_Z2fXiRN.webp&quot; alt=&quot;Application Gateway HTTP Settings&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;725&quot; height=&quot;871&quot;&gt;&lt;figcaption&gt;Application Gateway HTTP Settings&lt;/figcaption&gt;&lt;/figure&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Create a rule which connects the listener (1) and backend pool(2) via the newly created HTTP settings (3).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once all this done, user will be able to hit Application Gateway with HTTPS and probably will see 404 since the VM not responding to the requests. So lets configure the VM to accept the traffic through 443 port. In the VM,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install the SSL certificate.&lt;/li&gt;
&lt;li&gt;Configure the HTTPS website in the IIS with that certificate and the hostname (domain).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After this done, check whether you are able to reach the website successfully. If you are getting any 502 errors, check the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the Application Gateway, check the unhealthy backend pools.&lt;/li&gt;
&lt;li&gt;If our backend pool with the HTTPS HTTP settings name is in that unhealthy list, that indicates the VM in the backend pool not responding 200 back to the health probe check.&lt;/li&gt;
&lt;li&gt;By default health probe check for HTTPS will sent health check requests to the VM’s IP on 443 port, and in the IIS, no website will be listening for 443 port (Without any hostname specified).&lt;/li&gt;
&lt;li&gt;To overcome, all we have to do is, on the default website (if there is no default site, add another binding to our site) as shown below,&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;content-figure&quot;&gt; &lt;img src=&quot;https://www.abhith.net/_astro/iis-https-default.DvteuCqQ_1r5JHI.webp&quot; alt=&quot;IIS default 443 port binding&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;634&quot; height=&quot;194&quot;&gt;&lt;figcaption&gt;IIS default 443 port binding&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Once this done, watch the unhealthy backend pools and you may notice that our backend pool is healthy now (It will take at least 30 seconds to update). Now application gateway will route traffic to our VM over HTTPS and the VM will serve the website and we are done.&lt;/p&gt;
&lt;h3 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/azure/application-gateway/end-to-end-ssl-portal?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-configuring-end-to-end-ssl-for-iis-website-by-using-application-gateway&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Quickstart - Configure end-to-end SSL encryption with Azure Application Gateway - Azure portal | Microsoft Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>azure</category><category>iis</category><category>azure-application-gateway</category><author>Abhith Rajan</author></item><item><title>C# - Get Last N characters from a string</title><link>https://www.abhith.net/blog/c-sharp-get-last-n-characters-from-a-string/</link><guid isPermaLink="true">https://www.abhith.net/blog/c-sharp-get-last-n-characters-from-a-string/</guid><description>A simple C# extension method which use Substring to get the last N characters in a string.</description><pubDate>Sun, 22 Sep 2019 19:26:00 GMT</pubDate><content:encoded>&lt;p&gt;In C#, &lt;strong&gt;Substring&lt;/strong&gt; method is used to retrieve (as the name suggests) substring from a string. The same we can use to get the last ‘N’ characters of a string.&lt;/p&gt;
&lt;h3 id=&quot;stringsubstring-method&quot;&gt;String.Substring Method&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#stringsubstring-method&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As described in &lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/api/system.string.substring?view=netframework-4.8&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=c-sharp-get-last-n-characters-from-a-string&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;String.Substring Method (System) | Microsoft Docs&lt;/a&gt;, Substring method has two overloads,&lt;/p&gt;

















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Overload&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Substring(Int32)&lt;/td&gt;&lt;td&gt;Retrieves a substring from this instance. The substring starts at a specified character position and continues to the end of the string.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Substring(Int32, Int32)&lt;/td&gt;&lt;td&gt;Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;With the starting position only overload, we can do.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;mystring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Substring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;mystring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;N&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;mystring.Substring(mystring.Length - N);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;But the above code will fail in case &lt;code&gt;mystring&lt;/code&gt; length is lower than the ‘N’. So considering that case, lets have an extension method,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetLast&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;numberOfChars&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;numberOfChars&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Substring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;numberOfChars&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public static string GetLast(this string source, int numberOfChars){    if(numberOfChars &gt;= source.Length)      return source;    return source.Substring(source.Length - numberOfChars);}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And you can use the above like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;mystring&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetLast&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;mystring.GetLast(5)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This extension method is now part of the &lt;a href=&quot;https://code-library.abhith.net/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=c-sharp-get-last-n-characters-from-a-string&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Code.Library&lt;/a&gt; Nuget package.&lt;/p&gt;</content:encoded><category>c-sharp</category><author>Abhith Rajan</author></item><item><title>ASP.NET Core - Return 500 (Internal Server Error) or any other Status Code from API</title><link>https://www.abhith.net/blog/aspnet-core-return-500-internal-server-error-or-any-other-status-code-from-api/</link><guid isPermaLink="true">https://www.abhith.net/blog/aspnet-core-return-500-internal-server-error-or-any-other-status-code-from-api/</guid><description>A good REST API will respond with proper HTTP status codes. In ASP.NET Core, returning status code is easier than you might think.</description><pubDate>Mon, 16 Sep 2019 19:26:00 GMT</pubDate><content:encoded>&lt;p&gt;HTTP response status codes have so much importance in REST API’s.
In any case if you want to return a status code from your &lt;strong&gt;ASP.NET Core&lt;/strong&gt; API, all you have to do is in your controller method,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;csharp&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;StatusCode&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StatusCodes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Status500InternalServerError&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;return  StatusCode(StatusCodes.Status500InternalServerError);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;StatusCode&lt;/strong&gt; is from &lt;strong&gt;Microsoft.AspNetCore.Mvc.ControllerBase.StatusCode&lt;/strong&gt; and &lt;strong&gt;StatusCodes&lt;/strong&gt; from &lt;strong&gt;Microsoft.AspNetCore.Http.StatusCodes&lt;/strong&gt;.
The above code will return a 500 status code. Similar way, you can return any other status code. For the complete list,&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.statuscodes?view=aspnetcore-2.2&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-return-500-internal-server-error-or-any-other-status-code-from-api&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;StatusCodes Class (Microsoft.AspNetCore.Http) | Microsoft Docs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTTP status code 5xx indicates server error. 5xx series includes,&lt;/p&gt;






































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Status Code&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;ASP.NET Core 2.2&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;Internal Server Error&lt;/td&gt;&lt;td&gt;Status500InternalServerError&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;501&lt;/td&gt;&lt;td&gt;Not Implemented&lt;/td&gt;&lt;td&gt;Status501NotImplemented&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;502&lt;/td&gt;&lt;td&gt;Bad Gateway&lt;/td&gt;&lt;td&gt;Status502BadGateway&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;503&lt;/td&gt;&lt;td&gt;Service Unavailable&lt;/td&gt;&lt;td&gt;Status503ServiceUnavailable&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;504&lt;/td&gt;&lt;td&gt;Gateway Timeout&lt;/td&gt;&lt;td&gt;Status504GatewayTimeout&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;505&lt;/td&gt;&lt;td&gt;HTTP Version Not Supported&lt;/td&gt;&lt;td&gt;Status505HttpVersionNotsupported&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;506&lt;/td&gt;&lt;td&gt;Variant Also Negotiates&lt;/td&gt;&lt;td&gt;Status506VariantAlsoNegotiates&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;507&lt;/td&gt;&lt;td&gt;Insufficient Storage&lt;/td&gt;&lt;td&gt;Status507InsufficientStorage&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;508&lt;/td&gt;&lt;td&gt;Loop Detected&lt;/td&gt;&lt;td&gt;Status508LoopDetected&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;510&lt;/td&gt;&lt;td&gt;Not Extended&lt;/td&gt;&lt;td&gt;Status510NotExtended&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;511&lt;/td&gt;&lt;td&gt;Network Authentication Required&lt;/td&gt;&lt;td&gt;Status511NetworkAuthenticationRequired&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;599&lt;/td&gt;&lt;td&gt;Network Connect Timeout Error&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;You can also return some additional data along with the status code. Here is an example,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Route&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;{code}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;HttpGet&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ProducesResponseType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Merchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ActionResult&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetMerchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;EntityRequestDto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;code&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_merchantService&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetMerchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;IsSuccess&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Ok&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_logger&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;LogError&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;FAILED: GetMerchant - ${result.Error}&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;StatusCode&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;StatusCodes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Status500InternalServerError&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Error&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;[Route(&amp;quot;{code}&amp;quot;)][HttpGet][ProducesResponseType(typeof(Merchant), 200)]public async Task&lt;ActionResult&gt; GetMerchant(string code){    var input = new EntityRequestDto&lt;string&gt;    {        Id = code    };    var result = await _merchantService.GetMerchant(input);    if (result.IsSuccess)    {        return Ok(result.Value);    }    _logger.LogError(&amp;quot;FAILED: GetMerchant - ${result.Error}&amp;quot;);    return StatusCode(StatusCodes.Status500InternalServerError, result.Error);}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;If another service which is a client of the above API, they can get the additional info by,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;MerchantPreviewDto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetMerchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;merchantCode&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;try&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;merchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;$&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_apiBaseUri&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;/api/v1/merchants/&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;merchantCode&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;WithOAuthBearerToken&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetJsonAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Merchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ConfigureAwait&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#7E5F00&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ObjectMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;MerchantPreviewDto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;merchant&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;FlurlHttpException&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;ex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ex&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetResponseStringAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;UserFriendlyException&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Oops! There is a problem!&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public async Task&lt;MerchantPreviewDto&gt; GetMerchant(string merchantCode){    try    {        var merchant = await $&amp;quot;{_apiBaseUri}/api/v1/merchants/{merchantCode}&amp;quot;            .WithOAuthBearerToken(...)            .GetJsonAsync&lt;Merchant&gt;().ConfigureAwait(false);        return ObjectMapper.Map&lt;MerchantPreviewDto&gt;(merchant);    }    catch (FlurlHttpException ex)    {        var error = await ex.GetResponseStringAsync();        throw new UserFriendlyException(&amp;quot;Oops! There is a problem!&amp;quot;, error);    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;hr/&gt;
&lt;h3 id=&quot;bonus&quot;&gt;Bonus&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#bonus&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;On the client service, I am using &lt;strong&gt;&lt;a href=&quot;https://flurl.dev/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=aspnet-core-return-500-internal-server-error-or-any-other-status-code-from-api&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Flurl&lt;/a&gt;&lt;/strong&gt;, which is my favorite HTTP client.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library for .NET.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which one is your favorite HTTP client library for .NET?&lt;/p&gt;</content:encoded><category>aspnet-core</category><category>api</category><author>Abhith Rajan</author></item><item><title>C# - Get Web.Config Connection String in a Class Library</title><link>https://www.abhith.net/blog/c-sharp-get-web-config-connection-string-in-a-class-library/</link><guid isPermaLink="true">https://www.abhith.net/blog/c-sharp-get-web-config-connection-string-in-a-class-library/</guid><description>If you can, pass the connection string as a parameter to the class library. Second option is System.Configuration.ConfigurationManager</description><pubDate>Sun, 15 Sep 2019 19:26:00 GMT</pubDate><content:encoded>&lt;p&gt;This is relatively old topic but looks like still relevant. You need to know why?&lt;/p&gt;
&lt;h3 id=&quot;story&quot;&gt;Story&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#story&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Recently one of our vendor deployed an app in one of our environment and when tested, found that the some of the entries going to wrong DB. Checked the connection strings in Web.Config, everything was fine. Due to the lack of proper logging in the application, we planned to hook up &lt;strong&gt;Microsoft Azure Application Insights&lt;/strong&gt;, and we did discovered something, thanks to AI.&lt;/p&gt;
&lt;astro-embed-tweet&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;light&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Application Map in the &lt;a href=&quot;https://x.com/hashtag/Azure?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#Azure&lt;/a&gt; &lt;a href=&quot;https://x.com/hashtag/applicationinsights?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#applicationinsights&lt;/a&gt; saved us. &lt;br&gt;&lt;br&gt;We were able to catch a wrong connection string hardcoded in a vendor dll by checking the Application Map in the AI.&lt;a href=&quot;https://x.com/AppInsights?ref_src=twsrc%5Etfw&quot;&gt;@AppInsights&lt;/a&gt; 👏 👏 👏&lt;/p&gt;&amp;mdash; Abhith Rajan (@AbhithRajan) &lt;a href=&quot;https://x.com/AbhithRajan/status/1172902535331495936?ref_src=twsrc%5Etfw&quot;&gt;September 14, 2019&lt;/a&gt;&lt;/blockquote&gt;

&lt;/astro-embed-tweet&gt;
&lt;p&gt;Hard coding something like Connection String is a &lt;strong&gt;BAD PRACTICE&lt;/strong&gt;, things like that &lt;strong&gt;should come as a parameter to the class library methods&lt;/strong&gt;. Since we are not in a position to rewrite everything, what we did was, we replaced the hard coded connection string with the actual connection string value from the web.config.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ConnectionString&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ConfigurationManager&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ConnectionStrings&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;Default&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using  System.Configuration;...public static string ConnectionString{  get { return ConfigurationManager.ConnectionStrings[&amp;quot;Default&amp;quot;].ConnectionString; }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the above code, &lt;code&gt;Default&lt;/code&gt; is the connection string name in the &lt;strong&gt;web.config&lt;/strong&gt;.&lt;/p&gt;</content:encoded><category>aspnet</category><category>c-sharp</category><category>web-config</category><author>Abhith Rajan</author></item><item><title>Using AutoMapper in a .NET Core Class Library</title><link>https://www.abhith.net/blog/using-automapper-in-a-net-core-class-library/</link><guid isPermaLink="true">https://www.abhith.net/blog/using-automapper-in-a-net-core-class-library/</guid><description>Configuring and using AutoMapper in a .NET CORE class library is briefed in this article.</description><pubDate>Wed, 11 Sep 2019 12:59:27 GMT</pubDate><content:encoded>&lt;p&gt;AutoMapper is a handy helper library to do mapping between objects. In most scenarios, you might have an Entity Class and you want to map it to some DTO class or vice versa. With minimal configuration, &lt;strong&gt;AutoMapper&lt;/strong&gt; can do this mapping without you creating a method where you map each field one by one.&lt;/p&gt;
&lt;p&gt;Suppose I have to map &lt;em&gt;Entity&lt;/em&gt; class to &lt;em&gt;EntityDto&lt;/em&gt; and they look like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Entity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;CurrencyCode&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;decimal&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;CurrencyValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;EntityDto&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Currency&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Currency&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Currency&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public class Entity{  public string Name {get;set;}  public Guid Id {get;set;}  public string CurrencyCode {get;set;}  public decimal CurrencyValue {get;set;}}public class EntityDto{  public string Name {get;set;}  public Guid Id {get;set;}  public Currency Currency {get;set;}}public class Currency{  public string Code {get;set;}  public string Value {get;set;}}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;AutoMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeService&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ISomeService&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IMapper&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;_iMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;SomeService&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// One time configuration&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;MapperConfiguration&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;cfg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;cfg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Entity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;EntityDto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ForMember&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Currency&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;MapFrom&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Currency&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CurrencyCode&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CurrencyValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;0.00&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_iMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DtoClass&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Entity&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetEntityByIdAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// using auto mapper to do the mapping&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_iMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DtoClass&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using AutoMapper;...public class SomeService : ISomeService{  private IMapper _iMapper;  public SomeService()  {    // One time configuration      var config = new MapperConfiguration(cfg =&gt;      {          cfg.CreateMap&lt;Entity, EntityDto&gt;().ForMember(dto =&gt; dto.Currency, map =&gt; map.MapFrom(source =&gt; new Currency          {              Code = source.CurrencyCode,              Value = source.CurrencyValue.ToString(&amp;quot;0.00&amp;quot;)          }));      });      _iMapper = config.CreateMapper();  }...}public async Task&lt;DtoClass&gt; GetAsync(Guid id){    Entity entity = await GetEntityByIdAsync(id);    // using auto mapper to do the mapping    var dto = _iMapper.Map&lt;DtoClass&gt;(entity);    return dto;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the mapping configuration, we didn’t specify anything related &lt;em&gt;Id, Name&lt;/em&gt; properties. &lt;strong&gt;AutoMapper&lt;/strong&gt; will map them automatically since the source and destination property name matches for those.&lt;/p&gt;
&lt;p&gt;In the above, we defined the mappings in the same class, a better solution would be a common place where we define all the mappings. Let’s do that,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;ObjectMapper&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;readonly&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Lazy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IMapper&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Lazy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Lazy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(() &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;MapperConfiguration&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;cfg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// This line ensures that internal properties are also mapped over.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;cfg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ShouldMapProperty&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;GetMethod&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;IsPublic&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;GetMethod&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;IsAssembly&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;cfg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;AddProfile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomDtoMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;mapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;mapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;IMapper&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;Mapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Lazy&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public static class ObjectMapper{    private static readonly Lazy&lt;IMapper&gt; Lazy = new Lazy&lt;IMapper&gt;(() =&gt;    {        var config = new MapperConfiguration(cfg =&gt;        {            // This line ensures that internal properties are also mapped over.            cfg.ShouldMapProperty = p =&gt; p.GetMethod.IsPublic || p.GetMethod.IsAssembly;            cfg.AddProfile&lt;CustomDtoMapper&gt;();        });        var mapper = config.CreateMapper();        return mapper;    });    public static IMapper Mapper =&gt; Lazy.Value;}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;All the mapping configuration goes to,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;CustomDtoMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Profile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CustomDtoMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;CreateMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Entity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;EntityDto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ForMember&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Currency&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;MapFrom&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Currency&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CurrencyCode&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;CurrencyValue&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;0.00&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;// All other mappings goes here&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;public class CustomDtoMapper : Profile{    public CustomDtoMapper()    {        CreateMap&lt;Entity, EntityDto&gt;().ForMember(dto =&gt; dto.Currency, map =&gt; map.MapFrom(source =&gt; new Currency          {              Code = source.CurrencyCode,              Value = source.CurrencyValue.ToString(&amp;quot;0.00&amp;quot;)          }));        // All other mappings goes here    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And use the &lt;strong&gt;ObjectMapper&lt;/strong&gt; where ever you wanted,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ObjectMapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;Mapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Map&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;DtoClass&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;var dto = ObjectMapper.Mapper.Map&lt;DtoClass&gt;(entity);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Read more about the &lt;a href=&quot;https://automapper.org/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=using-automapper-in-a-net-core-class-library&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;AutoMapper&lt;/a&gt; configuration on the official website of &lt;a href=&quot;https://automapper.org/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=using-automapper-in-a-net-core-class-library&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;AutoMapper&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/api/system.lazy-1?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=using-automapper-in-a-net-core-class-library&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Lazy Class (System) | Microsoft Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#changelog&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;2020-03-15&quot;&gt;2020-03-15&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2020-03-15&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added common configuration model (ObjectMapper).&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>c-sharp</category><category>dotnet-core</category><author>Abhith Rajan</author></item><item><title>Dapper - Execute Multiple Stored Procedures</title><link>https://www.abhith.net/blog/dapper-execute-multiple-stored-procedures/</link><guid isPermaLink="true">https://www.abhith.net/blog/dapper-execute-multiple-stored-procedures/</guid><description>Dapper provides extension methods to execute multiple queries within the same command. The same can be used to execute multiple stored procedures.</description><pubDate>Thu, 05 Sep 2019 12:59:27 GMT</pubDate><content:encoded>&lt;p&gt;Dapper is my preferred ORM for performance constraint applications. It is one of the best solution in case of a database first approach as well as when there is already a database in place. Dapper works with SQL Server as well as so many other DB’s and I have tried Oracle DB apart from SQL Server.&lt;/p&gt;
&lt;p&gt;Dapper have so many features/extension methods, the documentation of these features can be accessed here.&lt;/p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https://dapper-tutorial.net/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dapper-execute-multiple-stored-procedures&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Dapper Dapper Tutorial | Dapper Tutorial and Documentation &lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To execute multiple stored procedures or multiple &lt;strong&gt;SQL&lt;/strong&gt; statements, we can use the &lt;code&gt;QueryMultipleAsync&lt;/code&gt; extension method.
See the sample code below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Dapper&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SomeClass&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;GetAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;someId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;anotherId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;connection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;SqlConnection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;_settings&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;()))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;connection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Open&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;@&amp;quot;exec uspTableOneAction @someId;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;                             &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;exec uspTableTwoAnotherAction @anotherId;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;multi&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;connection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;QueryMultipleAsync&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;someId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;anotherId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; }))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;firstTableItem&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;multi&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Read&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;TableOneItem&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;First&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;secondTableItem&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;multi&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;Read&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;TableTwoItem&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;&amp;gt;().&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;FirstOrDefault&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;using Dapper;...public async Task&lt;SomeClass&gt; GetAsync(Guid someId, Guid anotherId){    using (var connection = new SqlConnection(_settings.ConnectionString()))    {        connection.Open();        const string sql = @&amp;quot;exec uspTableOneAction @someId;                             exec uspTableTwoAnotherAction @anotherId;&amp;quot;;        using (var multi = await connection.QueryMultipleAsync(sql, new { someId, anotherId }))        {            var firstTableItem = multi.Read&lt;TableOneItem&gt;().First();            var secondTableItem = multi.Read&lt;TableTwoItem&gt;().FirstOrDefault();           ...        }        ...    }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the above code, my stored procedure are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;uspTableOneAction&lt;/li&gt;
&lt;li&gt;uspTableTwoAnotherAction&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The naming convention which we follows for stored procedures are,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8;--2:#54666c&quot;&gt;usp{TableName}{Action}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;usp{TableName}{Action}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;eg: uspUserInsert, uspUserUpdate&lt;/p&gt;
&lt;p&gt;And in the above example, first stored procedure expects a parameter &lt;code&gt;@someId&lt;/code&gt;.
And the second stored procedure expects &lt;code&gt;@anotherId&lt;/code&gt;. We passed these args by&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;someId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;anotherId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;new { someId, anotherId }&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The same can be written as,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;someId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;someId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;anotherId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;anotherId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;new { someId = someId, anotherId = anotherId }&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Why we omitted the right hand side part in the example is because of the arguments name matching the parameter.&lt;/p&gt;
&lt;p&gt;Just in case if both stored procedures expecting same parameter, say &lt;code&gt;@someId&lt;/code&gt;. Then our args will look like,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;someId&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;new { someId }&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;That’s it. You have the result of the two queries.&lt;/p&gt;
&lt;h3 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://dapper-tutorial.net/async?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dapper-execute-multiple-stored-procedures#querymultipleasync&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Dapper Async | Dapper Tutorial and Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://dapper-tutorial.net/querymultiple?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=dapper-execute-multiple-stored-procedures&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Dapper QueryMultiple | Dapper Tutorial and Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>dapper</category><category>sql-server</category><category>orm</category><author>Abhith Rajan</author></item><item><title>IIS - Disable CORS</title><link>https://www.abhith.net/blog/iis-disable-cors/</link><guid isPermaLink="true">https://www.abhith.net/blog/iis-disable-cors/</guid><description>Disable CORS for IIS 10 website by allowing all origins in two simple steps.</description><pubDate>Wed, 14 Aug 2019 16:54:00 GMT</pubDate><content:encoded>&lt;p&gt;For any reason you wish to disable CORS for any website hosted on IIS, one way you can do this by allowing all origins.
To do that,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure you installed &lt;a href=&quot;https://www.iis.net/downloads/microsoft/iis-cors-module?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=iis-disable-cors&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;IIS CORS Module&lt;/a&gt; on the server.&lt;/li&gt;
&lt;li&gt;Update the &lt;strong&gt;Web.Config&lt;/strong&gt; of the website to have the &lt;strong&gt;cors&lt;/strong&gt; section as given below,&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: &lt;em&gt;code tested on IIS 10&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt; version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt; encoding&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;system.webServer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;cors&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;failUnlistedOrigins&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;origin&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;allowHeaders&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;allowAllRequestedHeaders&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;cors&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;system.webServer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&gt;&lt;configuration&gt;    &lt;system.webServer&gt;        &lt;cors enabled=&amp;quot;true&amp;quot; failUnlistedOrigins=&amp;quot;true&amp;quot;&gt;          &lt;add origin=&amp;quot;*&amp;quot;&gt;            &lt;allowHeaders allowAllRequestedHeaders=&amp;quot;true&amp;quot; /&gt;          &lt;/add&gt;        &lt;/cors&gt;    &lt;/system.webServer&gt;&lt;/configuration&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;As you can see, we are allowing all origin’s by specifying &lt;code&gt;*&lt;/code&gt; as the origin.&lt;/p&gt;
&lt;p&gt;After just allowing all origins alone, if you encounter error like,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To solve that, we are setting &lt;code&gt;allowAllRequestedHeaders=&amp;quot;true&amp;quot;&lt;/code&gt; in the &lt;code&gt;allowHeaders&lt;/code&gt; for all the origins.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Remember: CORS is a security feature. Disable only if the resource is totally public.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/iis/extensions/cors-module/cors-module-configuration-reference?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=iis-disable-cors#cors-configuration&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;CORS Module Configuration Reference | Microsoft Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>iis</category><category>web-config</category><author>Abhith Rajan</author></item><item><title>Azure Web App - Web Deploy to a Sub-folder</title><link>https://www.abhith.net/blog/azure-web-app-web-deploy-to-a-sub-folder/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-web-app-web-deploy-to-a-sub-folder/</guid><description>Follow this tutorial to configure web deploy from Visual Studio to a sub-folder in your azure web app (App Service).</description><pubDate>Tue, 30 Jul 2019 15:11:27 GMT</pubDate><content:encoded>&lt;p&gt;I always recommends Microsoft Azure. Recently, We needed to deploy an ASP.NET Core app to a sub-folder inside Azure Web App (App Service).&lt;/p&gt;
&lt;p&gt;By default Azure provides publish profiles for the Web App (To put files to the root of the domain). In our case, We wanted to deploy inside a sub-folder.&lt;/p&gt;
&lt;p&gt;Suppose our web app name was &lt;code&gt;demo-site&lt;/code&gt; and we want to web deploy the app under &lt;code&gt;demo-site\folder\sub-folder&lt;/code&gt;. To do that,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download the publish profile&lt;/li&gt;
&lt;li&gt;Import in Visual Studio&lt;/li&gt;
&lt;li&gt;Edit the web-deploy profile(Normally the publish profile will have Web Deploy as well as FTP profile)
&lt;ul&gt;
&lt;li&gt;Change Site Name from &lt;code&gt;demo-site&lt;/code&gt; to &lt;code&gt;demo-site\folder\sub-folder&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Change the Destination URL from &lt;code&gt;http://demo-site.azurewebsites.net&lt;/code&gt; to &lt;code&gt;http://demo-site.azurewebsites.net/folder/sub-folder&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Publish&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But the publish failed with error,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;System.TypeLoadException: Method ‘get_Settings’ in type ‘Microsoft.Web.LibraryManager.Build.HostInteraction’ from assembly ‘Microsoft.Web.LibraryManager.Build&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is specific to our application and may not have anything to do with your app, so can skip this part.&lt;/p&gt;
&lt;p&gt;After referring a similar issue posted in GitHub &lt;a href=&quot;https://github.com/aspnet/LibraryManager/issues/481?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-web-app-web-deploy-to-a-sub-folder&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;aspnet/LibraryManager&lt;/a&gt;, We resolved the issue by updating &lt;strong&gt;Microsoft.Web.LibraryManager.Build&lt;/strong&gt; Nuget package in my project.&lt;/p&gt;
&lt;p&gt;Now next error,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Error - Web Deployment failed ERROR_NOT_SUPPORTED&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;More details about web deployment error can be found from &lt;a href=&quot;https://docs.microsoft.com/en-us/iis/publish/troubleshooting-web-deploy/web-deploy-error-codes?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-web-app-web-deploy-to-a-sub-folder#ERROR_NOT_SUPPORTED&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;. In order to solve that,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Go to portal &amp;gt; demo-site App Service &amp;gt; Configuration &amp;gt; Path Mappings &amp;gt; Virtual applications and directories. And add the following,&lt;/p&gt;
&lt;/blockquote&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Virtual path&lt;/th&gt;&lt;th&gt;Physical Path&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;/folder&lt;/td&gt;&lt;td&gt;site\wwwroot\folder&lt;/td&gt;&lt;td&gt;Folder&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;/folder/sub-folder&lt;/td&gt;&lt;td&gt;site\wwwroot\folder\sub-folder&lt;/td&gt;&lt;td&gt;Application&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Now publish from Visual Studio. If you only need to publish to a first level folder, i.e to &lt;code&gt;demo-site\folder&lt;/code&gt;, then all you have to do is, change the &lt;strong&gt;Type&lt;/strong&gt; to &lt;code&gt;Application&lt;/code&gt; in the Path mappings for &lt;code&gt;/folder&lt;/code&gt;, and skip the sub-folder entry since you don’t need it. And correct the &lt;strong&gt;Site Name&lt;/strong&gt; and &lt;strong&gt;Destination URL&lt;/strong&gt; in the publish profile accordingly.&lt;/p&gt;</content:encoded><category>azure</category><author>Abhith Rajan</author></item><item><title>Azure Web App - Missing MIME types</title><link>https://www.abhith.net/blog/azure-web-app-missing-mime-types/</link><guid isPermaLink="true">https://www.abhith.net/blog/azure-web-app-missing-mime-types/</guid><description>If you are seeing &quot;404 Not Found&quot; for .woff, .woff2 or for .json files even if they exist on your azure web app, this is the post for you.</description><pubDate>Thu, 11 Jul 2019 12:59:27 GMT</pubDate><content:encoded>&lt;p&gt;When you deploy an app to &lt;strong&gt;Azure app service&lt;/strong&gt; (Web App), you may notice that the custom font isn’t showing up or some specific files is getting 404 even if they exist on the right place.&lt;/p&gt;
&lt;p&gt;This is because of the missing Mime type definitions.&lt;/p&gt;
&lt;h2 id=&quot;mime-types&quot;&gt;Mime Types&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#mime-types&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Its definition is,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A media type (also known as a Multipurpose Internet Mail Extensions or MIME type) is a standard that indicates the nature and format of a document, file, or assortment of bytes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And if you want to know why it is causing the 404, read &lt;a href=&quot;https://docs.plesk.com/en-US/onyx/administrator-guide/65216/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=azure-web-app-missing-mime-types&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; article.&lt;/p&gt;
&lt;h2 id=&quot;missing-mime-types&quot;&gt;Missing Mime Types&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#missing-mime-types&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;font-files&quot;&gt;Font Files&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#font-files&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/font-woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;woff2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/font-woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &lt;mimeMap fileExtension=&amp;quot;woff&amp;quot; mimeType=&amp;quot;application/font-woff&amp;quot; /&gt;  &lt;mimeMap fileExtension=&amp;quot;woff2&amp;quot; mimeType=&amp;quot;application/font-woff&amp;quot; /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;json&quot;&gt;Json&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#json&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &lt;mimeMap fileExtension=&amp;quot;.json&amp;quot; mimeType=&amp;quot;application/json&amp;quot; /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;svg&quot;&gt;SVG&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#svg&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.svg&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.svg&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;image/svg+xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &lt;remove fileExtension=&amp;quot;.svg&amp;quot;/&gt;  &lt;mimeMap fileExtension=&amp;quot;.svg&amp;quot; mimeType=&amp;quot;image/svg+xml&amp;quot; /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;more&quot;&gt;More&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#more&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.webmanifest&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/manifest+json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.webp&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;image/webp&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;&amp;lt;!-- Not all browser supports webp /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;  &lt;mimeMap fileExtension=&amp;quot;.webmanifest&amp;quot; mimeType=&amp;quot;application/manifest+json&amp;quot; /&gt;  &lt;mimeMap fileExtension=&amp;quot;.webp&amp;quot; mimeType=&amp;quot;image/webp&amp;quot; /&gt; &lt;!-- Not all browser supports webp /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;sample-webconfig-file&quot;&gt;Sample web.config file&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#sample-webconfig-file&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt; version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt; encoding&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;system.webServer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;staticContent&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/font-woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;woff2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;woff2&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/font-woff&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;remove&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.svg&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mimeMap&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;fileExtension&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;.svg&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#5C6565&quot;&gt;mimeType&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;image/svg+xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;staticContent&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;system.webServer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&gt;&lt;configuration&gt;    &lt;system.webServer&gt;        &lt;staticContent&gt;            &lt;remove fileExtension=&amp;quot;woff&amp;quot;/&gt;            &lt;mimeMap fileExtension=&amp;quot;woff&amp;quot; mimeType=&amp;quot;application/font-woff&amp;quot; /&gt;            &lt;remove fileExtension=&amp;quot;woff2&amp;quot;/&gt;            &lt;mimeMap fileExtension=&amp;quot;woff2&amp;quot; mimeType=&amp;quot;application/font-woff&amp;quot; /&gt;            &lt;remove fileExtension=&amp;quot;.json&amp;quot;/&gt;            &lt;mimeMap fileExtension=&amp;quot;.json&amp;quot; mimeType=&amp;quot;application/json&amp;quot; /&gt;            &lt;remove fileExtension=&amp;quot;.svg&amp;quot;/&gt;            &lt;mimeMap fileExtension=&amp;quot;.svg&amp;quot; mimeType=&amp;quot;image/svg+xml&amp;quot; /&gt;         &lt;/staticContent&gt;    &lt;/system.webServer&gt;&lt;/configuration&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Curious about &lt;code&gt;remove fileExtension&lt;/code&gt; ?
MimeMap collection inherits but it won’t allow duplicate entries. If a duplicate mimeMap definition is added, it will result,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;IIS7 Error: cannot add duplicate collection entry of type ‘mimeMap’ with unique key attribute ‘fileExtension’&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So for the safe side, we are removing the global definition for that extension before changing it.&lt;/p&gt;</content:encoded><category>azure</category><category>web-config</category><author>Abhith Rajan</author></item><item><title>Best Laptop for Programming Under $2500 Dollars 2019</title><link>https://www.abhith.net/blog/best-laptop-for-programming/</link><guid isPermaLink="true">https://www.abhith.net/blog/best-laptop-for-programming/</guid><description>Best laptop under 2500$ in 2019 with min spec of i7-9750H, RTX-2060 and Thunderbolt 3 support.</description><pubDate>Sat, 08 Jun 2019 22:50:00 GMT</pubDate><content:encoded>&lt;p&gt;For the past month, I have been in the search for the best laptop, that will help me to do things faster. &lt;strong&gt;Best in the sense which worth every penny and yet strong in specs&lt;/strong&gt;, not a high-end gaming machine.&lt;/p&gt;
&lt;h3 id=&quot;history&quot;&gt;History&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#history&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Laptops I used earlier are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dell Inspiron (Exact series don’t remember)&lt;/li&gt;
&lt;li&gt;HP Pro Book&lt;/li&gt;
&lt;li&gt;Lenovo Y520 (256 SSD)&lt;/li&gt;
&lt;li&gt;Lenovo G40&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the above list, none of them owned by myself, first 3 out of the 4 was given by my ex-company during the employment period and the other is rented out from my brother-in-law. Out of all Lenovo Y520 was my favorite just because of its specs and speed.&lt;/p&gt;
&lt;h3 id=&quot;minimum-requirements&quot;&gt;Minimum Requirements&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#minimum-requirements&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Right now its time to own a machine, and the &lt;strong&gt;minimum&lt;/strong&gt; features am looking for are,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Thunderbolt 3 support.&lt;/li&gt;
&lt;li&gt;SSD&lt;/li&gt;
&lt;li&gt;Intel i7-9750H processor&lt;/li&gt;
&lt;li&gt;RTX 2060 Graphics card&lt;/li&gt;
&lt;li&gt;Fingerprint sensor&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;shortlisted-laptops&quot;&gt;Shortlisted Laptops&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#shortlisted-laptops&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The main YouTube channels which I rely for laptop reviews are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/channel/UCVYamHliCI9rw1tHR1xbkfw?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Dave Lee (Dave 2D)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/channel/UCkTweJExGMqp3NLvzvOn-yg?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;OWNorDisown&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/channel/UCVlMUh4WsDQvOxCJJXmWwdw?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Matthew Moniz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/channel/UC2Rzju32yQPkQ7oIhmeuLwg?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Jarrod’sTech&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/user/satanjamez?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Bob Of All Trades&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And After watching tons of reviews and all, my shortlisted items are,&lt;/p&gt;
&lt;h4 id=&quot;aero-15&quot;&gt;AERO 15&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#aero-15&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Model Name: WA-7US5130SP
&lt;a href=&quot;https://store.gigabyte.us/aero-15-oled-wa-7us5130sp-uhd-amoled-i7-9750h-nvidia-geforce-rtx-2060-gddr6-6gb-16gb-ram-512gb-m-2-pcie-ssd-win-10-pro-gaming-laptop/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Official Website&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On the pro side, it ticks all my requirement 5/5.&lt;/p&gt;
&lt;h5 id=&quot;cons&quot;&gt;Cons&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cons&quot;&gt;#&lt;/a&gt;&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Web Camera position&lt;/li&gt;
&lt;li&gt;Thermal throttling&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;youtube: https://www.youtube.com/watch?v=W64J7_Md1I4&lt;/code&gt;&lt;/p&gt;
&lt;h5 id=&quot;purchase-aero-15&quot;&gt;Purchase AERO 15&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#purchase-aero-15&quot;&gt;#&lt;/a&gt;&lt;/h5&gt;
&lt;p&gt;&lt;a href=&quot;https://amzn.to/2Xj05jQ?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Amazon&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&quot;thinkpad-x1-extreme-2nd-gen-156-laptop&quot;&gt;ThinkPad X1 Extreme (2nd Gen) (15.6”) Laptop&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#thinkpad-x1-extreme-2nd-gen-156-laptop&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x/X1-Extreme-Gen-2/p/22TP2TXX1E2?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Official Website&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&quot;acer-predator-triton-500&quot;&gt;Acer Predator Triton 500&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#acer-predator-triton-500&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Model Name: PT515-51-73EG
&lt;a href=&quot;https://www.acer.com/ac/en/US/content/predator-model/NH.Q50AA.003?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Official Website&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Watch the reviews,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;youtube: https://www.youtube.com/watch?v=pXkE0BlTBmI&lt;/code&gt;
&lt;code&gt;youtube: https://www.youtube.com/watch?v=rOCiNSZIhmM&lt;/code&gt;
&lt;code&gt;youtube: https://www.youtube.com/watch?v=qwGTHLeG2dY&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;On the pro side, it matches my requirement 4/5. But on the con side, it is not easily upgradable because of its inverted motherboard construction. See the below video,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;youtube: https://www.youtube.com/watch?v=6-PmEaytJOA&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Other than that, Only zoned RGB keyboard, &lt;strong&gt;NO&lt;/strong&gt; per key RGB.&lt;/p&gt;
&lt;p&gt;Couldn’t find the exact one in &lt;a href=&quot;https://amzn.to/2KrpHcz?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Amazon&lt;/a&gt; but similar spec with intel 8750H found &lt;a href=&quot;https://amzn.to/2KrpHcz?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&quot;hp-omen-15-latest&quot;&gt;HP Omen 15 (Latest)&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#hp-omen-15-latest&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Check out the below review.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;youtube: https://www.youtube.com/watch?v=EloUckKqAKc&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Its the cheapest in this list. And it got a bit more gaming look.&lt;/p&gt;
&lt;h4 id=&quot;any-refurbished-workstation&quot;&gt;Any Refurbished WORKSTATION&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#any-refurbished-workstation&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;To save some bucks.&lt;/p&gt;
&lt;h3 id=&quot;skipped-laptops&quot;&gt;Skipped Laptops&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#skipped-laptops&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Acer Helios 300 (2019)&lt;/strong&gt; - Lack of thunderbolt support.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lenovo Y740&lt;/strong&gt; - Big Charger and small battery.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asus ROG Zephyrus S GX701&lt;/strong&gt; - Lack of thunderbolt support.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ASUS ROG Zephyrus S GX502GW&lt;/strong&gt; - Lack of thunderbolt support.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2019-laptop-awards&quot;&gt;2019 Laptop Awards&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2019-laptop-awards&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;youtube: https://www.youtube.com/watch?v=O8zcB_EcAyY&lt;/code&gt;
&lt;code&gt;youtube: https://www.youtube.com/watch?v=icRz80kKZBA&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#conclusion&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;And my search ended when I found a good deal on &lt;a href=&quot;https://www.newegg.com/global/ae-en/p/N82E16834844793?Item=N82E16834844793&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=best-laptop-for-programming&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Dell Precision 7720&lt;/a&gt;. Even though it only ticked 2 out of my 5 requirements, am pretty satisfied with it.&lt;/p&gt;</content:encoded><category>awesome-list</category><category>laptops</category><category>shopping-guide</category><author>Abhith Rajan</author></item><item><title>Create SQL Server Database From a Script in Docker-Compose</title><link>https://www.abhith.net/blog/create-sql-server-database-from-a-script-in-docker-compose/</link><guid isPermaLink="true">https://www.abhith.net/blog/create-sql-server-database-from-a-script-in-docker-compose/</guid><description>Run a SQL Server container with database initialized from a script using docker-compose.</description><pubDate>Tue, 21 May 2019 14:55:00 GMT</pubDate><content:encoded>&lt;p&gt;In one of our project which using &lt;strong&gt;Microsoft Orleans&lt;/strong&gt;, We used ADO.NET clustering with &lt;strong&gt;SQL Server&lt;/strong&gt;. When we tried to containerize the application suite, we need a SQL Server instance in a container (for development environment) with a &lt;strong&gt;database initialized&lt;/strong&gt; with some tables and all.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: The below setup is not recommended for a &lt;strong&gt;PRODUCTION&lt;/strong&gt; environment.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For that solution, our &lt;strong&gt;docker-compose.yml&lt;/strong&gt; looks like below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;3.4&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;other.service&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;environment&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ConnectionString=Data Source=CONTAINER_NAME_OF_db;Initial Catalog=DB_NAME;User Id=sa;Password=Your_password123;Pooling=False;Max Pool Size=200;MultipleActiveResultSets=True&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;depends_on&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;db&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;image&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;my/db/image/name&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#B22E6E&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;dockerfile&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;data/Dockerfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# ports:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;#   - &amp;quot;1444:1433&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;volumes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;mssqldata:/var/opt/mssql&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;volumes&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;mssqldata&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;version: &apos;3.4&apos;services:  other.service:    ...    environment:      - ConnectionString=Data Source=CONTAINER_NAME_OF_db;Initial Catalog=DB_NAME;User Id=sa;Password=Your_password123;Pooling=False;Max Pool Size=200;MultipleActiveResultSets=True    depends_on:      - db  db:    image: my/db/image/name    build:      context: .      dockerfile: data/Dockerfile    # ports:    #   - &amp;quot;1444:1433&amp;quot;    volumes:     - mssqldata:/var/opt/mssqlvolumes:  mssqldata:&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the above, the &lt;strong&gt;other.service&lt;/strong&gt; can be anything (WEB App/Console App etc) that requires the sql server db instance. We marked the dependency between these services properly using &lt;a href=&quot;https://docs.docker.com/compose/compose-file/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=create-sql-server-database-from-a-script-in-docker-compose#depends_on&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;depends_on&lt;/a&gt; in the &lt;strong&gt;docker-compose.yml&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;volumes&lt;/strong&gt; is specified in the &lt;strong&gt;docker-compose.yml&lt;/strong&gt; in-order to &lt;a href=&quot;https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker?view=sql-server-2017&amp;amp;ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=create-sql-server-database-from-a-script-in-docker-compose#persist&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;persist&lt;/a&gt; the SQL Server data.&lt;/p&gt;
&lt;p&gt;In the same directory where &lt;strong&gt;docker-compose.yml&lt;/strong&gt; is, there is a &lt;strong&gt;data&lt;/strong&gt; folder which contains following,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dockerfile&lt;/li&gt;
&lt;li&gt;entrypoint.sh&lt;/li&gt;
&lt;li&gt;setup.sql&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Dockerfile&lt;/strong&gt; Which basically get the latest image of &lt;code&gt;mcr.microsoft.com/mssql/server&lt;/code&gt; (linux) and configures the SQL Server container.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;FROM mcr.microsoft.com/mssql/server&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ENV ACCEPT_EULA=Y&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ENV SA_PASSWORD=Your_password123&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;COPY ./data /&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ENTRYPOINT [ &amp;quot;/bin/bash&amp;quot;, &amp;quot;entrypoint.sh&amp;quot; ]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;CMD [ &amp;quot;/opt/mssql/bin/sqlservr&amp;quot; ]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;FROM mcr.microsoft.com/mssql/serverENV ACCEPT_EULA=YENV SA_PASSWORD=Your_password123COPY ./data /ENTRYPOINT [ &amp;quot;/bin/bash&amp;quot;, &amp;quot;entrypoint.sh&amp;quot; ]CMD [ &amp;quot;/opt/mssql/bin/sqlservr&amp;quot; ]&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Entry point in the &lt;strong&gt;Dockerfile&lt;/strong&gt; is pointed to a custom shell &lt;code&gt;entrypoint.sh&lt;/code&gt; which is,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-e&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--2:#1D6F69&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;/opt/mssql/bin/sqlservr&amp;#39;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;then&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# If this is the container&amp;#39;s first run, initialize the application database&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;-f&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; /tmp/app-initialized ]; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;then&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Initialize the application database asynchronously in a background process. This allows a) the SQL Server process to be the main process in the container, which allows graceful shutdown and other goodies, and b) us to only start the SQL Server process once, as opposed to starting, stopping, then starting it again.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;initialize_app_database&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Wait a bit for SQL Server to start. SQL Server&amp;#39;s process doesn&amp;#39;t provide a clever way to check if it&amp;#39;s up or not, and it needs to be up before we can import the application database&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;15s&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;#run the setup script to create the DB and the schema in the DB&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;/opt/mssql-tools/bin/sqlcmd&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-S&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;localhost&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-U&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;sa&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-P&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;Your_password123&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-d&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;master&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;-i&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;setup.sql&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6;--2:#5C6565;--2fs:italic&quot;&gt;# Note that the container has been initialized so future starts won&amp;#39;t wipe changes to the data&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;touch&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;/tmp/app-initialized&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;initialize_app_database&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;exec&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;--2:#1D6F69&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;#!/bin/bashset -eif [ &amp;quot;$1&amp;quot; = &apos;/opt/mssql/bin/sqlservr&apos; ]; then  # If this is the container&apos;s first run, initialize the application database  if [ ! -f /tmp/app-initialized ]; then    # Initialize the application database asynchronously in a background process. This allows a) the SQL Server process to be the main process in the container, which allows graceful shutdown and other goodies, and b) us to only start the SQL Server process once, as opposed to starting, stopping, then starting it again.    function initialize_app_database() {      # Wait a bit for SQL Server to start. SQL Server&apos;s process doesn&apos;t provide a clever way to check if it&apos;s up or not, and it needs to be up before we can import the application database      sleep 15s      #run the setup script to create the DB and the schema in the DB      /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Your_password123 -d master -i setup.sql      # Note that the container has been initialized so future starts won&apos;t wipe changes to the data      touch /tmp/app-initialized    }    initialize_app_database &amp;amp;  fifiexec &amp;quot;$@&amp;quot;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And the &lt;strong&gt;setup.sql&lt;/strong&gt; contains all the SQL statements to generate the DB and all. An example given below,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;DATABASE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;DB_NAME&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;USE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; DB_NAME;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;CREATE DATABASE DB_NAME;GOUSE DB_NAME;...&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;</content:encoded><category>docker</category><category>sql-server</category><author>Abhith Rajan</author></item><item><title>Microsoft SQL Server Guy Trying Oracle Database</title><link>https://www.abhith.net/blog/microsoft-sql-server-guy-trying-oracle-databse/</link><guid isPermaLink="true">https://www.abhith.net/blog/microsoft-sql-server-guy-trying-oracle-databse/</guid><description>This post contains my personal experiences trying Oracle Database.</description><pubDate>Wed, 08 May 2019 15:11:27 GMT</pubDate><content:encoded>&lt;p&gt;I have worked with &lt;strong&gt;Microsoft SQL Server&lt;/strong&gt; for the past 7 years and still enjoying working with &lt;strong&gt;SQL Server&lt;/strong&gt;. Now I got a chance to explore &lt;strong&gt;Oracle Database&lt;/strong&gt; and here is my experience.&lt;/p&gt;
&lt;h2 id=&quot;noticed-differences&quot;&gt;Noticed Differences&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#noticed-differences&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;There is &lt;strong&gt;NO DATABASE NAME&lt;/strong&gt;, instead there is this &lt;code&gt;user&lt;/code&gt; or &lt;code&gt;schema&lt;/code&gt; wise separation.&lt;/li&gt;
&lt;li&gt;Preferred IDE is &lt;strong&gt;Oracle SQL Developer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;After executing query, you need to &lt;strong&gt;commit&lt;/strong&gt; in order to retain the changes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SELECT TOP N&lt;/code&gt; is not that easy compared to SQL Server.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;docs&quot;&gt;Docs&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#docs&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;tablespaces&quot;&gt;Tablespaces&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#tablespaces&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;An Oracle database consists of one or more logical storage units called tablespaces, which collectively store all of the database’s data.&lt;/p&gt;
&lt;h3 id=&quot;varchar-vs-varchar2&quot;&gt;VARCHAR vs VARCHAR2&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#varchar-vs-varchar2&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;VARCHAR&lt;/code&gt; is reserved by Oracle to support distinction between &lt;code&gt;NULL&lt;/code&gt; and &lt;code&gt;empty string&lt;/code&gt; in future, as ANSI standard prescribes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;VARCHAR2&lt;/code&gt; does not distinguish between a NULL and empty string, and never will.&lt;/p&gt;
&lt;p&gt;If you rely on empty string and NULL being the same thing, you should use VARCHAR2.&lt;/p&gt;
&lt;h2 id=&quot;problems&quot;&gt;Problems&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#problems&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;show-line-numbers-in-oracle-sql-developer&quot;&gt;Show Line Numbers in Oracle SQL Developer&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#show-line-numbers-in-oracle-sql-developer&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This can be done easily by right clicking the line number section in the IDE, then &lt;code&gt;Toggle Line Numbers&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;create-user&quot;&gt;Create User&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#create-user&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; USER &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;UserName&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; IDENTIFIED &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;lt;Password&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;GRANT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;CONNECT&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; , &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;RESOURCE&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, DBA &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;TO&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;UserName&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;CREATE USER &lt;UserName&gt; IDENTIFIED BY &lt;Password&gt;;GRANT CONNECT , RESOURCE, DBA TO &lt;UserName&gt;;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;varchar-to-blob&quot;&gt;VARCHAR to BLOB&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#varchar-to-blob&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We can use the inbuilt function &lt;code&gt;utl_raw.cast_to_raw&lt;/code&gt; which transforms a &lt;code&gt;varchar2&lt;/code&gt; into a &lt;code&gt;BLOB&lt;/code&gt; value,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;utl_raw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;cast_to_raw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;SOME_STRING&amp;#39;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;utl_raw.cast_to_raw(&apos;SOME_STRING&apos;)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;update-blob-via-query&quot;&gt;Update BLOB via Query&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#update-blob-via-query&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sql&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;Update&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; TABLE_NAME &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;SET&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; COL_NAME &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;utl_raw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;cast_to_raw&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;#39;SOME_STRING&amp;#39;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;Update TABLE_NAME SET COL_NAME = utl_raw.cast_to_raw(&apos;SOME_STRING&apos;);&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;oracle-localhost-connection-string-for-an-aspnet-core--dapper-project&quot;&gt;Oracle localhost connection string for an ASP.NET CORE &amp;amp; Dapper project&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#oracle-localhost-connection-string-for-an-aspnet-core--dapper-project&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;cs&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;readonly&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;@&amp;quot;Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE))); user id = YOUR_USER_ID; Password= YOUR_USER_PASSWORD&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;dbConn&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;OracleConnection&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;private readonly string ConnectionString = @&amp;quot;Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE))); user id = YOUR_USER_ID; Password= YOUR_USER_PASSWORD&amp;quot;;using (var dbConn = new OracleConnection(ConnectionString)){  ...}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Replace &lt;strong&gt;YOUR_USER_ID&lt;/strong&gt; and &lt;strong&gt;YOUR_USER_PASSWORD&lt;/strong&gt; with appropriate values.&lt;/p&gt;
&lt;h3 id=&quot;ora-00933-sql-command-not-properly-ended&quot;&gt;ORA-00933: SQL command not properly ended&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ora-00933-sql-command-not-properly-ended&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is happened when my query contained &lt;strong&gt;semicolon&lt;/strong&gt; ”;” at the end. Removing the semicolon ”;” from the end of the query solved the problem.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#conclusion&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I just started exploring &lt;strong&gt;Oracle Database&lt;/strong&gt;, so this post can be considered as a draft for now, more coming.&lt;/p&gt;</content:encoded><category>sql-server</category><category>oracle-database</category><category>cookbook</category><author>Abhith Rajan</author></item><item><title>Docker - SQL Error on ASP.NET Core Alpine</title><link>https://www.abhith.net/blog/docker-sql-error-on-aspnet-core-alpine/</link><guid isPermaLink="true">https://www.abhith.net/blog/docker-sql-error-on-aspnet-core-alpine/</guid><description>Having trouble to connect to a remote SQL server from an ASP.NET Core app running on top of Alpine dotnet on a linux container?</description><pubDate>Tue, 07 May 2019 09:26:00 GMT</pubDate><content:encoded>&lt;p&gt;My ASP.NET Core app was running fine on &lt;code&gt;mcr.microsoft.com/dotnet/core/runtime:2.2-stretch-slim&lt;/code&gt; on my linux container. And the build image size was 195MB. In order to reduce the file size, I switched to &lt;code&gt;mcr.microsoft.com/dotnet/core/sdk:2.2.203-alpine3.9&lt;/code&gt; and the new image size was 98.6MB. &lt;strong&gt;WOW !!!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But then there came this problem,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;System.InvalidOperationException: Internal connection fatal error&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The SQL client was having trouble in this build. After the regular research, find out that in the &lt;strong&gt;alpine&lt;/strong&gt; image&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;microsoft/dotnet&lt;/code&gt; Alpine images are purposefully configured to use the &lt;strong&gt;.NET Core 2.0 Globalization Invariant Mode&lt;/strong&gt;. This is done to reduce the size of the image substantially. It seems as though the SqlClient does not support running with the Globalization Invariant Mode.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you are thinking what is &lt;strong&gt;.NET Core 2.0 Globalization Invariant Mode&lt;/strong&gt;,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;.NET Core 2.0 Globalization Invariant Mode enables you to remove application dependencies on globalization data and globalization behavior. This mode is an opt-in feature that provides more flexibility if you care more about reducing dependencies and the size of distribution than globalization functionality or globalization-correctness.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But there is a small catch,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The drawback of running in the invariant mode is applications will get poor globalization support.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So solution for this was to add the following in Dockerfile just before the &lt;strong&gt;ENTRYPOINT&lt;/strong&gt;,&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yml&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;RUN apk add --no-cache icu-libs&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;RUN apk add --no-cache icu-libsENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In the first step, we are adding the &lt;code&gt;icu-libs&lt;/code&gt; &lt;a href=&quot;https://pkgs.alpinelinux.org/package/edge/main/x86/icu-libs?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=docker-sql-error-on-aspnet-core-alpine&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;Alpine linux package&lt;/a&gt;, which is the international components for unicode library (libraries) and in the next step, we are setting &lt;strong&gt;DOTNET_SYSTEM_GLOBALIZATION_INVARIANT&lt;/strong&gt; to &lt;code&gt;false&lt;/code&gt; to enable the globalization support.&lt;/p&gt;
&lt;h4 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#additional-resources&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/dotnet/corefx/blob/master/Documentation/architecture/globalization-invariant-mode.md?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=docker-sql-error-on-aspnet-core-alpine&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;.NET Core 2.0 Globalization Invariant Mode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>aspnet-core</category><category>docker</category><category>sql-server</category><author>Abhith Rajan</author></item><item><title>Gatsby - Cookbook</title><link>https://www.abhith.net/blog/gatsby-cookbook/</link><guid isPermaLink="true">https://www.abhith.net/blog/gatsby-cookbook/</guid><description>This cookbook contains recipes that demonstrate how to solve common problems while working with Gatsby.</description><pubDate>Fri, 26 Apr 2019 20:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I 💟 Gatsby. This article contains some recipes which will be useful if you are into Gatsby for your next static site. Recipes are,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#using-google-fonts-in-gatsby&quot;&gt;Using Google fonts in Gatsby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#using-icons-like-font-awesome-in-gatsby&quot;&gt;Using icons like Font Awesome in Gatsby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#disqus-integration-in-a-gatsby-website&quot;&gt;Disqus integration in a Gatsby website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;using-google-fonts-in-gatsby&quot;&gt;Using Google fonts in Gatsby&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#using-google-fonts-in-gatsby&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Import the font css on your site main css file.&lt;/p&gt;
&lt;p&gt;Using &lt;a href=&quot;https://www.gatsbyjs.org/packages/gatsby-plugin-prefetch-google-fonts/?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=gatsby-cookbook&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;gatsby-plugin-prefetch-google-fonts&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install the plugin &lt;code&gt;gatsby-plugin-prefetch-google-fonts&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.abhith.net/_astro/ec.jq21y.css&quot;/&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;gatsby-plugin-prefetch-google-fonts&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;yarn add gatsby-plugin-prefetch-google-fonts&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Modify &lt;code&gt;gatsby-config.js&lt;/code&gt;. Inside the plugins array, add&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;resolve&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`gatsby-plugin-prefetch-google-fonts`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#54666C&quot;&gt;fonts&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;family: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`Oswald`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;subsets: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`latin`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;family: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`Open Sans`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;variants: [&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`400`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`700`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;{  resolve: `gatsby-plugin-prefetch-google-fonts`,  options: {    fonts: [      {        family: `Oswald`,        subsets: [`latin`],      },      {        family: `Open Sans`,        variants: [`400`, `700`]      },    ],  },}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;You can change the font family and variants or number of fonts in the above configuration according to your website needs.&lt;/p&gt;
&lt;h4 id=&quot;using-icons-like-font-awesome-in-gatsby&quot;&gt;Using icons like Font Awesome in Gatsby&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#using-icons-like-font-awesome-in-gatsby&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Using &lt;a href=&quot;https://github.com/react-icons/react-icons?ref=abhith.net&amp;amp;utm_source=abhith.net&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog&amp;amp;utm_content=gatsby-cookbook&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;react-icons&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Add it to your packages.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;install&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;react-icons&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#AD4013&quot;&gt;--save&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;npm install react-icons --save&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And in your react component&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;jsx&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;FaBeer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;react-icons/fa&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;Question&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#AD4013&quot;&gt;React&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#595DA1&quot;&gt;Component&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; (&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;h3&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;Lets go for a &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;FaBeer&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D;--2:#1D689E&quot;&gt;h3&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;import { FaBeer } from &amp;quot;react-icons/fa&amp;quot;;class Question extends React.Component {  render() {    return (      &lt;h3&gt;        {&amp;quot; &amp;quot;}        Lets go for a &lt;FaBeer /&gt;?{&amp;quot; &amp;quot;}      &lt;/h3&gt;    );  }}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h4 id=&quot;disqus-integration-in-a-gatsby-website&quot;&gt;Disqus integration in a Gatsby website&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#disqus-integration-in-a-gatsby-website&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Since &lt;strong&gt;Gatsby&lt;/strong&gt; is built on top of &lt;strong&gt;React&lt;/strong&gt;, we can use the React package for &lt;strong&gt;Disqus&lt;/strong&gt;.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0;--2:#1D689E&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;disqus-react&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;yarn add disqus-react&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And in your post component&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;DiscussionEmbed&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;&amp;quot;disqus-react&amp;quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;import { DiscussionEmbed } from &amp;quot;disqus-react&amp;quot;;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Define the &lt;strong&gt;Disqus&lt;/strong&gt; configuration like&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#53676E;--2fw:bold&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#1D689E&quot;&gt;disqusConfig&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;shortname: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF;--2:#1D6F69&quot;&gt;`yourDisqusShortName`&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;config: { identifier: &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;slug&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; },&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;const disqusConfig = {  shortname: `yourDisqusShortName`,  config: { identifier: slug, title },};&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Here &lt;code&gt;identifier&lt;/code&gt; is the unique id for your post, it can be anything.&lt;/p&gt;
&lt;p&gt;And now you can render the Disqus section by adding&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;jsx&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF;--2:#5B6900&quot;&gt;DiscussionEmbed&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583;--2:#5B6900&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#1D689E&quot;&gt;disqusConfig&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#BD2B28&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#54666C&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8;--2:#5C6565&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&lt;DiscussionEmbed {...disqusConfig} /&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;More recipes will be added as I explore &lt;strong&gt;Gatsby&lt;/strong&gt;.&lt;/p&gt;</content:encoded><category>gatsby</category><category>cookbook</category><category>react</category><author>Abhith Rajan</author></item></channel></rss>