繁体   English   中英

Powershell错误在Azure上打开Open Edx部署

[英]Powershell Error Open Edx deployment on Azure

为什么该脚本在相同Powershell版本的Windows10和Mac上不返回diff错误? 脚本执行: 在此处输入图片说明 Mac错误

Windows错误返回

现在,Mac上的Azure PowerShell处于预览状态。 它没有Windows PowerShell的全部功能。 Mac上现在不支持参数ServicePrincipalName ,因此会出现错误。

根据Windows PowerShell上的错误。 看来您的应用程序ID或密码错误。 你检查他们吗? 您可以使用以下cmdlet创建服务主体并登录Azure。

#login Azure
Login-AzureRmAccount

#create RM AD application
$app = New-AzureRmADApplication –DisplayName "<Your Application Display Name>" –HomePage "<http://YourApplicationHomePage>" –IdentifierUris "<http://YourApplicationUri>" –Password "<Your Password>"

#create a service principal for that application
New-AzureRmADServicePrincipal –ApplicationId $app.ApplicationId

#Assign that service principal a role. 
New-AzureRmRoleAssignment –RoleDefinitionName Reader –ServicePrincipalName $app.ApplicationId

#Authenticating using a service principal
$pass = ConvertTo-SecureString "<Your Password>" -AsPlainText –Force
$cred = New-Object -TypeName pscredential –ArgumentList "<Your UserName>", $pass
Login-AzureRmAccount -Credential $cred -ServicePrincipal –TenantId <Your TenantId>

更多信息请参考此链接

我找到了。 最后,感谢Microsoft支持的协作:

这行代码。

Set-AzureSubscription -SubscriptionName $AzureSubscriptionName| Out-Null 

是不正确的。 它应该是:

Select-AzureRmSubscription -SubscriptionName $AzureSubscriptionName| Out-Null 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM