Skip to content

Commit 68e503d

Browse files
authored
Merge pull request #242650 from craigshoemaker/swa/traffic-splitting
[Static Web Apps] Traffic splitting (new article)
2 parents 66071d8 + 6d16701 commit 68e503d

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

articles/static-web-apps/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
href: application-settings.md
131131
- name: Configure front-end frameworks and libraries
132132
href: front-end-frameworks.md
133+
- name: Split traffic
134+
href: traffic-splitting.md
133135
- name: Enable monitoring
134136
href: monitor.md
135137
displayName: Application Insights
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Traffic Splitting in Azure Static Web Apps (preview)
3+
description: Learn to divert traffic from one branch to another.
4+
services: static-web-apps
5+
author: craigshoemaker
6+
ms.service: static-web-apps
7+
ms.topic: how-to
8+
ms.date: 07/10/2023
9+
ms.author: cshoe
10+
---
11+
12+
# Traffic Splitting in Azure Static Web Apps (preview)
13+
14+
Traffic splitting allows you to divert a percentage of traffic to different [branch environments](./branch-environments.md).
15+
16+
Traffic splitting is only available on the [Standard hosting plan](plans.md).
17+
18+
## Split traffic
19+
20+
Before you can split traffic between branches, you first need to have open pull requests to create separate environments.
21+
22+
To split traffic among different environments, use the following steps:
23+
24+
1. Open your static web app in the Azure portal.
25+
26+
1. From the *Settings* section, select **Environments**.
27+
28+
1. Select the **Traffic splitting** tab.
29+
30+
1. Select the **Add** button to create a new row in the traffic mapping table.
31+
32+
1. From the dropdown, select name of the pull request you want to target.
33+
34+
1. Enter the percentage amount of traffic you want to allocate among the different environments.
35+
36+
Adjust the values in each of the input boxes in the *Traffic* column so the total equals 100%.
37+
38+
1. Select **Save** to commit your changes.
39+
40+
## Disable traffic splitting
41+
42+
To disable traffic splitting, select the **Traffic splitting** to open the settings window.
43+
44+
Remove all nonproduction environments from the list and save your changes.
45+
46+
## Next steps
47+
48+
> [!div class="nextstepaction"]
49+
> [Use preview environments](preview-environments.md)

0 commit comments

Comments
 (0)