<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nitesh Singhal</title>
    <description>The latest articles on DEV Community by Nitesh Singhal (@niteshsinghal85).</description>
    <link>https://dev.to/niteshsinghal85</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F787907%2F8d462094-8138-4353-bee3-277b2cc46664.PNG</url>
      <title>DEV Community: Nitesh Singhal</title>
      <link>https://dev.to/niteshsinghal85</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/niteshsinghal85"/>
    <language>en</language>
    <item>
      <title>Sending Grafana notifications on Teams channel</title>
      <dc:creator>Nitesh Singhal</dc:creator>
      <pubDate>Sun, 27 Feb 2022 05:41:59 +0000</pubDate>
      <link>https://dev.to/niteshsinghal85/sending-grafana-notifications-on-teams-channel-hcn</link>
      <guid>https://dev.to/niteshsinghal85/sending-grafana-notifications-on-teams-channel-hcn</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2546%2F1%2AgzkK9aRcyICmLuzW03ab2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2546%2F1%2AgzkK9aRcyICmLuzW03ab2w.png" alt="Image by [Nitesh Singhal](https://medium.com/@niteshsinghal85)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this short tutorial we will learn how to send notifications from Grafana to Microsoft teams channel.&lt;/p&gt;

&lt;p&gt;For this tutorial, I am using latest version of Grafana, It is important to know that from version 8.3 Grafana has changed the way of configuring alerts and notification, so this article will be applicable from version 8.3 onwards.&lt;/p&gt;

&lt;p&gt;so let’s setup Teams channel first&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring Microsoft teams
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create Teams channel&lt;/strong&gt;: I am creating a new Teams channel called “Grafana” so that I get all the Grafana notifications here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Adu4z5lQQURZBUj-7q2EtxA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Adu4z5lQQURZBUj-7q2EtxA.png" alt="Teams channel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on three dots on the “Grafana” channel and click on Connectors, it will show all the available connectors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Af1RJrUJfF4fBRT6s0ug2mQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Af1RJrUJfF4fBRT6s0ug2mQ.png" alt="Adding connector"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to configure Incoming webhook for receiving the notification from Grafana&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AI4feC7Ru1yaGREQxmeShWQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AI4feC7Ru1yaGREQxmeShWQ.png" alt="Configuring Webhook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to provide necessary information and click on create button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2APpJFLHoFAH1LlUXO5wZA7Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2APpJFLHoFAH1LlUXO5wZA7Q.png" alt="Configuring Webhook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see a URL is created like in below image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AQyKdBvByBW-uBLHoxXDbMg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AQyKdBvByBW-uBLHoxXDbMg.png" alt="Incoming webhook URL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the URL, We will need to provide this in Grafana.&lt;/p&gt;

&lt;p&gt;Good our Teams channel setup is ready.&lt;/p&gt;

&lt;p&gt;Now let’s move to our Grafana instance&lt;/p&gt;




&lt;h2&gt;
  
  
  Configuring Grafana
&lt;/h2&gt;

&lt;p&gt;For this experiment, I am running a docker version of Grafana&lt;/p&gt;

&lt;p&gt;With new version of Grafana, we have to configure contact points.&lt;/p&gt;

&lt;p&gt;Let’s configure one for MS teams.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2596%2F1%2AG66WuI71Xmo50gzUldh7fA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2596%2F1%2AG66WuI71Xmo50gzUldh7fA.png" alt="configure contact point"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2566%2F1%2AMTggs8_JCc--2EMco0-2Xw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2566%2F1%2AMTggs8_JCc--2EMco0-2Xw.png" alt="configure contact point"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can send test notification by clicking test button.&lt;/p&gt;

&lt;p&gt;Let’s try and see the what happens&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2606%2F1%2AKacppSUabGoOUfVgXAJ8Sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2606%2F1%2AKacppSUabGoOUfVgXAJ8Sw.png" alt="Test notification in Teams"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as you can see, we have received a test notification in Teams channels.&lt;/p&gt;

&lt;p&gt;Now go to notification policies tab in Grafana UI. By default we already have one notification policy configured.&lt;/p&gt;

&lt;p&gt;Let’s add one more for Teams.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2584%2F1%2AT86ZuYRRuTlO7abSC7enHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2584%2F1%2AT86ZuYRRuTlO7abSC7enHw.png" alt="Adding Notification policies"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2390%2F1%2AXXx4vf0la2sY-Ihh4PXVAg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2390%2F1%2AXXx4vf0la2sY-Ihh4PXVAg.png" alt="Adding Notification policies"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now Grafana is ready to send notification whenever alert rule is matched.&lt;/p&gt;

&lt;p&gt;I have configured a limit a for RatePerSecond for my API call and whenever it crosses the limit I will get real time alert like below in my teams channel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AN5jsMbOWsKvjG4XB2ygeww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AN5jsMbOWsKvjG4XB2ygeww.png" alt="Real time notification in Teams"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;With the increasing use of Microsoft teams for daily work it could be useful to get real time alert with same channel.&lt;/p&gt;

&lt;p&gt;Although I have taken example of Grafana but the same technique can be used for getting notification from different applications.&lt;/p&gt;

&lt;p&gt;Even you can integrate this technique in your application.&lt;/p&gt;

&lt;p&gt;Hope it is useful.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Happy Learning..!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Originally published on &lt;a href="https://medium.com/@niteshsinghal85/sending-grafana-notifications-on-teams-channel-cefd88749420" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>grafana</category>
      <category>msteams</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Feature Management using Consul KV store in ASP.Net core</title>
      <dc:creator>Nitesh Singhal</dc:creator>
      <pubDate>Fri, 07 Jan 2022 17:04:24 +0000</pubDate>
      <link>https://dev.to/niteshsinghal85/feature-management-using-consul-kv-store-in-aspnet-core-5a1d</link>
      <guid>https://dev.to/niteshsinghal85/feature-management-using-consul-kv-store-in-aspnet-core-5a1d</guid>
      <description>&lt;p&gt;A Practical guide on how Consul KV is used for managing feature flags in ASP.NET core application&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x_Yw6bSI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2506/1%2AxJ4o7_b9lXJd3Dxeh7sudQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x_Yw6bSI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2506/1%2AxJ4o7_b9lXJd3Dxeh7sudQ.png" alt="Image by [Nitesh Singhal](https://medium.com/@niteshsinghal85)" width="880" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature Management or Flags&lt;/strong&gt; is a concept to switch features on and off via a flag. You want to switch on some feature based on certain condition or at certain time. but at the same time you also don’t want to recompile and redeploy your app.&lt;/p&gt;

&lt;p&gt;You can find more information on why feature flags are required &lt;a href="https://docs.microsoft.com/en-us/azure/azure-app-configuration/concept-feature-management?WT.mc_id=dotnet-11820-chnoring"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This concept looks interesting and could be helpful in many scenarios. So I decide to give it a try and started following given article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-feature-flag-aspnet-core?tabs=core5x"&gt;&lt;strong&gt;Quickstart for adding feature flags to ASP.NET Core&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything was going good until I realize that I don’t have azure account( I know I can create a free account but just for argument sake, I don’t). so I had look for alternatives. I found few alternatives and most of them needed to use any external service.&lt;/p&gt;

&lt;p&gt;I did not wanted to use external service and was looking for something locally manageable.&lt;/p&gt;

&lt;p&gt;So first I configured the feature flags in appsettings.json file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LsWWh42b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2A2CUSYyVC2Ywb9Davmq5LlQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LsWWh42b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2A2CUSYyVC2Ywb9Davmq5LlQ.png" alt="feature management in appsettings.json" width="864" height="73"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This did the trick and was able to manage the features locally.&lt;/p&gt;

&lt;p&gt;but this also has drawbacks that I have to update the appsettings.json file for each application if this feature is spanning across multiple microservices.&lt;/p&gt;

&lt;p&gt;then I was looking for some way of managing this configuration centrally so that I don’t have to go to each app and update the appsettings.json&lt;/p&gt;

&lt;p&gt;That’s where &lt;strong&gt;consul KV store&lt;/strong&gt; came into picture. I learned that it can be used for managing the configuration centrally so I decided to give it a try.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" alt="" width="723" height="19"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up Consul KV store
&lt;/h3&gt;

&lt;p&gt;First let’s setup the consul locally. I am using docker version but it can also be install without docker.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d -p 8500:8500 --name=demo-consul consul
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;let’s verify if it running. Go to &lt;a href="http://localhost:8500"&gt;http://localhost:8500&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MKdaBBjX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2512/1%2AY4oFE0IWr8D2jpWPp-tPeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MKdaBBjX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2512/1%2AY4oFE0IWr8D2jpWPp-tPeg.png" alt="consul ui" width="880" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as we can see it is running successfully. Now let’s add configuration in Key/Value store.&lt;/p&gt;

&lt;p&gt;Click the ‘&lt;strong&gt;Key/Value’&lt;/strong&gt; from side menu and click ‘&lt;strong&gt;Create&lt;/strong&gt;’&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kSmglcl4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2530/1%2Azac7yL2gUy7LK94F-O0tYg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kSmglcl4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2530/1%2Azac7yL2gUy7LK94F-O0tYg.png" alt="Consul UI KV store" width="880" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add Key “&lt;strong&gt;FeatureManagement&lt;/strong&gt;”. &lt;em&gt;(it can be anything of your choice but remember to use same in code)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;and add the same content as we have added in the appsettings.json&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--__NqxhNp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2540/1%2ASfFnhvuy6lGrtBR_xaveGQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--__NqxhNp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2540/1%2ASfFnhvuy6lGrtBR_xaveGQ.png" alt="Adding new key value consul UI" width="880" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save it in the end.&lt;/p&gt;

&lt;p&gt;We are done with consul set up. Let’s move onto code and see what changes are needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" alt="" width="723" height="19"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Demo example
&lt;/h3&gt;

&lt;p&gt;First of all we will need a way to read the KV data and add it as configuration&lt;/p&gt;

&lt;p&gt;I am using nuget package to fetch the data from consul KV store and add it to configuration.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet add package Winton.Extensions.Configuration.Consul
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Open Program.cs and add the following code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
add the following line in appsettings.json for configuring consul address&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"ConsulServer": "http://localhost:8500"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;with these changes we are ready to run our app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0ns9gruM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AlA1Tb3SnjaJ8dpivl4bzug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0ns9gruM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AlA1Tb3SnjaJ8dpivl4bzug.png" alt="App with feature is disabled" width="858" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since our feature flag “Beta” was set to false we don’t see that menu item yet.&lt;/p&gt;

&lt;p&gt;now let’s change the value in consul KV and set it true.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dfmO9R8m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AX3bTH1gM9IiipbbDGaS8rg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dfmO9R8m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AX3bTH1gM9IiipbbDGaS8rg.png" alt="" width="880" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;save it and refresh the browser by hitting F5.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e0feVEw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AGjfstQrFfXLcKEEdWKw5fQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e0feVEw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AGjfstQrFfXLcKEEdWKw5fQ.png" alt="App with feature is enabled" width="861" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can see “Beta” in the menu and when you click it will take you to the respective page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DuEOjN6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AoVJluihm9pk5qctqHaF7lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DuEOjN6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AoVJluihm9pk5qctqHaF7lg.png" alt="feature page" width="858" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;with this technique we can now manage our configuration from a central location and if there are multiple microservice which needs same configuration can be updated at the same time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" alt="" width="723" height="19"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restrict Consul KV access
&lt;/h3&gt;

&lt;p&gt;Till now we have seen that we have not restricted the consul access and anybody can access and modify the values. this is ok for development but we don’t want that in production so we have to restrict the access.&lt;/p&gt;

&lt;p&gt;we can follow the given guide and secure consul access.&lt;br&gt;
&lt;a href="https://learn.hashicorp.com/tutorials/consul/access-control-setup-production"&gt;&lt;strong&gt;Secure Consul with Access Control Lists (ACLs) | Consul - HashiCorp Learn&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6MV-uMAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AELlcZRDoJQd2AC1TacDBgQ.png" alt="" width="723" height="19"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this tutorial, I covered feature flags and consul KV store usage in combination. but the usage of consul KV store is not limited to configuration storage. we can also use this as caching tool for some of scenarios.&lt;/p&gt;

&lt;p&gt;Hope it is helpful..&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Happy coding and Keep learning..!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Source code at &lt;a href="https://github.com/niteshsinghal85/blogs/tree/main/TestFeatureFlags"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.consul.io/"&gt;&lt;strong&gt;Consul by HashiCorp&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Originally published on &lt;a href="https://medium.com/@niteshsinghal85/feature-management-using-consul-kv-store-in-asp-net-core-14f597251cca"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>consul</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
