Hi @Hazem Suleiman,
Thanks for the question and using MS Q&A platform.
The default and custom domains should behave identically unless restricted. The 403 error on the default domain is likely due to IP restrictions, host header validation, or slot-specific settings.
- Go to App Service > Networking > Access Restrictions and ensure no rules block the default domain.
- Look for hostname filtering (e.g.,
AllowedHosts
in asp.net Core) and ensureazurewebsites.net
is allowed. - Use
curl -H "Host: yourapp.azurewebsites.net"
to bypass DNS and isolate issues. - Staging slots can have separate configurations. Verify that the slot’s settings (e.g., IP restrictions, authentication) match expectations.
- If App Service Authentication is enabled, ensure its configured to allow both domains. Misconfigured redirects or token audiences could block the default domain.
- Compare headers (e.g.,
Host
,X-Forwarded-For
) between requests to the default and custom domains using browser dev tools orcurl -v
. - If the problem persists, enable App Service logs for deeper diagnostics.
Key Differences Between Default and Custom Domains
- SSL Certificates: The default domain uses a shared Azure-managed certificate Custom domains require you to upload a certificate (or use Azure-managed certificates).
- DNS and Routing: Custom domains require DNS configuration (CNAME or A record), while the default domain does not.
- Access Control: Both domains inherit the same App Service settings (e.g., IP restrictions, auth) unless explicitly overridden.
Reference:
https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain
Hope the above provided information help in better understanding and help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.