title: Create logins, create user from stored procedure in Azure
body: <p>I've inherited a very old app that runs on SQL Server 2005. I'm trying to move this app to Azure.</p>
  <p>One thing the stored procedures in this app do is create new database logins and new users. I know that many of the functions and system procedures it uses no longer exist in SQL Server, or in Azure.</p>
  <p>Is there some equivalent of procedures like <code>sp_addlogin</code>, <code>sp_droplogin</code>, <code>sp_grantdbaccess</code>, <code>sp_revokedbaccess</code> etc. which can be executed from a user database (the procedures are there and must run there)?</p>
  <p>I see lots of articles that talk about &quot;connect to master&quot;, but how do I do that from within a stored procedure on my custom database?</p>
  <p>For example, the &quot;create login&quot; command has to be run in master, but my procedures are in a user database. How do I do that?</p>
  <p>Any help would be appreciated. If what I'm trying to do isn't possible, I'd appreciate knowing that, too.</p>