Posts

Showing posts from August, 2018

Debug WebJob on Azure

Few useful URL: https://{sitename}.scm.azurewebsites.net/api/continuouswebjobs/{JobName} https://{sitename}.scm.azurewebsites.net/vfs/data/jobs/continuous/{JobName}/job_log.txt

GZipStream Stream Compression | C# | System.IO.Compression

- GZipStream - Stream Compression  - System.IO.Compression  - Compress an object/file into C# https://en.wikipedia.org/wiki/DEFLATE Used by GZipStream class in C#. Can be used to compress an object. GZipStream class use Deflate Algo for compression.    Current use case: Redis cache was slow because we were saving huge objects into the cache. We used GzipStream class to compress the big objects and save it into the cache. This help with the slowness of the Redis cache.  Sample :  using System; using System.IO; using System.IO.Compression; namespace zip { public class Program { private static string directoryPath = @"c:\temp" ; public static void Main ( ) { DirectoryInfo directorySelected = new DirectoryInfo(directoryPath); Compress(directorySelected); foreach (FileInfo fileToDecompress in directorySelected.GetFiles( "*.gz" ...

State management in serverless architecture using azure durable functions

Image
State management in serverless architecture using azure durable functions Durable Functions = State management by Azure functions Manage/ Save states in azure functions Handles long running task An extension to the Azure functions and Azure web jobs. They can call other functions synchronously & Asynchronously. They define workflow in code. What is Serverless Architecture? No server dedicated to a single app Third-party services You don't own a server Custom code that is not always on. What is State : State is a nothing but the information being retained by the program. Orchestration Vs Choreography? Choreography Employs a decentralized approach for service composition Feature of Durable Azure Functions Client -> Orchestrator -> Activity What is Orchestration Client Client binding enables you to write a function Orchestration Functions/ Triggers Activity Functions The basic unit of work in a durable orchestratio...

Steps to debug two or more threads in a common method | Visual Studio | C# | Threading | Static Issue

Image
Steps to debug two or more threads in a common method In the real-time development, you might encounter a scenario in which you have to debug a set of method or function for its behavior across the different number of threads.  I encountered a similar problem today and I had to debug it through Visual Studio 2015.  Scenario I had an issue in my web application where 2 users (assume 'User-1' and 'User-2') entered their details (username/ password) and 'User-1' got logged into the system as 'User-2'. 'User-2' remained same as 'User-2'. Booommmmm! However, this issue was never reproduced by the QA Team but this was the burning issue for the client because User-2 was a superuser and client was afraid if this is happening in the production environment too.  Long story short, I drilled down this issue to a static method, responsible for the login into the system was 'Private static common' variable. Dammit!!! I had to log ...

General .NET Interview Questions

1) What is Dependency Injection? What are its benefits & How we use it? 2) Interface segregation principle 3) Liskov substitution method 4) What are Filters in ASP.NET MVC 5) Difference between Finalize & Dispose method. 6) Difference between WCF & WebAPI. 7) What is an Azure relay 8) What is Azure service bus? How it is different from the storage queue. 9) What are the properties of the SQL Database? 10) Define ACID Property. 11) What are the different isolation levels? 12) What is full-text search? 13) Chain of responsibility design pattern. 14) What is the client framework you have used? 15) How Authentication is implemented in your solution.