Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable password policy in Sql Server Docker container

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?

like image 808
AlexanderM Avatar asked Jan 11 '19 19:01

AlexanderM


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

like image 56
Larnu Avatar answered Nov 15 '22 04:11

Larnu