Azure Linux App Service custom domain returns HTTP 400 Invalid Hostname despite verified SNI binding

Michael GP 0 Reputation points
2026-08-07T05:36:47.2433333+00:00

A custom domain bound to my Azure Linux App Service consistently returns HTTP 400 “Bad Request – Invalid Hostname,” although the default Azure hostname and application are healthy.

Environment:

  • App Service: acqnest-prod-west-0b8596

Resource group: rg-acqnest-prod

Region: West US 2

Plan: Linux B1

Custom domain: app.acqnest.com

Default hostname: acqnest-prod-west-0b8596.azurewebsites.net

Verified:

The default Azure hostname works.

The application health endpoint reports Healthy and the database reports Connected.

app.acqnest.com has a DNS-only CNAME pointing to acqnest-prod-west-0b8596.azurewebsites.net.

The asuid.app.acqnest.com TXT ownership record resolves publicly with the correct custom-domain verification ID.

Azure lists app.acqnest.com as Verified.

SNI SSL is enabled with an App Service Managed Certificate.

TCP port 443 is reachable.

The error occurs from multiple networks and devices.

The custom-domain and SNI bindings were removed and recreated after correcting the TXT record.

The App Service was restarted.

Always On and the /health health check are enabled.

Actual result:

HTTP 400 — Bad Request — Invalid Hostname

The request appears to be rejected by the Azure App Service front-end before reaching the application. This resembles stale or missing hostname-routing state on the App Service scale unit.

Please refresh the front-end hostname-routing entry for app.acqnest.com, move the site to a healthy scale unit, or escalate this into a private Azure support case for platform investigation.A custom domain bound to my Azure Linux App Service consistently returns HTTP 400 “Bad Request – Invalid Hostname,” although the default Azure hostname and application are healthy.

Environment:

App Service: acqnest-prod-west-0b8596

Resource group: rg-acqnest-prod

Region: West US 2

Plan: Linux B1

Custom domain: app.acqnest.com

Default hostname: acqnest-prod-west-0b8596.azurewebsites.net

Verified:

The default Azure hostname works.

The application health endpoint reports Healthy and the database reports Connected.

app.acqnest.com has a DNS-only CNAME pointing to acqnest-prod-west-0b8596.azurewebsites.net.

The asuid.app.acqnest.com TXT ownership record resolves publicly with the correct custom-domain verification ID.

Azure lists app.acqnest.com as Verified.

SNI SSL is enabled with an App Service Managed Certificate.

TCP port 443 is reachable.

The error occurs from multiple networks and devices.

The custom-domain and SNI bindings were removed and recreated after correcting the TXT record.

The App Service was restarted.

Always On and the /health health check are enabled.

Actual result:

HTTP 400 — Bad Request — Invalid Hostname

The request appears to be rejected by the Azure App Service front-end before reaching the application. This resembles stale or missing hostname-routing state on the App Service scale unit.

Please refresh the front-end hostname-routing entry for app.acqnest.com, move the site to a healthy scale unit, or escalate this into a private Azure support case for platform investigation.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


2 answers

Sort by: Most helpful
  1. Golla Venkata Pavani 7,535 Reputation points Microsoft External Staff Moderator
    2026-08-07T05:47:18.1366667+00:00

    Hi @Michael GP

    Thank you for reaching us regarding the issue.

    You have confirmed that the public TXT record for asuid.app.acqnest.com exactly matches the Custom Domain Verification ID returned by the App Service:

    Verification ID from App Service: 217AD7891CA7DAB6CE101F7A5ACA3DFA770067365BFA109E32E51718365259D2

    Public TXT record value: identical

    CNAME for app.acqnest.com points to the App Service default hostname

    Domain appears as verified in the portal

    App Service Managed Certificate is bound as SNI SSL

    These are the exact prerequisites stated in Microsoft documentation for a successful custom-domain mapping. When the asuid TXT record matches the verification ID, the CNAME is correct, validation succeeds in the portal, and an SNI certificate binding exists, the custom domain is considered fully configured.

    Once the above conditions are met, requests to the custom domain should reach the application.

    The error explicitly documented for a missing or incomplete hostname binding is HTTP 404 – Web app not found.

    Reference https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/connection-issues-with-ssl-or-tls/troubleshoot-custom-domain-issues-azure-app-service https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/connection-issues-with-ssl-or-tls/troubleshoot-domain-and-tls-ssl-certificates

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

    Please "accept" if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    1 person found this answer helpful.

  2. Michael GP 0 Reputation points
    2026-08-10T15:26:34.65+00:00

    The issue is resolved. Azure custom-domain validation, DNS, and SNI binding were correctly configured. The remaining HTTP 400 response was caused by the application’s production AllowedHosts setting not including app.acqnest.com. After adding the hostname and redeploying, https://app.acqnest.com/health returns Healthy with the database Connected.

    Thank you for your assistance.

    Was this answer helpful?

    0 comments No comments

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.