Code Mahek
  • Blog
  • About
  • Contact
  • Random Clicks
  • Resume
  • Ava Chat Bot

Fragrance
​of Programming

Visual Studio 2017: Snapshot Debugging

12/7/2017

Comments

 
​Finally Snapshot Debugger tool is now ready for the Production, it’s a tool that enables you to debug web apps running in production in Azure. With the latest Visual Studio 2017 Enterprise 15.5 you can make use of that tool.
​
Overview
I am sure many developers might have come across a scenario in which it’s very tough to debug an application and that’s the reason we use logs. But many times digging logs is very tough and painful and many times you won’t be able to reproduce the issue in Local Environment. Snapshot Debugger comes as a saviour in such scenario. The Snapshot Debugger enables a safe, non-invasive way for you to use the Visual Studio debugger you know and love directly against the production environment in Azure where the issue is happening.
Just like in memory profiler we take the snapshot of the particular state of our application, Snapshot Debugger works very much similarly. Here Snapshot debugger takes a snapshot of the state of your app at specified lines of code where you set Snappoints. While traditional breakpoints would halt your live server when hit and stop it from serving requests; Snappoints quickly capture state, including locals, watches, and the call stack while your app continues to run. This means that you can debug the actual live, running app, without impacting the experience your customers have while using the app. 
Below is the GIF file which Microsoft released showing how to use Snappoints.
Best part of Snapshot debugging is that, it has no performance impact on the application
​
Behind the Scene
As per Microsoft, Snapshot debugger intelligently captures state where you have pin pointed your snappoints. When snappoint is placed Debugger forks your app’s process and suspends the forked copy, creating a snapshot. You then debug against this snapshot, which sits in-memory on your server. The snapshot is not a copy of the full heap of the app – it’s only a copy of the page table with pages set to copy-on-write. The Snapshot Debugger only makes copies of pages in your app if the page gets modified, minimizing the memory impact on your server. In total, your app will only slow down by 10-30 milliseconds when creating snapshots. 
You can try out Snapshot debugger in Visual Studio 2017 Enterprise version 15.5 and greater.  Currently, the Snapshot Debugger supports ASP.NET and ASP.NET Core apps running in Azure App Services. For more details you can read at official visual studio blog.
Comments

Exploring Azure Functions

5/10/2017

Comments

 
Picture
Azure functions is the idea of events and code, developers will provide the Azure with a function or code and you till what event should trigger that function.
  • Scheduler: You are actually telling Azure function to run the particular code at a particular time or maybe. So in this case scheduler is the event which triggers the Azure function. This can used at many places, suppose at the end of the trading day you need clear all the database or want to run the batch.
  • Process when a new data comes in the storage. This might be particularly helpful when a particular message or data received then we need to send the email.
  • Lastly, its web hook, whenever someone calls a specific URL, then you want your function to run and example might be whenever user comments on the issue created by GitHub then I need to run the azure function, or need to handle the webhook callback from the payment provider whenever anything is sold online from the e-commerce website.
All the above discussed scenario can be easily achieved using IaaS i.e. Infrastructure as a service i.e Create my own virtual machine and deploy everything from windows service to web server as per my requirement. But in that case all the responsibility is with the developer to handle patching and maintaining, scaling etc. So it will be really great if all that work is actually done by Microsoft himself and developer concentrates on just coding!!!
Azure Cloud Services: Developer can also use web roles or Worker roles. Web roles are used for hosting websites and web APIs, and Worker roles are designed for your background tasks, like processing queues and other batch work. So in cloud services all the environment related work is taken care by Microsoft and this model looks perfect for developers
​Why do we need Azure Functions?
  • Azure functions provides us with the simplified programming model. All developer needs to do is write the code that responds to the event, whether it’s an HTTP request or Queue message
  • No boilerplate of how the event is connected or raised, all that is handled by the framework, so it’s very light weight.
  • Focus on business requirements
  • New pricing model: With cloud services and IaaS user need to have at least one server and user need to pay for that server even though if use is minimal. So now with Azure Functions, developer pays only when its code is running. So suppose you are listening to the queue and no message arrives than you pay nothing.
  • Azure function will automatically scale the servers running your functions to meet the demand, so if there are no demands there might be no servers actively running the code but when needed framework will quickly spin the when required.
Benefits:
  • Rapid and simple development
    • Code within the portal
    • Eliminate the boilerplate
  • Developer will get all the power of Azure Web Apps since Azure Function is developed on top of this framework: CI, Kudu, Easy Auth, Certs etc
  • Highly cost effective pricing and it makes overall very cheap.
  • And the best is we don’t have to maintain any servers. So effectively in big organisation we don’t need to have any Environment team for setting up the server and maintaining it.
What is Serverless?
Server less doesn’t means there are no server involved, of course servers are involved but it’s abstract from the users/developers. But we delegate all the management of the server to Azure instead of us doing it. So we can purely focus on business requirement.
All the big enterprise application relies on the third party platform or backend. For example, for database we might use Azure DocumentDb and for authentication we might use some other third party platform. And with growing number of third party platform service, we might need to write our own custom backend code as per our requirement and that’s were Azure Functions comes to help us. So you can just tell the Azure function which events you need to respond to and you can write your own custom code. So with this comes a new term “Function as a Service (FaaS)”.

Comments
<<Previous

    RSS Feed

    Categories

    All
    Azure
    C#
    Cloud
    CodeProject
    CSharp
    DotNet Core
    Jetbrains
    .NET
    Rider
    Source Generators
    SQL
    Tech News
    Ubuntu
    Visual Studio 2015
    Visual Studio 2019
    Windows
    Windows 10

    Archives

    May 2020
    February 2019
    January 2019
    December 2018
    May 2018
    December 2017
    November 2017
    October 2017
    September 2017
    July 2017
    May 2017
    April 2017
    May 2015
    April 2015
    March 2015

    View my profile on LinkedIn

Location

Contact Us

    Subscribe Today!

Submit
  • Blog
  • About
  • Contact
  • Random Clicks
  • Resume
  • Ava Chat Bot