To securely connect to your Azure OpenAI model via Azure VPN and ensure it is not accessible from all networks, follow these steps:
- VPN Gateway Configuration: Ensure your VPN Gateway is correctly set up for Point-to-Site (P2S) connections. You should have the VPN Client configuration ready.
- Private Endpoint: You've already created a Private Endpoint and linked it to a Private DNS Zone. This is essential for ensuring that the Azure OpenAI resource is only accessible through the private network.
- DNS Configuration: Make sure that your DNS settings are correctly configured. The DNS private resolver should be able to resolve the private endpoint's DNS name to its private IP address. You mentioned that when you perform an
nslookup, you receive the public IP instead of the private IP. This indicates that the DNS resolution is not correctly pointing to the private endpoint. - Custom DNS Servers: If you are unable to set
vpnClientDnsServersorcustomDnsServersconfigurations manually, ensure that your VPN Gateway is configured to use the DNS servers of your virtual network. You may need to check the settings in the Azure portal under your VPN Gateway's configuration. - Hosts File Configuration: As a workaround, you can manually configure the hosts file on your local machine to point the Azure OpenAI resource's hostname to its private IP address. This can help in bypassing the DNS resolution issue temporarily.
- Testing Connectivity: After making these changes, test the connection again using
nslookupto ensure it resolves to the private IP. If it still resolves to the public IP, double-check the DNS settings and the private endpoint configuration.
If the problem persists, consider reviewing the Azure documentation or reaching out to Azure support for more tailored assistance regarding your specific setup and configurations.