Powershell: "connect-azaccount" - Unable to connect to Azure - certificate-based authentication

Mounir 0 Reputation points
2024-02-06T15:19:53.13+00:00

Hi, I'm working on migrating our VM management scripts (locally) from our current server (Win2012) to a new one (Win2016). To manage company's subscriptions & resources, PowerShell needs to establish a connection to Azure, we use a certificate based authentication / SPN, this is where the issue lies. PowerShell fails to connect using Connect-AZaccount cmdlet: Azure-Conn-Failure-AzureSupport

Debug: Connect-Azure debug

The self-signed certificate I've created for the new server was installed & tested on current one, it works fine. The new server is behind a firewall & a proxy, so no access to standard internet, only a few ports are open , AZ modules were copied manually from current one to it. PowerShell v5.1 | Az.accounts v2.2.5 | Ping login.microsoftonline.com -> success Could you please share any ideas that might help solve this issue? I'm open to any suggestion and/or further testing. Feel free to let me know should more details be provided. Thanks in advance! Mounir

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,537 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mounir 0 Reputation points
    2024-02-19T14:37:18.9+00:00

    Update: The traffic was not opened to Azure, it was getting dropped at firewall level. The issue was solved after hooking up the server with the correct proxy configuration. Regards


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.