I have been developing an MVC3 application with the intention of deploying to the Cloud. It was configured to use Forms Authentication with SQL Membership on SQL Azure.
Everything seemed to be working perfectly locally, but after I deployed the Membership.ValidateUser no longer seemed to work. I could use the Providers to get information from the database (e.g. Membership.GetUser would return an existing account) which meant the database connection was fine and user existed, just the validation failed.
After a bit of hunting I found the solution to the problem.
Cause: The default Hashing algorithm type on Azure is SHA1 - my Windows 7 default is HMACSHA256.
Symptom: The password decryption will fail when deployed to Azure causing the Membership.ValidateUser to return false.
Solution: Add the hashAlgorithmType="HMACSHA256" attribute to the membership element in your web.config file. It is recommended you also add passwordFormat="Hashed" to the DefaultMembershipProvider (details in the links below).