Disable password policy in Sql Server Docker container

Viewed 4596

I am trying to run a development db inside the container instead of my local instance. However, in our local dev db versions we use weak passwords (when db is getting deployed to prod the passwords are strong) so when I try to create a server users inside my container it is complaining about the weak password and deployment of SQL Server Project fails.

Is there a way to turn off strong passwords in SQL Server Container?

1 Answers

When creating the Login use CHECK_POLICY = OFF, and then a weak password will be allowed. For example:

CREATE LOGIN SampleLogin WITH PASSWORD = '1', CHECK_POLICY = OFF, CHECK_EXPIRY = OFF;

But, even if it is your Development environment, I still feel you should be creating "good" passwords. Being in Dev/UAT/etc is not an excuse for poor security.

As per comment, if you are using SQL Server 2017+ use CHECK_EXPIRATION

Related