You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/application-gateway/how-to-troubleshoot-application-gateway-session-affinity-issues.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,35 +23,35 @@ Learn how to diagnose and resolve session affinity issues with Azure Application
23
23
The cookie-based session affinity feature is useful to keep a user session on the same server. By using gateway-managed cookies, the Application Gateway can direct subsequent traffic from a user session to the same server for processing. This is important in cases where session state is saved locally on the server for a user session. Session affinity is also known as sticky sessions.
24
24
25
25
> [!NOTE]
26
-
> Application Gateway v1 issues a cookie called ARRAffinity, which is used to direct traffic to the same backend pool member. In Application Gateway v2, this cookie has been renamed to ApplicationGatewayAffinity. For the purposes of this document, ApplicationGatewayAffinity will be used as an example, ARRAffinity can be substituted in where applicable for Application Gateway v1 instances.
26
+
> Application Gateway v1 issues a cookie called ARRAffinity, which is used to direct traffic to the same backend pool member. In Application Gateway v2, this cookie was renamed to ApplicationGatewayAffinity. For the purposes of this document, ApplicationGatewayAffinity is used as an example, ARRAffinity can be substituted in where applicable for Application Gateway v1 instances.
27
27
28
28
## Possible problem causes
29
29
30
-
The problem in maintaining cookie-based session affinity may happen due to the following main reasons:
30
+
The problem in maintaining cookie-based session affinity can happen due to the following main reasons:
31
31
32
-
- “Cookie-based Affinity” setting is not enabled
33
-
- Your application cannot handle cookie-based affinity
32
+
- “Cookie-based Affinity” setting isn't enabled
33
+
- Your application can't handle cookie-based affinity
34
34
- Application is using cookie-based affinity but requests still bouncing between backend servers
35
35
36
36
### Check whether the "Cookie-based Affinity” setting is enabled
37
37
38
-
Sometimes the session affinity issues might occur when you forget to enable “Cookie based affinity” setting. To determine whether you have enabled the “Cookie based affinity” setting on the HTTP Settings tab in the Azure portal, follow the instructions:
38
+
Sometimes the session affinity issues might occur when you forget to enable “Cookie based affinity” setting. To determine whether you enabled the “Cookie based affinity” setting on the Backend Settings tab in the Azure portal, follow the instructions:
39
39
40
-
1.Log on to the [Azure portal](https://portal.azure.com/).
40
+
1.Sign in to the [Azure portal](https://portal.azure.com/).
41
41
42
-
2. In the **left navigation** pane, click**All resources**. Click the application gateway name in the All resources blade. If the subscription that you selected already has several resources in it, you can enter the application gateway name in the **Filter by name…** box to easily access the application gateway.
42
+
2. In the **left navigation** pane, select**All resources**. Select the application gateway name in the All resources blade. If the subscription that you selected already has several resources in it, you can enter the application gateway name in the **Filter by name…** box to easily access the application gateway.
43
43
44
-
3. Select **HTTP settings** tab under **SETTINGS**.
44
+
3. Select **Backend settings** tab under **SETTINGS**.
45
45
46
-

46
+

47
47
48
-
4. Select the HTTP setting, and on the **Add HTTP setting** page, check if **Cookie based affinity** is enabled.
48
+
4. Select the backend setting, and on the **Add Backend setting** page, check if **Cookie based affinity** is enabled.
49
49
50
50

51
51
52
52
53
53
54
-
You can also check the value of the “**CookieBasedAffinity**” is set to *Enabled*under "**backendHttpSettingsCollection**" by using one of the following methods:
54
+
You can also check the value of the “**CookieBasedAffinity**” is set to *Enabled*under "**backendHttpSettingsCollection**" by using one of the following methods:
55
55
56
56
- Run [Get-AzApplicationGatewayBackendHttpSetting](/powershell/module/az.network/get-azapplicationgatewaybackendhttpsetting) in PowerShell
57
57
- Look through the JSON file by using the Azure Resource Manager template
@@ -60,28 +60,28 @@ You can also check the value of the “**CookieBasedAffinity**” is set to *Ena
60
60
"cookieBasedAffinity": "Enabled",
61
61
```
62
62
63
-
### The application cannot handle cookie-based affinity
63
+
### The application can't handle cookie-based affinity
64
64
65
65
#### Cause
66
66
67
67
The application gateway can only perform session-based affinity by using a cookie.
68
68
69
69
#### Workaround
70
70
71
-
If the application cannot handle cookie-based affinity, you must use an external or internal azure load balancer or another third-party solution.
71
+
If the application can't handle cookie-based affinity, you must use an external or internal Azure load balancer or another third-party solution.
72
72
73
73
### Application is using cookie-based affinity but requests still bouncing between backend servers
74
74
75
75
#### Symptom
76
76
77
-
You have enabled the Cookie-based Affinity setting, when you access the Application Gateway by using a short name URL in Internet Explorer, for example: `http://website` , the request is still bouncing between backend servers.
77
+
You enabled the Cookie-based Affinity setting, when you access the Application Gateway by using a short name URL in Internet Explorer, for example: `http://website` , the request is still bouncing between backend servers.
78
78
79
79
To identify this issue, follow the instructions:
80
80
81
-
1. Take a web debugger trace on the “Client” which is connecting to the application behind the Application Gateway(We are using Fiddler in this example).
81
+
1. Take a web debugger trace on the “Client” which is connecting to the application behind the Application Gateway(We're using Fiddler in this example).
82
82
**Tip** If you don't know how to use the Fiddler, check the option "**I want to collect network traffic and analyze it using web debugger**" at the bottom.
83
83
84
-
2. Check and analyze the session logs, to determine whether the cookies provided by the client have the ApplicationGatewayAffinity details. If you don't find the ApplicationGatewayAffinity details, such as "**ApplicationGatewayAffinity=***ApplicationGatewayAffinityValue*" within the cookie set, that means the client is not replying with the ApplicationGatewayAffinity cookie, which is provided by the Application Gateway.
84
+
2. Check and analyze the session logs, to determine whether the cookies provided by the client have the ApplicationGatewayAffinity details. If you don't find the ApplicationGatewayAffinity details, such as "**ApplicationGatewayAffinity=***ApplicationGatewayAffinityValue*" within the cookie set, that means the client isn't replying with the ApplicationGatewayAffinity cookie, which is provided by the Application Gateway.
85
85
For example:
86
86
87
87

@@ -96,7 +96,7 @@ This issue occurs because Internet Explorer and other browsers may not store or
96
96
97
97
#### Resolution
98
98
99
-
To fix this issue, you should access the Application Gateway by using a FQDN. For example, use [http://website.com](https://website.com/) or [http://appgw.website.com](http://website.com/) .
99
+
To fix this issue, you should access the Application Gateway by using a Fully Qualified Domain Name (FQDN). For example, use [http://website.com](https://website.com/) or [http://appgw.website.com](http://website.com/) .
100
100
101
101
## Additional logs to troubleshoot
102
102
@@ -127,9 +127,9 @@ Enable logging using the Azure portal.
127
127
128
128
### Use web debugger to capture and analyze the HTTP or HTTPS traffics
129
129
130
-
Web debugging tools like Fiddler, can help you debug web applications by capturing network traffic between the Internet and test computers. These tools enable you to inspect incoming and outgoing data as the browser receives/sends them. Fiddler, in this example, has the HTTP replay option that can help you troubleshoot client-side issues with web applications, especially for authentication kind of issue.
130
+
Web debugging tools like Fiddler can help you debug web applications by capturing network traffic between the Internet and test computers. These tools enable you to inspect incoming and outgoing data as the browser receives/sends them. Fiddler, in this example, has the HTTP replay option that can help you troubleshoot client-side issues with web applications, especially for authenticaton issues.
131
131
132
-
Use the web debugger of your choice. In this sample we will use Fiddler to capture and analyze http or https traffics, follow the instructions:
132
+
Use the web debugger of your choice. In this sample we'll use Fiddler to capture and analyze http or https traffics, follow the instructions:
@@ -144,23 +144,23 @@ Use the web debugger of your choice. In this sample we will use Fiddler to captu
144
144
145
145

146
146
147
-
4. Most likely, you will be interested in decrypted HTTPS traffic, and you can enable HTTPS decryption by selecting **Tools** > **Fiddler Options**, and check the box " **Decrypt HTTPS traffic**".
147
+
4. Most likely, you'll be interested in decrypted HTTPS traffic, and you can enable HTTPS decryption by selecting **Tools** > **Fiddler Options**, and check the box " **Decrypt HTTPS traffic**".
148
148
149
149

150
150
151
151
5. You can remove previous unrelated sessions before reproducing the issue by clicking **X** (icon) > **Remove All** as follow screenshot:
152
152
153
153

154
154
155
-
6. Once you have reproduced the issue, save the file for review by selecting **File** > **Save** > **All Sessions..**.
155
+
6. Once you reproduce the issue, save the file for review by selecting **File** > **Save** > **All Sessions..**.
156
156
157
157

158
158
159
159
7. Check and analyze the session logs to determine what the issue is.
160
160
161
161
For examples:
162
162
163
-
-**Example A:** You find a session log that the request is sent from the client, and it goes to the public IP address of the Application Gateway, click this log to view the details. On the right side, data in the bottom box is what the Application Gateway is returning to the client. Select the “RAW” tab and determine whether the client is receiving a "**Set-Cookie: ApplicationGatewayAffinity=***ApplicationGatewayAffinityValue*." If there's no cookie, session affinity isn't set, or the Application Gateway isn't applying cookie back to the client.
163
+
-**Example A:** You find a session log that the request is sent from the client, and it goes to the public IP address of the Application Gateway, select this log to view the details. On the right side, data in the bottom box is what the Application Gateway is returning to the client. Select the “RAW” tab and determine whether the client is receiving a "**Set-Cookie: ApplicationGatewayAffinity=***ApplicationGatewayAffinityValue*." If there's no cookie, session affinity isn't set, or the Application Gateway isn't applying cookie back to the client.
164
164
165
165
> [!NOTE]
166
166
> This ApplicationGatewayAffinity value is the cookie-id, that the Application Gateway sets for the client to be sent to a particular backend server.
@@ -172,10 +172,10 @@ Use the web debugger of your choice. In this sample we will use Fiddler to captu
172
172

173
173
174
174
> [!NOTE]
175
-
> For the same communication session, the cookie should not to change. Check the top box on the right side, select "Cookies" tab to see whether the client is using the cookie and sending it back to the Application Gateway. If not, the client browser isn't keeping and using the cookie for conversations. Sometimes, the client might lie.
175
+
> For the same communication session, the cookie shouldn't change. Check the top box on the right side, select "Cookies" tab to see whether the client is using the cookie and sending it back to the Application Gateway. If not, the client browser isn't keeping and using the cookie for conversations. Sometimes, the client might lie.
176
176
177
177
178
178
179
179
## Next steps
180
180
181
-
If the preceding steps do not resolve the issue, open a [support ticket](https://azure.microsoft.com/support/options/).
181
+
If the preceding steps don't resolve the issue, open a [support ticket](https://azure.microsoft.com/support/options/).
0 commit comments