|
| 1 | +--- |
| 2 | +title: Troubleshoot Azure Front Door with RefString |
| 3 | +description: This article provides information about what a RefString is and how to gather them. |
| 4 | +author: Alej-b23 |
| 5 | +ms.author: pagonzalez |
| 6 | +ms.service: azure-frontdoor |
| 7 | +ms.topic: concept-article |
| 8 | +ms.date: 09/06/2024 |
| 9 | + |
| 10 | +#CustomerIntent: As a web developer, I want troubleshoot my web application using a RefString. |
| 11 | +--- |
| 12 | + |
| 13 | +# Troubleshoot Azure Front Door with RefString |
| 14 | + |
| 15 | +A guide to understand and use RefStrings for diagnosing and resolving issues with Azure Front Door. |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +* You must have an Azure Front Door profile. To create a profile, see [Creating an Azure Front Door profile](create-front-door-portal.md). |
| 20 | + |
| 21 | +## What is a RefString? |
| 22 | + |
| 23 | +A RefString is a short string appended by Azure Front Door to the HTTP response headers of each request. It provides details on how the request was processed, including the point of presence (POP) and backend status. |
| 24 | + |
| 25 | +RefStrings can help you troubleshoot and resolve issues with Azure Front Door, such as cache misses, routing errors, backend failures, and latency problems. You can identify the root cause and take appropriate actions to fix it by analyzing the RefStrings of the requests. |
| 26 | + |
| 27 | +> [!NOTE] |
| 28 | +> If you encounter an error page from Microsoft services, it will already include a RefString for the request that generated the error page. In such cases, you can skip directly to the diagnostic step. |
| 29 | +
|
| 30 | +## How to gather a RefString |
| 31 | + |
| 32 | +To gather a RefString, you need to capture the HTTP response headers of the requests and look for the header named **X-Azure-Ref**. This header contains the RefString, encoded in Base64. You can use different methods to capture the HTTP response headers, depending on your preference and situation. Here are a few examples of how to obtain a RefString from various browsers and applications: |
| 33 | + |
| 34 | +#### [Microsoft Edge Browser](#tab/edge) |
| 35 | + |
| 36 | +1. Open the browser's developer tools by pressing `F12` or `Ctrl+Shift+I`. |
| 37 | + |
| 38 | +1. Go to the **Network** tab. |
| 39 | + |
| 40 | +1. Refresh the page or perform the action that triggers the request. |
| 41 | + |
| 42 | +1. Locate the specific request in the list and find the **X-Azure-Ref** header in the response headers section. |
| 43 | + |
| 44 | +1. Copy the value of the **X-Azure-Ref** header to use with the RefString troubleshooting tool in the Azure portal. |
| 45 | + |
| 46 | +For more information, see [Inspect network activity - Microsoft Edge Developer documentation](/microsoft-edge/devtools-guide-chromium/network/). |
| 47 | + |
| 48 | +Example of how to obtain a RefString from Microsoft Edge Browser: |
| 49 | + |
| 50 | +:::image type="content" source="media/refstring/refstring-edge-browser-step.png" alt-text="Screenshot of RefString example in Microsoft Edge Browser." lightbox="media/refstring/refstring-edge-browser-step-expanded.png"::: |
| 51 | + |
| 52 | +#### [Google Chrome](#tab/chrome) |
| 53 | + |
| 54 | +For Google Chrome browsers, see [Inspect network activity - Google Chrome Developer documentation](https://developer.chrome.com/docs/devtools/network). |
| 55 | + |
| 56 | +#### [cURL](#tab/curl) |
| 57 | + |
| 58 | +To obtain headers with cURL, use the **-I** or **—include** option to include the HTTP response headers in the output. Look for the **X-Azure-Ref** header in the output, and copy the value of the header. |
| 59 | + |
| 60 | +#### [Fiddler](#tab/fiddler) |
| 61 | + |
| 62 | +1. Launch Fiddler and start capturing HTTP traffic. Refresh the page or perform the action that generates the request. |
| 63 | + |
| 64 | +1. Choose the request from the list and navigate to the Inspectors tab. |
| 65 | + |
| 66 | +1. Switch to the Raw view, locate the **X-Azure-Ref** header in the response headers, copy its value, and decode it using a Base64 decoder. |
| 67 | + |
| 68 | +To learn more about viewing and capturing network traffic with Fiddler, see [Web Debugging - Capture Network Traffic](https://www.telerik.com/fiddler/usecases/web-debugging). |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## How to use a RefString with some of our troubleshooting tools |
| 73 | +Azure Front Door uses a RefString to manage 4xx and 5xx errors. The following are the steps to use the diagnostic tool with a RefString for tracking and diagnosing connectivity issues: |
| 74 | + |
| 75 | +1. Navigate to your Azure Front Door Profile. |
| 76 | + |
| 77 | +1. Select the **Diagnose and solve problems** menu. |
| 78 | + |
| 79 | + :::image type="content" source="media/refstring/refstring-step-one-portal.png" alt-text="Screenshot showing the first step in diagnosing problems using a RefString." lightbox="media/refstring/refstring-step-one-portal.png"::: |
| 80 | + |
| 81 | +1. Scroll down and select **Connectivity** under the **Common problems** section. |
| 82 | + |
| 83 | + :::image type="content" source="media/refstring/refstring-step-two-portal.png" alt-text="Screenshot showing the second step in diagnosing problems using a RefString." lightbox="media/refstring/refstring-step-two-portal.png"::: |
| 84 | + |
| 85 | +1. In the box **What issue are you having?** select **Select a problem subtype** and choose **4xx and 5xx errors** on the drop down-menu, then select the **Next**. |
| 86 | + |
| 87 | + :::image type="content" source="./media/refstring/refstring-step-three-portal.png" alt-text="Screenshot showing the third step in diagnosing problems using a RefString." lightbox="media/refstring/refstring-step-three-portal.png"::: |
| 88 | + |
| 89 | +1. Enter your RefString in the box within the **4xx and 5xx errors** section. You input the Restring given to you from your request under the **Tracking Reference – RefString** field. |
| 90 | + |
| 91 | + :::image type="content" source="media/refstring/refstring-step-four-portal.png" alt-text="Screenshot showing the fourth step in diagnosing problems using a RefString." lightbox="media/refstring/refstring-step-four-portal.png"::: |
| 92 | + |
| 93 | +1. Finally, select **Run Diagnostics** to identify the cause of the issue, which explains the failure if it's a known problem. |
| 94 | + |
| 95 | + An example of a result displaying an issue: |
| 96 | + |
| 97 | + :::image type="content" source="media/refstring/refstring-example.png" alt-text="Screenshot showing an example of the diagnosis at work using a RefString." lightbox="media/refstring/refstring-example.png"::: |
| 98 | + |
| 99 | + > [!NOTE] |
| 100 | + > The diagnostic capabilities may require up to 15 minutes to deliver results. We ask for your patience that you allow the process to finish before taking further action. |
| 101 | +
|
| 102 | +### Alternative option |
| 103 | + |
| 104 | +If you choose not to use the diagnostic tool, you can include a RefString when submitting a support ticket. Additionally, you can enable the **Access Logs** feature to receive updates on RefString data directly in the Azure portal. For more information on tracking references and access log parameters, see [Monitor metrics and logs in Azure Front Door](front-door-diagnostics.md#access-log). |
| 105 | + |
| 106 | +This article highlights specific fields in access logs that help identify various types of errors: |
| 107 | + |
| 108 | +* **Cache misses:** RefString indicate whether a request was served from the cache and provide reasons if it wasn't. |
| 109 | + |
| 110 | + Example: **NOCACHE** means the request wasn't eligible for caching, **MISS** means no valid cache entry existed, and **STALE** means the cache entry was expired. |
| 111 | + |
| 112 | +* **Routing errors:** RefString can reveal if a request was routed correctly to the backend and the reason. |
| 113 | + |
| 114 | + Example: **FALLBACK** means rerouted due to primary backend issues, and **OVERRIDE** means sent to an alternative backend against routing rules. |
| 115 | + |
| 116 | +* **Backend failures:** RefString indicate if delivery to the backend succeeded and explain any issues. |
| 117 | + |
| 118 | + Example: **TIMEOUT** means the response took too long, **CONNFAIL** means connection failed, and **ERROR** indicates an error response from the backend. |
| 119 | + |
| 120 | +* **Latency problems:** RefString detail Azure Front Door's processing time and stage durations. |
| 121 | + |
| 122 | + Example: **DURATION** shows total handling time, **RTT** shows round-trip time, and **TTFB** shows the time taken to receive the first byte from the backend. |
| 123 | + |
| 124 | +## Next steps |
| 125 | + |
| 126 | +* To learn more about navigating common issues, see [Front Door Troubleshooting Issues](troubleshoot-issues.md). |
| 127 | +* For answers to common questions, see [Azure Front Door FAQ](front-door-faq.yml). |
0 commit comments