【问题标题】:Error on Set-AzureSubscription - ForbiddenError: The server failed to authenticate the request.Set-AzureSubscription 上的错误 - ForbiddenError:服务器未能对请求进行身份验证。
【发布时间】:2016-11-18 10:05:16
【问题描述】:

尝试使用 Windows PowerShell 设置 azure 订阅时出现错误。

Set-AzureSubscription  -SubscriptionName  $azureSubscriptionName -CurrentStorageAccount $service_name

Set-AzureSubscription : ForbiddenError: 服务器未能对请求进行身份验证。验证证书是否 有效并与此订阅相关联。 在行:1 字符:1 + 设置 AzureSubscription -SubscriptionName $azureSubscriptionName -CurrentStorage ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Set-AzureSubscription], CloudException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.SetAzureSubscriptionCommand

我在 azure 门户中确认我作为参数提供的服务在 $azureSubscriptionName 中传递的订阅中。

另一个事实是,当我列出 Azure 订阅时,CurrentStorageAccountName 为空。

这个命令有什么问题?如何设置当前存储帐户?

【问题讨论】:

    标签: powershell azure azure-storage


    【解决方案1】:

    我建议你看看这篇文章:https://blogs.msdn.microsoft.com/goutham/2015/06/16/azure-powershell-forbiddenerror-the-server-failed-to-authenticate-the-request-verify-the-certificate-is-valid-and-is-associated-with-this-subscription/。 这是一个sn-p:

    以下命令具有清除现有 Azure 配置文件的魔力。 清除-AzureProfile。 您也可以考虑手动删除文件夹C:\Users\AppData\Roaming\Windows Azure Powershell的内容。之后再次运行 Add-AzureAccount 通过输入您的订阅详细信息来获取新的/新帐户,然后执行您希望运行的任何 Azure PowerShell 命令

    希望这会有所帮助。

    【讨论】:

    • 它对我不起作用,我在添加这篇文章之前尝试过,我再次删除了 Windows Auzure Powershell 文件夹的内容。
    • 请尝试使用“Get-AzurePublishSettingsFile”,然后使用“import-AzurePublishSettingsFile '下载文件的路径'”。用户“Remove-AzureSubscription”删除未使用的订阅。再试一次,希望这会有所帮助。
    猜你喜欢
    • 2020-01-29
    • 2016-04-04
    • 2014-09-19
    • 1970-01-01
    • 2021-08-23
    • 2016-01-31
    • 1970-01-01
    • 2015-04-23
    • 1970-01-01
    相关资源
    最近更新 更多