2016-07-15 17 views
0

Windows PowerShellを使用して空のサブスクリプションを設定しようとすると、エラーが発生します。Set-AzureSubscriptionのエラー - ForbiddenError:サーバーが要求の認証に失敗しました。

Set-AzureSubscription -SubscriptionName $azureSubscriptionName -CurrentStorageAccount $service_name 

Set-AzureSubscription:ForbiddenError:サーバーが要求の認証に失敗しました。証明書が で有効で、このサブスクリプションに関連付けられていることを確認します。ラインで :1つの文字:1 +セットAzureSubscription -SubscriptionName $ azureSubscriptionName -CurrentStorage ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ + CategoryInfo:CloseError:(:)、CloudException [-AzureSubscription設定する] + FullyQualifiedErrorId:Microsoft.WindowsAzure.Commands.Profile.SetAzureSubscriptionCommand

私はサービスが私のように与えている紺碧ポータルで確認

$ azureSubscriptionNameに渡されたサブスクリプションのパラメータです。

他の事実は、Azureサブスクリプションをリストすると、CurrentStorageAccountNameは空です。

Get-AzureSubscription

は、このコマンドの何が間違っているのですか?現在のストレージアカウントを設定するにはどうすればよいですか?

答えて

0

私はあなたにこの記事を見てみることをお勧めします: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/。 スニペットは次のとおりです。

the below command does the magic of clearing your azure profile which is existing. Clear-AzureProfile. You can also consider deleting the content of the folder C:\Users\AppData\Roaming\Windows Azure Powershell manually. After which again run Add-AzureAccount to get the fresh/new one by entering your subscription details and then execute any Azure PowerShell commands that you wish to run

希望します。

+0

これは私のためには機能しません。この記事を追加する前に試してみましたが、Windows Auzure Powershellフォルダの内容を削除しました。 – Bonomi

+0

「Get-AzurePublishSettingsFile」を使用してから、「import-AzurePublishSettingsFile 'ダウンロードしたファイルへのパス」を使用してください。ユーザー 'Remove-AzureSubscription'を使用して未使用のサブスクリプションを削除します。もう一度やり直してみてください。 –

関連する問題