Reputation: 146
I need to get hashed passwords of users in Azure SQL DB (Single Database - Managed Instance). Users exist only on DB and not on server. Users were created with:
Create user xyz with password = 'abc'
I have tried LoginProperty function but it does not work in Azure SQL DB.
Upvotes: 0
Views: 2032
Reputation: 11
this option does not help with Azure SQL Database(PAAS) as i recieved the error: Keyword or statement option 'hashed' is not supported in this version of SQL Server.
Azure SQL does not have this option, it is deprecated. Not sure how a migration will be performed if password is not known of the account.
Upvotes: 1
Reputation: 16401
Please see this document: sys.sql_logins (Transact-SQL), it supports Azure SQL database and returns one row for every SQL Server authentication login.
Run this query in your master DB, you can see the user password_hash
.
For example, I created a login sagarreadonly' in master db, then created the user 'sagarreadonly' in my SQL database.
I can get the user's hashed password. Here is code:
use master
select name, password_hash from sys.sql_logins where name='sagarreadonly'
Screenshots:
Hope this helps.
Upvotes: 0