title: How to check if an Azure Sql Server server principal (Login) already exists
body: <p>I'm using ARM templates to instantiate a new Sql Server resource on Azure and, as part of the setup, I need to create a few user logins.</p>
  
  <p>It seems that ARM templates do not offer the options to create new user principals therefore I'm considering running a SQL command to do so:</p>
  
  <p>CREATE LOGIN 
      WITH PASSWORD = ''</p>
  
  <p>The problem with using this command is that it fails if the user already exists and therefore it is not idempotent, which is something that we need.</p>
  
  <p>How do I check if a login already exists on an Azure SQL Server?</p>