Debug .Net Core Application in Local Kubernetes Container with Azure Draft and VS code –Part - 1
Two different worlds talk to each other when we go for this topic of debugging dot net core based sample application which is basically a containerized application using VS code with help of Azure Draft.
The two different worlds :
Kubernetes - Black world of command prompt.
VS code – that colorful (blue tough) , UI.
This article shows how to combine these two different worlds to enable debugging your Dot net core based application.
This article will take you through step by step with following major section and sub sections :
- Install required tools and utilities :
- Install docker for windows.
- Install Minikube ( for Kubernetes ) on windows.
- Install Kubectl , which is CLI for Kubernetes .
- Install VS code.
- Install Helm.
- Install Azure Draft.
- Create Sample dot net core app in visual studio and setup draft.
- Debug the application using draft.
Basically what is going to be here is nothing new , the concept of debugging any remotely deployed application are going to apply here.
If we remember old days where we want to debug any product deployed application or any application at remote computer then we used to follow following steps :
- deploy application in Debug mode.
- have MSVSMON.exe available on remote computer up and running .
- connect to that remote computer from our local machine’s visual studio.
- attach the debugger to remote process.
Similar things will happen here once we go through all the steps , using draft here is what happens :
- deploy application in Debug mode in local minikube node as container application .
- have VSDBG package available on container (that will be done automatically once we setup sample application for draft DokerFile)
- connect to that container from VS code by using launch.json setting of VS code.
- attach the debugger to remote process that will be done once we hit the debug button using that specific launch setting.