We have an azure sql server exposed by private link to a linux virtual machine in peered vnet. We installed an azure pipeline agent on it, to be able to deploy items to the private network.
However, we have the following problem. When we login on the vm, and resolve the sql link, it resolves correctly to the private ip address for the SQL server. However, when we resolve it in the pipeline when executed by the agent, it resolves to the public ip address, which is disabled on SQL.
When doing nslookup for both, server points to 127.0.0.53 which is a systemd endpoint to forward queries, as i understood. So i would think they point to the same configuration.
Does anyone have an idea what we can do?
An example of the error:
Invoke-Sqlcmd -ConnectionString $Con -query “SELECT DB_ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Reason: An instance-specific error occurred while establishing a
| connection to SQL Server. Connection was denied since Deny Public
| Network Access is set to Yes