In SQL Azure, I try this:
select * From master.dbo.sysdatabases
And get this error:
Reference to database and/or server name in 'master.dbo.sysdatabases' is not supported in this version of SQL Server
What should I do to be able to run that query in SQL Azure?
You use the system view sys.databases (without the master qualification, it is not needed)
The system table sysdatabases has been deprecated since SQL Server 2005 (Azure is a later version) and in any case is not supported on Azure
You are getting this error because you are running this statement from another database than master. You cannot add "master." to your statements unless you are already on the master database. More generally speaking, you cannot issue statements that execute a command on another database than the one you are on.
You can run the statement without the database qualification, and it will run, as gbn is suggesting. Or you can connect to master and execute it as-is.