connect-azaccount – An error occurred while sending the request.

If you are using Powershel – Az module (AzureRM successor) and after command connect-azaccount you see An error occurred while sending the request.

Probably you are not using the latest version. Please check it:

Get-InstalledModule -Name Az.Accounts -AllVersions | Select-Object Name,Version

All Azure-Powershell releases:

https://github.com/Azure/azure-powershell/releases/