Azure Front Door configured site is returning "Services not available"
Asked Answered
R

5

13

I've got an Azure resource group with two App Service web applications in separate locations deployed and working as expected. I also have a Front Door configuration setup. This is responding as expected when accessed via the azurefd.net address.

I want to add a custom domain to this configuration. First, I created a CNAME in my DNS for a www address.

I then added a simple custom domain configuration (via an ARM template), passing the fully qualified custom domain name as a parameter.

The frontend section looks like this when deployed via the template:

                "frontendEndpoints": [
                {
                    "name": "frontendEndpoint1",
                    "properties": {
                        "hostName": "[concat(parameters('frontDoorName'), '.azurefd.net')]",
                        "sessionAffinityEnabledState": "Enabled",
                        "sessionAffinityTtlSeconds": 0
                    }
                },
                {
                    "name": "frontendEndpoint2",
                    "properties": {
                        "hostName": "[parameters('customDomainName')]",
                        "sessionAffinityEnabledState": "Enabled",
                        "sessionAffinityTtlSeconds": 0
                    }
                }
            ],

The frontend is deployed as expected and I can still access the azurefd.net address.

However, when I try and access the www address, I receive an error in the browser with the message:

Our services aren't available right now. We're working to restore all services as soon as possible. Please check back soon. 0tEdHXAAAAAADUxvBayGtQLDTjRthnz9XTE9OMjFFREdFMDMyMQBFZGdl

I have waited more than half an hour for any DNS changes to roll out, but it still doesn't work.

What could the problem be? What's a easy way of troubleshooting such errors? To be clear, I haven't yet added any HTTPS certificates to this configuration. The web applications do respond to both HTTP and HTTPS, so hopefully that isn't the issue.

Restoration answered 22/1, 2019 at 16:52 Comment(0)
A
14

This symptom can happen if you have not configured a routing rule for the custom domain that you added as a frontend host. A routing rule needs to be explicitly added for that frontend host, even if one has already been configured for the frontend host under the Front Door subdomain (*.azurefd.net) that your custom domain has a DNS mapping to.

So add a routing rule from the custom domain to the desired backend pool. And wait for several minutes and it will work fine.

enter image description here

Airbrush answered 23/1, 2019 at 7:36 Comment(9)
Got it Joel. Thanks. I'll give it a tryRestoration
My feeling is the UI can be improved to make this more obvious though. Very easy mistake to make.Restoration
@Joey i deployed webapp and can't see the static files from wwwroot folder are loaded when the html gets loaded. any idea ?Hartzel
I'm getting random Services Unavailable error messages and noticed in your screenshot that azurefd.net is not checked, but mine is. Could that cause intermittent issues?Polygamy
Ran into this issue with Front Door Premium. I had a single route with both the azurefd.net domain and my custom domain. Access via the azurefd.net worked the custom domain did not. Putting the custom domain in a separate route worked.Goldfarb
where can I add this routing rule?Dedicated
@TomaszKaniewski, I reckon it's the + Add A Route button in the "Front Door Manager" blade, but who knows :-)Stegodon
@MartinCapodici don't treat people like idiots because they ask a question, and don't think you are smart because you are using sarcasm, believe me you will be happier in life ;)Dedicated
@TomaszKaniewski it wasn't meant as sarcasm but more of a dig at how confusing Azure's UI around this is. Peace!Stegodon
B
2

I had the same problem. In my specific case the issue, and solution, were different from the above mentioned.

My configuration was so that I only had routing rules for HTTPS, not for HTTP.

Turns out you have to enable "custom domain https" with your own, or a frontdoor managed certicate. Enabling this with an frontdoor managed certicate fixed the issue. The website was instantly reachable, I didn't even have to wait for the certificate to be provisioned.

Bourbonism answered 9/5, 2019 at 9:33 Comment(0)
E
2

Today I ran into a same error message.

But I guess this error message actually did not tell you anything. Many different setup errors could result in this error message.

It is really frustrating... In my case, it turns out that when I open the URL in chrome, by default, chrome will use HTTPS. But my services are only available in HTTP. So I have to manually type the http:// in the browser...

Hope this could help someone else.

Enedina answered 13/2, 2023 at 5:19 Comment(0)
I
1

Sometimes we have to wait for a while to make it work.

Input answered 10/12, 2021 at 7:17 Comment(1)
turns out sometimes you need to verify your DNS is pointing to the right server. double check with tcpping in your website kudu for example. You might be surprised with the response that you get (i.e. the problem might be in your DNS)Restoration
U
1

Another reason is that the origin is unresponsive or times out.

There are some response headers that are set to indicate what's happening at the origin. In my case, it said that the origin timed out (there was a problem with my configuration that prevented the response).

The docs point to a way to enable debug response headers, which can give you more information as well: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-http-headers-protocol#optional-debug-response-headers

Of note: I didn't actually need to enable the above debug headers in my case, so at least in some scenarios, it will indicate the issue without debug mode enabled.

Urbannal answered 15/3, 2023 at 17:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.