Share via

Azure SQL Managed Instance TLS custom domain issues

Julie 220 Reputation points
2025-08-21T10:37:16.0533333+00:00

When connecting to Azure SQL Managed Instance via a private DNS zone, the TLS certificate presented by Microsoft only contains the service FQDN (for example, *.database.windows.net). It does not include the private DNS zone we have created (e.g., sqlmi-prod.contoso.local)?

Why doesn’t Microsoft include private/custom hostnames in the TLS certificate for Managed Instance?

Is it correct that the certificates are service-managed and controlled by Microsoft, so customers cannot upload or bind their own certificates?

What is the officially recommended approach if we want to connect using a private/internal DNS alias — should we always use the Managed Instance FQDN, or rely on client-side options such as HostNameInCertificate / TrustServerCertificate?

Azure DNS
Azure DNS

An Azure service that enables hosting Domain Name System (DNS) domains in Azure.


Answer accepted by question author

  1. Ravi Varma Mudduluru 11,075 Reputation points Microsoft External Staff Moderator
    2025-08-21T12:12:22.8+00:00

    Hello @Julie,

    Hope you're doing well!

    Thanks for reaching out to Microsoft Q&A.

    When you connect to an Azure SQL Managed Instance using a private DNS zone, the TLS certificate you get from Microsoft only includes the public service name (the public fully qualified domain name or FQDN). It doesn’t include any private or custom DNS names you might have set up. This is how it’s designed.

    Microsoft manages these TLS certificates for all SQL Managed Instances centrally to keep things secure, compliant, and scalable. The certificates are issued for the public domain—that’s the domain everyone uses, like *.database.windows.net. They don’t cover any private or custom DNS names customers might create.

    If Microsoft were to include private or custom DNS names, they would have to make a separate certificate for every customer’s private DNS. In a cloud where many customers share resources, this isn’t practical or safe.

    Here’s why private or custom hostnames aren’t in the certificates:

    1. It would mean Microsoft has to create and manage certificates for every unique private DNS name, which is too complex and not secure for a shared cloud environment.
    2. Certificates are the same across all Azure SQL services to keep security checks consistent and meet Microsoft’s strict policies.
    3. Azure SQL Managed Instance always uses the public FQDN to verify identity. So even if you connect through a private endpoint or DNS alias, your connection has to use the public FQDN so it matches the certificate.

    The TLS certificates are fully managed by Microsoft, and customers can’t upload or use their own certificates for the managed instance.

    What Microsoft suggests when using a private or internal DNS name to connect:

    1. Always use the public FQDN of the Managed Instance in your connection string, even if you’re using private endpoints. This makes sure the TLS certificate matches and the connection is trusted.
    2. If you must use a private DNS name, configure your SQL client like this:
      • Set HostNameInCertificate to the public FQDN.
        • Set TrustServerCertificate=True only if you trust the connection and want to skip hostname checking.

    These settings let your client correctly verify the certificate using the public hostname, even if you connect with a private DNS name.

    Supporting Documents:

    Resolve private domain names - Azure SQL Managed Instance | Microsoft Learn

    Connectivity architecture - Azure SQL Managed Instance | Azure Docs

    SqlConnectionStringBuilder.TrustServerCertificate Property (System.Data.SqlClient) | Microsoft Learn

    Kindly let us know if the above helps or you need further assistance on this issue.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.