According to your description and comments, I have good reason to believe that the MySQL server on Azure as you said is actually an Azure SQL database instance (MS SQL Server on Azure cloud).
If you see your connection string on Azure portal as the figure below, it's actually Azure SQL database, not Azure Database for MySQL server.
So as you said, you see Azure gives a connection string using sqlsrv_connect
function as above.
The real connection string for Azure Database for MySQL should be as below.