Thank you for reaching out.
Since the server is in a virtual network, you can only connect to the server from other Azure services in the same virtual network as the server. The virtual machine must be created in the same region and same subscription. The Linux virtual machine can be used as SSH tunnel to manage your database server.
See here Connect Azure Database for MySQL - Flexible Server with private access connectivity method
To establish successful connectivity, ensure that both resources are in the same region. This alignment will help resolve the issue you’re facing.
If you want to connect to the Azure Database for MySQL flexible server instance from a client that is provisioned in another virtual network from the same region or a different region, you have to link the private DNS zone with the virtual network. See how to link the virtual network documentation.
Regards,
Oury