|
| 1 | +--- |
| 2 | +title: Manage Azure Load Balancer health status |
| 3 | +titleSuffix: Azure Load Balancer |
| 4 | +description: Learn how to manage Azure Load Balancer health status to get detailed health information about the backend instances in your Azure Load Balancer backend pool. |
| 5 | +author: mbender-ms |
| 6 | +ms.service: azure-load-balancer |
| 7 | +ms.topic: concept-article |
| 8 | +ms.date: 10/30/2024 |
| 9 | +ms.author: mbender |
| 10 | +ms.custom: references_regions |
| 11 | +--- |
| 12 | + |
| 13 | +# Manage Azure Load Balancer Health Status |
| 14 | + |
| 15 | +Health status is an Azure Load Balancer feature that gives detailed health information about the backend instances in your Azure Load Balancer backend pool. Linked to your load balancing rule, this status provides insights into the health state and reasoning of these backend instances. |
| 16 | + |
| 17 | +## State of backend instances |
| 18 | + |
| 19 | +Health status exposes the state of your backend instances. There are two state values: |
| 20 | + |
| 21 | +| **State** | **Description** | |
| 22 | +|-----------|-----------------| |
| 23 | +| Up | This state value represents a healthy backend instance. | |
| 24 | +| Down | This state value represents an unhealthy backend instance. | |
| 25 | + |
| 26 | +## Reason codes |
| 27 | + |
| 28 | +Health status also exposes reason codes, categorized into User Triggered Reason Codes and Platform Triggered Reason Codes. These codes help you understand the precise reasons for the health probe state of your backend instances and why they're being probed Up or Down. |
| 29 | + |
| 30 | +### User Triggered Reason Codes |
| 31 | + |
| 32 | +User triggered reason codes are triggered based on how you configured your Load Balancer; these can be addressed by you, the user. The following tables describe the user-triggered reason codes along with the portal displayed reason for success and failed reason codes. |
| 33 | + |
| 34 | +#### Success reason codes |
| 35 | + |
| 36 | +The following table describes the success reason codes where the backend state is equal to **Up**: |
| 37 | + |
| 38 | +| **Reason Code** | **Portal displayed reason** | **Description** | |
| 39 | +|-------------|-------------------------|-------------| |
| 40 | +| **Up_Probe_Succes**s | The backend instance is responding to health probe successfully. | Your backend instance is responding to the health probe successfully. | |
| 41 | +| **Up_Probe_AllDownIsUp** | The backend instance is considered healthy due to enablement of *NoHealthyBackendsBehavior*. | Health probe state of the backend instance is ignored because *NoHealthyBackendsBehavior* is enabled. The backend instance is considered healthy and can receive traffic. | |
| 42 | +| **Up_Probe_ApproachingUnhealthyThreshold** | Health probe is approaching an unhealthy threshold but backend instance remains healthy based on last response. | The most recent probe has failed to respond but the backend instance remains healthy enough based on earlier responses. | |
| 43 | +| **Up_Admin**| The backend instance is healthy due to Admin State set to *Up*. | Health probe state of the backend instance is ignored because the Admin State is set to *UP*. The backend instance is considered healthy and can receive traffic. | |
| 44 | + |
| 45 | +#### Failure reason codes |
| 46 | + |
| 47 | +The following table describes the failure reason codes where the backend state is equal to **Down**: |
| 48 | + |
| 49 | +| **Reason Code** | **Portal displayed reason** | **Description** | |
| 50 | +|-------------|-------------------------|-------------| |
| 51 | +| **Down_Probe_ApproachingHealthyThreshold** | Health probe is approaching a healthy threshold but backend instance remains unhealthy based on last response. | The most recent probe outcome is positive, but it doesn't meet the required number of responses in the healthy threshold, so the backend instance remains unhealthy. | |
| 52 | +| **Down_Probe_HttpStatusCodeError** | A non-200 HTTP status code received; meaning there's an issue with the application listening on the port. | Your backend instance is returning a non-200 HTTP status code indicating an issue with the application listening on the port. | |
| 53 | +| **Down_Probe_HttpEndpointUnreachable** | HTTP endpoint unreachable; meaning either an NSG rule blocking port or unhealthy app listening on port. | The health probe was able to establish a TCP handshake with your backend instance but the HTTP session was rejected which indicates two possibilities: An NSG rule blocking the port or no healthy application listening on the port. | |
| 54 | +| **Down_Probe_TcpProbeTimeout** | TCP probe timeout; meaning either unhealthy backend instance, blocked health probe port, or unhealthy app listening on port. | Your backend instance has sent back no TCP response within the probe interval. This indicates three possibilities: An unhealthy Backend Instance, blocked health probe port, or unhealthy application listening on the port. | |
| 55 | +| **Down_Probe_NoHealthyBackend** | No healthy backend instances behind the regional load balancer. | Your regional load balancer that is associated with a Global Load Balancer has no healthy backend instances behind it. | |
| 56 | +| **Down_Admin** | The backend instance is unhealthy due to *Admin State* set to *Down*. | Health probe state of the backend instance is ignored because the *Admin State* is set to *Down*. The backend instance is considered unhealthy and can't receive new traffic. | |
| 57 | +| **Down_Probe_HttpNoResponse** | Application isn't returning a response. | The health probe was able to establish an HTTP session but the application isn't returning a response. This indicates an unhealthy application listening on the port. | |
| 58 | + |
| 59 | +> [!NOTE] |
| 60 | +> In rare cases, **NA** will show as a reason code. This code is shown when the health probe has not probed your backend instance yet so there is no reason code to display. |
| 61 | +
|
| 62 | +### Platform Triggered reason codes |
| 63 | + |
| 64 | +Platform triggered reason codes are triggered based on the Azure Load Balancer’s platform; these codes can't be addressed by you, the user. The following table below describes each reason code: |
| 65 | + |
| 66 | +| **Reason Code** | **Portal displayed reason** | **Description** | |
| 67 | +|-------------|-------------------------|-------------| |
| 68 | +| **Up_Platform** | The backend instance is responding to the health probe successfully, but there may be an infrastructure related issue. The Azure service team is alerted and will resolve the issue.| The backend instance is responding to the health probe successfully, but there can be an infrastructure related issue. The Azure service team is alerted and will resolve the issue. | |
| 69 | +| **Down_Platform** | The backend instance is unhealthy due to an infrastructure related issue. The Azure service team is alerted and will resolve the issue. | The backend instance is unhealthy due to an infrastructure related issue. The Azure service team is alerted and will resolve the issue. | |
| 70 | + |
| 71 | +## How to retrieve health status |
| 72 | + |
| 73 | +Health status can be retrieved on a per load balancing rule basis. This is supported via Azure port and REST API. |
| 74 | + |
| 75 | +# [Azure portal](#tab/azure-portal) |
| 76 | + |
| 77 | +1. Sign in to the Azure portal. |
| 78 | +2. In the search bar, enter **Load Balancers** and select **Load Balancers** from the search results. |
| 79 | +3. On the **Load Balancers** page, select your load balancer from the list. |
| 80 | +4. In your load balancer's **Settings** section, select **Load balancing rules**. |
| 81 | +5. In the **Load balancing rules** page, select **View details** under the **Health status** column for the rule you want to view. |
| 82 | + |
| 83 | + :::image type="content" source="media/load-balancer-manage-health-status/load-balancing-rules-list-small.png" alt-text="Screenshot of list of load balancing rules with health status link." lightbox="media/load-balancer-manage-health-status/load-balancing-rules-list.png"::: |
| 84 | + |
| 85 | +6. Review the health status of your backend instances in the **Load balancing rule health status** window. |
| 86 | +7. To retrieve the latest health status, select **Refresh**. |
| 87 | + |
| 88 | + :::image type="content" source="media/load-balancer-manage-health-status/load-balancing-rule-health-status.png" alt-text="Screenshot of health status for load balancing rule."::: |
| 89 | + |
| 90 | + > [!IMPORTANT] |
| 91 | + > The Load balancing rule health status window may take a few minutes to load the health status of your backend instances. |
| 92 | +
|
| 93 | +1. Select **Close** to exit the **Load balancing rule health status** window. |
| 94 | + |
| 95 | +# [REST API](#tab/rest-api) |
| 96 | + |
| 97 | +To retrieve the health status information via REST API, you need to do a two request process. |
| 98 | + |
| 99 | +> [!NOTE] |
| 100 | +> Using the REST API method requres that you have a **Bearer access token** for autorization. For assistance retrieving the access token, see [Get-AzAccessToken](/powershell/module/az.accounts/get-azaccesstoken) for details. |
| 101 | +
|
| 102 | +1. Use the following POST request to obtain the Location URI from the Response Headers. |
| 103 | + |
| 104 | + ```rest |
| 105 | + POST https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/loadBalancingRules/<loadBalancingRulesName>/health?api-version=2024-03-01&preserve-view=true |
| 106 | + Authorization: Bearer <access token> |
| 107 | + ``` |
| 108 | +
|
| 109 | +1. Copy the Location URI from the Response Headers. Location URI should follow this schema. |
| 110 | +
|
| 111 | + ```rest |
| 112 | + https://management.azure.com/subscriptions/<subscriptionId>/providers/Microsoft.Network/locations/<locationName>/operationResults/<operationResultsId>?api-version=2024-03-01&preserve-view=true |
| 113 | + ``` |
| 114 | + |
| 115 | +1. Use the copied Location URI to make a GET request. |
| 116 | + |
| 117 | + ```rest |
| 118 | + GET https://management.azure.com/subscriptions/<subscriptionId>/providers/Microsoft.Network/locations/<locationName>/operationResults/<operationResultsId>?api-version=2024-03-01&preserve-view=true |
| 119 | + |
| 120 | + Authorization: Bearer <access token> |
| 121 | + ``` |
| 122 | + |
| 123 | +1. A status code of 200 is returned and the health status information is displayed in the response body similar to this example response: |
| 124 | + |
| 125 | + ```JSON |
| 126 | + { |
| 127 | + "up": 2, |
| 128 | + "down": 0, |
| 129 | + "loadBalancerBackendAddresses": [ |
| 130 | + { |
| 131 | + "ipAddress": "10.0.2.5", |
| 132 | + "networkInterfaceIPConfigurationId": "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/networkInterfaces/<networkInterfaceName>/ipConfigurations/<ipConfigurationName>", |
| 133 | + "state": "Up", |
| 134 | + "reason": "Up_Admin" |
| 135 | + }, |
| 136 | + { |
| 137 | + "ipAddress": "10.0.2.4", |
| 138 | + "networkInterfaceIPConfigurationId": "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/networkInterfaces/<networkInterfaceName>/ipConfigurations/<ipConfigurationName>", |
| 139 | + "state": "Up", |
| 140 | + "reason": "Up_Probe_Success" |
| 141 | + } |
| 142 | + ] |
| 143 | + } |
| 144 | + |
| 145 | + ``` |
| 146 | + |
| 147 | +## Design considerations |
| 148 | + |
| 149 | +When using the health status feature, consider the following design considerations: |
| 150 | + |
| 151 | +- If the virtual machine instance in the backend pool is turned off, health status returns empty values since the health status isn't retrievable. |
| 152 | +- If you're using a global load balancer, health status displays the reason as *Down_Platform** when a regional load balancer’s backend pool is an IP-based backend address that isn't associated with a virtual machine instance. |
| 153 | +- For retrieving health status, the Azure portal and REST API methods are the only supported methods. |
| 154 | + |
| 155 | +## Limitations |
| 156 | + |
| 157 | +When using the health status feature, consider the following limitations: |
| 158 | + |
| 159 | +- Health status isn’t supported for nonprobed load balancing rules. |
| 160 | +- Health status isn’t supported for Gateway Load Balancer. |
| 161 | + |
| 162 | +## Next steps |
| 163 | +> [!div class="nextstepaction"] |
| 164 | +> [Create a public load balancer with an IP-based backend using the Azure portal](tutorial-load-balancer-ip-backend-portal.md) |
0 commit comments