meo*_*tho 3 active-directory azure azure-active-directory service-principal azure-authentication
Connect-AzureRMAccount不起作用。我不在乎。我不想通过需要博士学位的过程来理解为什么 PowerShell 永远不想工作。所以我要使用Login-AzureRMAccount
我遵循了文档。当然这是不够的,所以我在这里。 https://docs.microsoft.com/en-us/powershell/azure/authenticate-azureps?view=azurermps-6.6.0
“为了获取服务主体的凭据作为适当的对象,请使用 Get-Credential cmdlet。此 cmdlet 将显示一个对话框,用于输入服务主体用户 ID 和密码。”
我什至在哪里可以找到我的用户 ID?我遵循了另一个关于创建 SP 的文档说明,我所做的只是创建了一个应用程序。我在 PowerShell 中得到了 SP 对象,它所做的只是给我一个 SP 的名称。
现在我明白了什么是用户 ID。如何登录?我使用Login-AzureRmAccountANDAdd-AzureRMAccount他们都说
$p = Get-Credential
Add-AzureRmAccount -ServicePrincipal -ApplicationId "XXXXXXXXXX" -Credential $p -TenantId "XXXXXXXXXXX"
Add(/Login)-AzureRmAccount : Parameter set cannot be resolved using the specified named parameters.
Run Code Online (Sandbox Code Playgroud)
尝试以下命令以服务主体身份登录,它在我这边工作正常。
$azureAplicationId ="Azure AD Application Id"
$azureTenantId= "Your Tenant Id"
$azurePassword = ConvertTo-SecureString "strong password" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($azureAplicationId , $azurePassword)
Add-AzureRmAccount -Credential $psCred -TenantId $azureTenantId -ServicePrincipal
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请参阅此类似问题。
| 归档时间: |
|
| 查看次数: |
11310 次 |
| 最近记录: |