SMO Unable to change password for Contained DB User using User.ChangePassword method

  • Thread starter Thread starter MJB222398
  • Start date Start date
M

MJB222398

Guest
I have a Contained DB User and as the DB owner am attempting to change the password of this user with the code below:

var existingUser = database.Users[settings.User];

if (!string.IsNullOrWhiteSpace(settings.Password))
{
//Change Password
existingUser.ChangePassword(settings.Password);
existingUser.Alter();
}



However an Exception is thrown:

Change password failed for User 'Username8'. This object is not supported on Microsoft Azure SQL Database.

I couldn't find anything about this not being supported in the docs. Is it supported or not? If so then why am I unable to get this to work?

I have tried the other 3 overloads of the ChangePassword method too just incase but I get the same exceptions for all.

Continue reading...
 
Back
Top