如何使用凭据通过代理服务器运行 Azure powershell cmdlet?
当我运行以下 Powershell cmdlet(从 Azure 管理工具管理单元)时:
get-osversions -subscriptionId **** -certificate (get-item cert:\CurrentUser\MY\******)
我收到以下错误消息:
Get-OSVersions:远程服务器返回意外响应:(407) Proxy Authenti 阳离子 必需。 行数:1 字符:15 + 获取操作系统版本 <<<< -subscriptionId * -证书 (获取项目证书:\CurrentUser\MY*****) + CategoryInfo : CloseError: (:) [Get-OSVersions], ProtocolException +FullyQualifiedErrorId:Microsoft.Samples.AzureManagementTools.PowerShell.HostedS 服务.GetOSVersionsCommand
Get-OSVersions:未将对象引用设置为对象的实例。 行数:1 字符:15 + 获取操作系统版本 <<<< -subscriptionId * -证书 (获取项目证书:\CurrentUser\MY***) + CategoryInfo : CloseError: (:) [Get-OSVersions], NullReferenceException +FullyQualifiedErrorId:Microsoft.Samples.AzureManagementTools.PowerShell.HostedS 服务.GetOSVersionsCommand
这里的互联网代理服务器似乎拒绝了脚本所需的访问。
我在互联网上仔细查看了一下,似乎没有简单的方法来解决这个问题,因为这个 cmdlet 没有有效的“-credentials”或代理服务器参数。
我知道有一个“Get-Credential”cmdlet,但我认为它没有帮助。如何将凭据传递给 Azure cmdlet?
任何人都可以想出任何方法来解决这个问题吗?...
...除了使用不同的非代理互联网连接?
我很困惑。
非常感谢您抽出时间。
When I run the following Powershell cmdlet (from the Azure Management Tools Snapin):
get-osversions -subscriptionId **** -certificate (get-item cert:\CurrentUser\MY\******)
I get the following error message:
Get-OSVersions : The remote server returned an unexpected response: (407) Proxy Authenti
cation Required.
At line:1 char:15
+ get-osversions <<<< -subscriptionId * -certificate
(get-item cert:\CurrentUser\MY*****)
+ CategoryInfo : CloseError: (:) [Get-OSVersions], ProtocolException
+ FullyQualifiedErrorId : Microsoft.Samples.AzureManagementTools.PowerShell.HostedS
ervices.GetOSVersionsCommandGet-OSVersions : Object reference not set to an instance of an object.
At line:1 char:15
+ get-osversions <<<< -subscriptionId * -certificate
(get-item cert:\CurrentUser\MY***)
+ CategoryInfo : CloseError: (:) [Get-OSVersions], NullReferenceException
+ FullyQualifiedErrorId : Microsoft.Samples.AzureManagementTools.PowerShell.HostedS
ervices.GetOSVersionsCommand
It seems that the internet proxy server here is denying the script the access it requires.
I've had a good look around on the internet and it seems that there is no easy way around this problem since this cmdlet does not have a valid "-credentials" or proxy server parameter.
I know there is a 'Get-Credential' cmdlet but I don't think it helps. How would you pass the credential to the Azure cmdlet?
Can anyone think of any way to get around this issue?..
...other than using a different non-proxied internet connection?
I'm stumped.
Many Thanks for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更轻松:
Easier:
我认识的一些客户成功地使用了此处概述的方法(支持基本身份验证代理)。如果您需要其他代理类型,它遵循相同的模式。这样做的好处是它不需要更改 cmdlet。
A few customers I know were successful using the method outlined here (Supporting Basic Auth proxies). If you need other proxy types, it follows the same pattern. The nice thing about this is it does not require changing the cmdlets.