When I attempt to access my Key Vault using a Private Link (or maybe not, not sure), the service returns 403 (Forbidden
) with this message:
This TCP connection does not allow access to {host}.
What is causing this?
This can be caused by the following reasons:
This is the most common reason. The following steps help diagnosing:
nslookup <key-vault-name>.vault.azure.net
or the appropriate command for resolving the IP address (host <key-vault-name>.vault.azure.net
for most Linuxes).nslookup
or host
command in step 2. If that does not match, you have to fix. For detailed instructions, see validate-the-dns-resolution topic of Azure documentation.host
header in the request to Key VaultWhen you access Key Vault, the HTTP host
header must always match the Key Vault hostname. This is the default behavior for vast majority of clients, but certain clients allow customization. Also if you use a proxy, the proxy may change this value.
https://contoso.vault.azure.net/
, then the value of host
header must be contoso.vault.azure.net
.host
header sent to Key Vault service matches the one you captured in step 2.This is uncommon, but may happen when you migrate from Service Endpoints to Private Endpoints, and the migration is not complete. The following steps help diagnosing: