An Azure service that is used to provision Windows and Linux virtual machines.
Hi,
One VM can be located in a single subscription and single resource group. Never the less sounds like you want to have some network connection from the VM to your databases. Who has access to your databases depends on how you have configured the network configurations for them. Nothing stops to allow access to both databases for the same public IP which the VM is using or in case you are in private network the VM can reach the databases if they are in the same network or in different there is routing between them.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.