title: How to resolve "Principal 'PRINCIPAL_NAME' could not be created." error?
body: <p>I'm using below sqlcmd command in shell script.</p>
  
  <pre><code>sqlcmd -S &lt;SERVER_NAME&gt; -U "&lt;USERNAME&gt;" -P &lt;PASSWORD&gt; -d "&lt;DATABASE&gt;" -q 'CREATE USER [&lt;PRINCIPAL_NAME&gt;] FROM EXTERNAL PROVIDER'
  </code></pre>
  
  <p>but It's giving below error:</p>
  
  <pre><code>Msg 33159, Level 16, State 1, Server &lt;SERVER_NAME&gt;, Line 1
  Principal '&lt;PRINCIPAL_NAME&gt;' could not be created. Only connections established with Active Directory accounts can create other Active Directory users.
  </code></pre>
  
  <p>What changes should i make to get it working properly?</p>