How to Fix SQL Server Error 41973 (Msg 41973)

Published
Length
3 min read

Luis Felipe Dias

All posts

You see sql server error 41973 when an endpoint certificate is missing in Azure. You fix it by importing the SQL Server endpoint certificate into Azure SQL Managed Instance. This issue stops your database link from starting. It happens when two database systems try to set up a trust link. Both sides must trust each other before data can move. If the cloud side lacks the public key from your local server, the link fails. What causes sql server error 41973 in your database The database engine

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You see sql server error 41973 when an endpoint certificate is missing in Azure. You fix it by importing the SQL Server endpoint certificate into Azure SQL Managed Instance.

This issue stops your database link from starting. It happens when two database systems try to set up a trust link. Both sides must trust each other before data can move. If the cloud side lacks the public key from your local server, the link fails.

What causes sql server error 41973 in your database

The database engine throws message 41973 at severity level 16. Severity 16 means the user can fix the mistake. The official error message states that the link cannot start. It fails because you have not imported the endpoint certificate from SQL Server yet.

When you link a local SQL Server to Azure SQL Managed Instance, both use certificates. These keys prove the identity of each server over the network. Your local server holds a private key for its mirroring endpoint. You must export the matching public key file from that local server. Then you upload that public key to the cloud instance.

Teams hit this error for a few common reasons. Sometimes an engineer skips the certificate import step before starting the link. Other times, the team uploads the wrong certificate file from another server. Certificate rotation can also break the setup if the new key is not uploaded. Finally, a typo in the certificate data during upload will block the handshake.

How to check and fix the certificate error safely

Start by checking the mirroring endpoint on your local SQL Server. Find the exact certificate tied to that endpoint. Export the public key part of that certificate to a safe file. Never export or share the private key during this step.

Next, log in to your Azure control panel with a role that manages certificates. Upload the public key file to the target Azure SQL Managed Instance. Wait for the cloud system to finish saving the key. Once the import finishes, run your link creation step again. The two servers will now trust each other and start syncing data.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Keep your database permissions tight while you fix this issue. Do not give every engineer full admin rights just to check certificate state. In SQL Server, the db_owner role can run all maintenance tasks and even drop a database. You cannot change the permissions built into fixed database roles. Instead, give staff who only inspect data the db_datareader role. Members of db_datareader can read all user tables and views without changing server settings.

Certificates expire over time and need regular updates. If a certificate expires, your link can drop when it restarts. Track the end dates for all endpoint keys in your calendar.

When you rotate a key, upload the new public certificate to Azure first. Make sure the cloud side has the new key ready. Then switch the endpoint on your local SQL Server to use the new certificate. This order avoids downtime and stops message 41973 from coming back.

Also review how users log in to your linked databases. A database user is the identity of a login when it connects to a database. For access to many databases on an instance, a login in master is common. For access to one or a few databases, a contained database user is an option. An admin must enable contained databases on the server and database first.

Add runtime guardrails beside SQL Server

Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.

With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.

Frequently asked questions

What does severity 16 mean for message 41973?

Severity 16 means the error comes from a user mistake or missing setup step. It does not mean your database hardware or software has crashed. You can fix it by importing the right endpoint certificate.

Do I need to restart SQL Server to fix error 41973?

No, you do not need to restart your local SQL Server instance. You only need to export the endpoint public key and import it into Azure. After the import finishes, you can retry the link setup right away.

Can a user in the db_datareader role fix this certificate error?

No, members of the db_datareader role can only read data from user tables and views. Managing endpoint certificates and cloud links requires higher admin permissions on both sides.

The query runs. The emails stay hidden.