To connect your Azure Managed Grafana instance to an on-prem SQL Server, you’ll need to ensure proper DNS resolution for the private endpoint. Since Azure Managed Grafana doesn’t automatically resolve private endpoint DNS names, you'll need to configure a custom DNS solution that can resolve prd-sql01.company.net
to the private IP. This may involve setting up DNS forwarding or using Azure DNS to handle private endpoint names. Additionally, ensure that your Azure VNet can route traffic to your on-prem network via the VPN or ExpressRoute connection, and check that the firewall and network security rules allow traffic to your SQL Server (usually port 1433 for SQL Server). From a VM within the same VNet as Grafana, test the DNS resolution to confirm the private DNS is working correctly by running tools like nslookup
or ping
. When configuring the SQL Server data source in Grafana, make sure to use the private DNS name and the appropriate authentication method. Lastly, if the issue persists, confirm that the Grafana instance has proper VNet integration, ensuring it has network access to the on-prem SQL Server. Proper DNS setup, network routing, and security rules are critical for making this connection work.
How to connect to a on premise SQL Server from Azure Managed Grafana
I have a new Azure Managed Grafana instance, and I'd like to connect to a on-premise SQL Server.
We have all of the VPN/Virtual networks setup, and from a vnet connected VM, I'm able to query data.
I have a Private Endpoint (not managed) setup, and it's landing in the correct vnet.
When I attempt to setup the MSSQL data source in Grafana by DNS name (prd-sql01.company.net), I get an immediate failure: lookup prd-sql01.company.net on 127.0.0.11:53: no such host
What's necessary to get an Azure Managed Grafana instance connected to a SQL Instance on a private network?
3 answers
Sort by: Most helpful
-
Alemu Abate Asheber 80 Reputation points
2025-01-20T22:32:28.5766667+00:00 -
Wuyi Weng 151 Reputation points Microsoft Employee
2025-02-06T19:39:43.46+00:00 As a managed service, Azure Managed Grafana (AMG) is running in a Microsoft owned network. It is outside of the customer owned network. I.e. AMG is not runing in your on-premise network or your own azure virtual network.
AMG has a feature called managed private endpoint to support the network connection from the AMG network to customer owned network. You can use a managed private endpoint to connect one AMG to your own private link service inside your network. e.g. you can have one azure VM running SQL server on it in your own virtual network. You can put private link service before this Azure VM. Then AMG can connect to this Azure VM through managed private endpoint without going through public network.
If the SQL server is running on on-premise machine, then extra network setup will be needed to connect one pirvate link service to the on-premise machine, e.g. express route, site-to-site VPN, one Azure VM acting as proxy. But this network setup is highly depend on your current network setup.
There is one example for using managed private endpoint:
https://learn.microsoft.com/en-us/azure/managed-grafana/tutorial-mpe-oss-prometheus
-
Naveena Patlolla 160 Reputation points Microsoft Vendor
2025-02-03T13:49:57.7366667+00:00 Hi @Sean Lively
Steps to Connect Grafana to an On-Premises SQL Server from an Azure VM
1.Access Grafana
Open Grafana on an Azure VM within the same VNet where Grafana is deployed.
2.Test Connection Using SQL Server IP Address
Instead of using the hostname, enter the SQL Server IP address while configuring the data source in Grafana.
If the connection is successful, proceed to the next step.
3.Add a Host Entry for SQL Server
Open the hosts file located at:
C:\Windows\System32\Drivers\etc\hosts
Add an entry mapping the SQL Server IP to its hostname as shown below:
<SQL_Server_IP> <SQL_Server_Hostname>
4.Flush DNS Cache
Open Command Prompt as Administrator and run:
ipconfig /flushdns
5.Test Connection Using Hostname
· Now, try connecting to the SQL Server using the hostname in Grafana.
Solution 2:
Step1.Open the Grafana on Sql server if the Grafana is unable to Open on SQL server, go to step number 2
Step2.
1.Add a Host Entry in SQL server as shown below, Private endpoint NIC IP address of Grafana and URL
2.Then Browse the Grafana and try to Configure the Data source MSSQL with Hostname.
Solution 3
Step 1: Verify DNS Configuration in Azure VNet
Azure Managed Grafana inherits DNS settings from the VNet it’s integrated with. Ensure:
- The VNet’s DNS Servers are configured to resolve on-premises DNS names (e.g., your company’s internal DNS servers).
· Go to Azure Portal > VNet > DNS Servers.
· If using a hybrid setup, configure Custom DNS pointing to your on-premises DNS servers or an Azure DNS Private Resolver with forwarding rules to on-prem.
2.If your on-prem DNS zone (company.net) is not reachable from Azure, use Azure DNS Private Resolver:
· Deploy a DNS Forwarding Ruleset to forward company.net queries to your on-prem DNS servers via the VPN/ExpressRoute connection.
Step 2: Test DNS Resolution from Grafana
Since you can’t run commands directly on Grafana, validate DNS resolution indirectly:
1.Use the SQL Server’s IP address instead of the DNS name in Grafana’s data source configuration.
If this works, the issue is purely DNS-related.
Example Grafana config:
Host: 192.168.1.100 (on-prem SQL Server IP)
Port: 1433
2.If the IP address works, ensure the VNet’s DNS servers can resolve prd-sql01.company.net.
Step 3: Configure Azure DNS for Hybrid Resolution
If your VNet uses Azure’s default DNS (168.63.129.16), it won’t resolve on-prem names. Fix this by:
Option 1: Use Custom DNS Servers
· Point the VNet’s DNS to your on-prem DNS servers (requires firewall rules to allow DNS traffic over VPN/ExpressRoute).
Option 2: Azure DNS Private Resolver
· Deploy an Azure DNS Private Resolver to forward company.net queries to your on-prem DNS servers.
Please provide your valuable comments
Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.