Connecting to Azure with Powershell through an Authenticated Proxy

At my place of work all internet traffic is funneled through an Ironport authenticated proxy.   If you need to connect to Azure with Powershell through an authenticated proxy (e.g. Ironport) then you need to supply credentials for the proxy to use.

The simplest way I have found to do this on a Windows machine is to include the statement below in your connection script which takes your default cached logon credentials on your local system and populates then into your web proxy credentials.

[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials

I got this awesome advice from here:

How can I run an Azure powershell cmdlet through a proxy server with credentials?

http://stackoverflow.com/questions/6818672/how-can-i-run-an-azure-powershell-cmdlet-through-a-proxy-server-with-credentials

After setting the proxy creds you can use either the Add-AzureRmAccount or Login-AzureRMAccount cmdlets in Powershell to “interactively authenticate” and connect to Azure.

Advertisements
This entry was posted in Azure, Powershell. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s