2014-11-04 72 views
5

我試圖從Powershell登錄到我們的Azure帳戶。 我安裝了正確的模塊,但我無法得到通過了以下錯誤:「要登錄到此應用程序,必須將帳戶添加到domain.com目錄」

PS C:> Add-AzureAccount -Credential $cred Add-AzureAccount

AADSTS50034: To sign into this application the account must be added to the domain.com directory. Trace ID: ef487122-88d6-4e36-8421-4434806041d2 Correlation ID: a1ea0ee1-b278-4241-bc48-e213ecd47b27 Timestamp: 2014-11-04 09:46:02Z: The remote server returned an error: (400) Bad Request.At line:1 char:1 + Add-AzureAccount -Credential $cred + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Add-AzureAccount], AadAuthenticationFailedException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount

我是新來Azure的,所以我不知道或者是這個「domain.com」目錄。 我也沒有發現任何事情,甚至在網絡上遠程相關。

回答

2

解決方法:

改爲使用證書方法。 即刻順利運作。

+0

是的,但只有更少的訪問舊的「服務管理」(ASM),您不能使用依賴於較新的「資源管理」(ARM) – spuder 2015-10-16 23:13:22

3

嘗試使用沒有任何參數的cmdlet「add-azureaccount」,您將獲得一個簡單的登錄屏幕彈出窗口,您可以在其中輸入您的天藍色憑證。

+0

的任何命令。所有的指南和教程都告訴你使用變量$ credentials,但是如果你這樣做,你會得到一個微軟的登錄屏幕,它可以工作。 – Kevin 2015-11-29 16:19:12

+0

這是否阻止腳本的其餘部分自動繼續?建議如何正確執行此操作以避免在沒有成功登錄的情況下退出時運行腳本的其餘部分。 – 2018-02-19 04:01:17

4

登錄https://manage.windowsazure.com/並選擇Subscriptions>Manage subscriptions\directory。每個訂閱都與特定的Azure Active Directory關聯。從左側菜單中的服務列表中選擇Active Directory。打開您感興趣的目錄。users的列表將會說明它是否爲sourced from a Microsoft accountWindows Azure Active Directory。您只能自動登錄到Azure AD帳戶。

enter image description here

您可以通過選擇add userNew user in your organization創建一個帳戶。

enter image description here

我希望我可以在命令行使用我Microsoft account簽訂無UI提示。我不確定爲什麼這樣設置。但是,是的,您目前必須使用域帳戶自動登錄。

+0

這不像僅僅是'Source:Azure Active Directory'那麼簡單。即使它顯示爲「Azure Active Directory」,我也需要登錄才能點擊「個人帳戶」登錄。當它是「個人賬戶」時,它仍然可以顯示爲AD: - / – 2018-02-19 06:20:49

相關問題