Edit /etc/sshd_config which is the server side configuration file add these two options if you want to prevent all your clients from disconnecting:
ClientAliveInterval 120
ClientAliveCountMax 720
The first one configures the server to send null packets to clients each 120 seconds and the second one configures the server to close the connection if the client has been inactive for 720 intervals that is 720*120 = 86400 seconds = 24 hours
On the client side you can also include
Host *
ClientAliveInterval ...
ClientAliveCountMax ...
ServerAliveInterval ...
You can look at https://unix.stackexchange.com/a/3027 for a more detailed explanation.
Another case could be that you need to configure your idle time out on Azure Load Balancer; you can read more at https://azure.microsoft.com/en-us/blog/new-configurable-idle-timeout-for-azure-load-balancer/
PowerShell Examples
Configure TCP timeout for your Instance-Level Public IP to 15 minutes.
Set-AzurePublicIP –PublicIPName webip –VM MyVM ldleTimeoutInMinutes 15
IdleTimeoutInMinutes is optional. If not set, the default timeout is 4 minutes. Its value can now be set between 4 and 30 minutes.
Set Idle Timeout when creating an Azure endpoint on a Virtual Machine
Get-AzureVM -ServiceName "mySvc" -Name "MyVM1" | Add->AzureEndpoint -Name "HttpIn" -Protocol "tcp" -PublicPort 80 -LocalPort 8080 -IdleTimeoutInMinutes 15| Update-AzureVM