title: Azure CLI Equivalent to Powershell's Add-MsolRoleMember
body: <p>I am using <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli" rel="nofollow noreferrer">Azure CLI 2.0</a> and am trying to find a command equivalent to the following Powershell command:</p>
  
  <pre><code>Add-MsolRoleMember -RoleObjectID $roleID -RoleMemberType ServicePrincipal -RoleMemberObjectId $appObjectId
  </code></pre>
  
  <p>I am using this command to add an Azure AD Application Principal to the <strong>"User Account Administrator"</strong> role.</p>
  
  <p>I used this link to install the <a href="https://technet.microsoft.com/en-us/library/dn975125.aspx" rel="nofollow noreferrer">MSOL Powershell libraries</a> which includes the "Add-MsolRoleMember" command.</p>
  
  <p>Because I need commands that run on Mac, Linux, etc., I am trying to use the latest version of the "Azure CLI", although I'm open to other code samples (e.g. Python).</p>
  
  <p>Below are the cli commands I have tried so far:</p>
  
  <pre><code>az login --tenant &lt;my tenant id&gt;
  # I get my app id from this:
  az ad app list
  # I cannot get the following to work, and suspect I am running 
  # the incorrect command
  az role assignment create --assignee &lt;my app id&gt;  --role &lt;role id&gt;
  </code></pre>
  
  <p>So my questions is: How can I add a role to an app principal using CLI or some other library that runs on Mac, Linux, etc.?</p>