I am using an Azure SQL Database. I deleted some users from a Azure SQL database after I saw them mentioned in a Vulnerability Assessment report. Here's how I deleted them:
- Log in to SSMS
- Expand the Object Explorer tree
- Expand the 'Security' folder
- Expand the 'Logins' folder
- Highlight the user
- Right-click and select 'Delete'
I went back to the Vulnerability Assessment blade and ran a new 'Scan' but the users I deleted still show up in the list. The list included SQL code to show that my users still exist. I ran that code back in SSMS in the master database and confirmed my users still exist. Here's the relevant code:
SELECT * FROM sys.database_principals
When I run the following code, I get an error saying the user does not exist ('or you do not have permission' - but I am a server admin so I ruled that out):
DROP LOGIN <username>
Note: I already deleted the users from all databases on the server.
How do I get rid of these logins?