Hi @Weatherburn, Guy (Contractor)
Welcome to Microsoft Q&A! Thanks for posting the question.
As per the error looks like the outbound 1433 port is blocked. There are a couple of NSG rules that are required for APIM to be deployed and function correctly in a VNET as mentioned in this document. You need to add the rule as mentioned in the document to ensure there are no issues when trying to connect to SQL endpoints.
Source Port: *
Destination Port:1433
Protocol: TCP
Source Service Tag:Virtual Network
Destination Service Tag: SQL
If you are using a custom DNS server in a VNET then we recommend you remove the Azure Default DNS server from the list and instead configure Query forwarding on your custom DNS servers to send queries to the Azure Default DNS server. The reason that we recommend this is due to the fact that the DNS servers on the VNET are cycled through so if the Azure Default DNS server gets selected on the rotation it will not be able to resolve any custom DNS entries that you have added to your custom DNS servers. More information on this topic can be found in this document.