Skip to content

How to connect with proxy and PowerShell 6.x #8897

@v-akhana

Description

@v-akhana

Description

My customer raised a request about failure “Connect-AzAccount” command let using PowerShell 6.x

Below is my customer’s comment.


We connect to Azure from internal network through authentication proxy server.  In case of using PowerShell version 5.1, proxy settings can be done as below.

$proxyUrl = 'proxy URL'
$proxyId = 'proxy user ID'
$proxyPwd = 'proxy password'

$password = ConvertTo-SecureString $proxyPwd -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential $proxyId, $password
$proxy = New-Object System.Net.WebProxy $proxyUrl
$proxy.Credentials = $cred
[System.Net.WebRequest]::DefaultWebProxy = $proxy

In terms of PowerShell 6.x, my customer would like to use proxy as well, but cannot use the command let above with proxy error.


Steps to reproduce

Environment data


Module versions

PowerShell 6.0

Debug output


Error output


Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions