Search code examples
powershellazureedx

Powershell Error Open Edx deployment on Azure


Why doest this script return diff error on Windows10 and Mac for the same Powershell Version? Script executed: enter image description here Mac error

Windows  errors returned


Solution

  • Now, Azure PowerShell on Mac is in preview. It does not have full functions of Windows PowerShell. Parameter ServicePrincipalName is not supported on Mac now, so you get the error.

    According to the error on Windows PowerShell. It seems that your application ID or password wrong. Do you check your them? You could use the following cmdlets to create service principal and logon 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>
    

    More information please refer to this link.