- Credential Management:
- To protect or rotate contained database user credentials, it is recommended to periodically change passwords and use strong, unique passwords for each user. You can also implement policies that require users to change their passwords after a certain period. Additionally, consider using Azure Key Vault to manage and store secrets securely.
- Password Management:
- A contained database user can change their own password using the
ALTER USERstatement. However, they cannot change their username; this requires the database administrator's intervention. The command for changing the password would look like this:
ALTER USER [ClientUser] WITH PASSWORD = 'NewStrongP@ssw0rd!'; - A contained database user can change their own password using the
- Stored Procedure Execution:
- Contained users do not have automatic permissions to execute stored procedures. You need to explicitly grant
EXECUTEpermissions on the stored procedures or the schema containing them. The best practice would be to grant execute permissions on the specific schema that contains the stored procedures, as this allows for better control and security. Therefore, the preferred command would be:
This approach limits the permissions to only what is necessary for the user, adhering to the principle of least privilege.GRANT EXECUTE ON SCHEMA::[cln] TO [ClientUser]; - Contained users do not have automatic permissions to execute stored procedures. You need to explicitly grant
By following these best practices, you can securely manage client access in your Azure SQL Database setup.