Consider the following and see whether you can establish connectivity?
- Did you check the Network Security Groups configuration - Make sure both subnets allow traffic between them. A network security group contains security rules that allow or deny inbound network traffic to, or outbound network traffic from, several types of Azure resources.
Refer: https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview
- If you are using Azure SQL, make sure you properly configured service endpoints. Refer: https://azure.microsoft.com/en-us/blog/vnet-service-endpoints-for-azure-sql-database-now-generally-available/
- If you are using Azure SQL Managed instance, ensure you configure private endpoints to securely connect to the SQL Server with in the VNet.
Hope this helps.