@sajia
Apologies for the delay while I looked into this issue. I understand you are looking for the source code for azure serial console as you are hoping to add this feature to your own application.
Unfortunately, there is no publicly available source code for this feature. There is a public repo available which contains some information and ability to create issues, but no source code. Since this is not a publicly available code, it is not possible to accommodate your request. I have reached out to the serial console team to see if there is anything further that can be added. I will provide an update if there is something useful that might help you implement this.
-------------------------------
Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.