I have an Azure App Service that I'll call "mywebapp." The public URL works correctly, and when I run:
curl -I http://mywebapp.azurewebsites.net
I get the expected response:
HTTP/1.1 302 Found
Content-Length: 145
Content-Type: text/html; charset=utf-8
Date: Thu, DD Nov YYYY HH:MM:SS GMT
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, OPTIONS
Cache-Control: private
Location: /Account/Logon?ReturnUrl=%2f
Set-Cookie: omissis;Path=/;HttpOnly;Domain=mywebapp.azurewebsites.net
Strict-Transport-Security: max-age=63072000; includeSubDomains
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin-when-cross-origin
Content-Security-Policy: omissis
The public endpoint works perfectly.
Now, I created a virtual network and a private endpoint. The private DNS zone is privatelink.azurewebsites.net
. When I check the recordset, I deduce that the hostname to use is mywebapp.privatelink.azurewebsites.net
.
From the Azure virtual network, I perform some tests:
I run:
nslookup mywebapp.privatelink.azurewebsites.net
And I get:
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: mywebapp.privatelink.azurewebsites.net
Address: 10.0.0.5
So far, everything seems fine. The DNS name resolves correctly, and the private IP is correct.
Next, I run:
curl -I http://mywebapp.privatelink.azurewebsites.net
But I get:
HTTP/1.1 404 Site Not Found
Content-Length: 2667
Connection: close
Content-Type: text/html
Date: Thu, DD Nov YYYY HH:MM:SS GMT
This is not what I expect. I've tried many different configurations to get a proper result, but I always end up with this 404 Site Not Found error.
Could someone help me troubleshoot this issue?