Yesterday I got a privilege to be a speaker on C# Corner MVP Show. It was a great show and a wonderful interaction with host Stephan Simon on my topic ‘Handling Notifications using Microsoft Graph’. Recording is available over here.
Thursday, February 25, 2021
Thursday, February 18, 2021
Ngrok is one of the well-known tool for local tunneling solution. I have used it many times being the easiest tool for any developer.
This time once again, I thought to use Ngrok for my current application, which uses Graph API to get notifications from Microsoft Teams channel. As always, I launched the Ngrok with required port as shown below:
and it got connected as shown below:
Till now everything is alright. But now when I ran my application with Ngrok’s forwarding address, I end up getting an error - 400 Bad Request.
And here is what I read more about this:
Seems like some applications can’t deal with the default behavior of Ngrok and need an explicit mention of header information, which means there is another way to handle such scenario:
After connecting Ngrok with above command, everything went very smooth and as expected.
Hope this tip would be useful for you too.
Friday, December 11, 2020
In my previous posts I tried to transcribe the things that were not too obvious for me when I initially started working on Kusto Query Language. Continuing with the same thought, this time I’m going to share a few of the approaches that can be taken to aggregate the data.
Let’s consider the below input data:
Get the average number of bugs falling under each category.
There are several approaches to achieve this.
Partition operator first partitions the input data with defined criteria and then combines all the results.
Join merges the two tables based on the specified key.
Lookup operator extends the column of the second table and looks up the values in the first one.
I hope you enjoyed aggregating data.
Sunday, November 29, 2020
You may have a requirement wherein you have a data stored in a column as JSON format and business need is to read that column value. Now when it comes to JSON, there are few ways, which can help us to read this data and represent that in a meaningful and readable manner.
Let’s consider below sample data:
In the above table, last column named Description is holding the data which is in JSON format.
One way to extract data of description column is by using the dynamic literal as shown in below query:
On execution of above query, you will notice that all the properties of JSON are extracted in the form of new columns, as shown below:
We can further improvise the above query in terms of readability. If the column title and the JSON property are having the same name, then JSON property can be directly accessed using dot as shown below for AssignedTo:
The result of above query would also be the same as shown above.
Sometimes we do have a requirement to extract just one or two properties from JSON column. In such scenario, reading entire JSON value and converting it would be an expensive operation.
Here comes the parse_json to rescue us. Below is the sample query to achieve this:
On execution of the above query, below result can be achieved:
Hope you enjoyed extracting JSON data.
Wednesday, November 18, 2020
Let’s consider a scenario, wherein requirement is to find out the percentage of a particular type of values from the single input set.
Below can be considered as an example of input sample data and need is to find out how much percentage of dev releases and how much percentage of prod releases are present in the input data.
In order to achieve the solution, one has to go through various steps as mentioned below:
So far we have got all the individual parts. The next task is to combine all the above mentioned 3 steps and generate a single result set and here comes the challenge.
As input set is holding only two columns, there is no common field in all the above mentioned three queries and as there is no commonality it is significantly difficult to bring such result set together to form a single result set.
Can’t we go ahead and introduce some new column just for the sake of projection? Well, let’s see how that changes our above 3 steps now:
Now comes the final step, wherein we need to bring all the above result set together to calculate the percentage.
Combining the individual results to get a single result.
On execution of the above steps, you will get the desired output as shown below:
Hope you enjoyed learning.