Since you get an authentication error, I would be willing to bet the problem is with the authentication somewhere.
Did a quick google, and found this:
Not specific to Azure, but should point you in the right direction. Basically, I'd start with looking at the SQL log to see the state. There is a table at that above link to say what each state means. For example, 2 or 5 means that it is a username problem, 6 means a Windows username was used with SQL authentication, etc.
Narrow down the cause of the problem, and then it should be easier to daignose.
As a random thought - since you scripted it out, are you using NVARCHAR for the password or VARCHAR? I am pretty sure that the password SHOULD be NVARCHAR. Also, if you use ' in your password, you would need to escape that by putting '' (2 ' characters).
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.