Please check Ubuntu firewall have mysql port is in open and Microsoft Azure have also use Network Security Group (NSG) firewall to allow and deny the port.
To Open port in Azure Ubuntu VM, you have to use NSG ( Network Security Group) which is azure firewall.
Login into Azure Portal ( portal.azure.com )
Search for and select the resource group for the VM, choose Add, then search for and select Network security group.
The Create network security group window opens.
Enter a name for your network security group.
Select or create a resource group, then select a location.
Select Create to create the network security group.
Create an inbound security rule
Select your new network security group.
Select Inbound security rules, then select Add.
Choose a common Service from the drop-down menu, such as MySQL. You can also select Custom if you want to provide a specific port to use.
Optionally, change the Priority or Name. The priority affects the order in which rules are applied: the lower the numerical value, the earlier the rule is applied.
Select Add to create the rule.
You also need to whitelist your IP address in the database to enable remote access.
Please refer the below URL which help you to Open port for Ubuntu VM.